Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Help (https://forums.graalonline.com/forums/showthread.php?t=3243)

Lugie 05-20-2001 09:21 AM

Help
 
well, im updating my house to be very secure. here is what i need:

if the account Lugie says "key1 account", the flag lugiekey1 is set to the account Lugie says.

can anybody help?:confused:

_Shoey_Fighter_ 05-20-2001 10:42 AM

You can do it with the new scripting command, I think, but they would have to have the weapon as well...

Lugie 05-20-2001 11:46 AM

errrr... cant i do it with the npc server, but make it

//#CLIENTSIDE

?

05-20-2001 10:54 PM

Here
 
This is for giving the key to the player you want.
NPC Code:


if (#a=Lugie && strequals(#c,give key #a)) {
message The Player #a now gots a key.;
set gotkey;
sleep 2;
message;
}




This is for unseting the key off the player.

NPC Code:


if (#a=Lugie&&strequals(#c,Take key #a)) {
message The Player #a's key was tooken.;
unset gotkey;
sleep 2;
message;
}



CrazedMerlin 05-20-2001 11:19 PM

Wow
Ice Pick is helping!@
:)

05-21-2001 12:15 AM

Hehe, I am trying to figger out how to make it when he says 'Show owner' It will show the account name(s) with the flag to get in. :)

05-21-2001 12:16 AM

Oh yeah Lugie
 
Lugie, With that script put //#CLIENTSIDE at the top of it, I dont know how to script with the npc server that good, So I did it on the CLIENTSIDE.

Lugie 05-21-2001 05:17 AM

thanks pick, i like "gots" and "tooken" ^.^

Lugie 05-21-2001 05:25 AM

it seems to me that it would set that flag to MY account though...

05-21-2001 08:06 AM

Yes, You are right. Sorry I am dump :( Let me rescript it.

05-22-2001 04:48 AM

Here is the right one.

NPC Code:


// NPC made by Ice Pick
timeout = .5;
if (playerenters) {toweapons *system
}
if(playerchats){tokenize #c; if(strequals(#t(0),give)&&strequals(#t(1),key)&&st requals(#a,IcePick)){setstring KeyAccount, #t(2)}}
if(timeout){if(strequals(#a,#s(KeyAccount))){set HasTheKey}timeout = .5}



Lugie 05-22-2001 06:11 AM

errr... i dont get it...

why does it have your account in it?

05-22-2001 06:34 AM

Oh, I was testing it out so I put mine in their

kyle0654 05-22-2001 06:44 AM

hehe, Ice Pick is getting there....

personally, I wouldn't set flags...I'd set a string with all the people that have a key and check them as they come in...like this:

NPC Code:

if (playerchats && startswith(#c,give key) && strequals(#a,Lugie)) {
tokenize #T(#e(8,-1,#c));
setstring this.KeyAccounts,#s(this.KeyAccounts) #s(#t(0));
message Key given to #t(0);
timeout = 3;
}
if (playerchats && startswith(#c,take key) && strequals(#a,Lugie)) {
setstring this.RemoveAcct,#T(#e(8,-1,#c));
tokenize #s(this.KeyAccounts);
for (i = 0; i < tokenscount; i++) {
if (!strequals(#t(i),#s(this.RemoveAcct)
setstring this.TempKeys, #s(this.TempKeys) #s(#t(i));
}
setstring this.KeyAccounts,#s(this.TempKeys);
}


not 100% guaranteed to work, but it should

-Kyle

05-23-2001 03:01 AM

Thanks for helping me help Lugie Kyle :D


All times are GMT +2. The time now is 05:02 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.