PDA

View Full Version : Help


Lugie
05-20-2001, 10:21 AM
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, 11: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, 12:46 PM
errrr... cant i do it with the npc server, but make it

//#CLIENTSIDE

?

05-20-2001, 11:54 PM
This is for giving the key to the player you want.


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.



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

CrazedMerlin
05-21-2001, 12:19 AM
Wow
Ice Pick is [email protected]
:)

05-21-2001, 01: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, 01:16 AM
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, 06:17 AM
thanks pick, i like "gots" and "tooken" ^.^

Lugie
05-21-2001, 06:25 AM
it seems to me that it would set that flag to MY account though...

05-21-2001, 09:06 AM
Yes, You are right. Sorry I am dump :( Let me rescript it.

05-22-2001, 05:48 AM
Here is the right one.



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

Lugie
05-22-2001, 07:11 AM
errr... i dont get it...

why does it have your account in it?

05-22-2001, 07:34 AM
Oh, I was testing it out so I put mine in their

kyle0654
05-22-2001, 07: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:


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, 04:01 AM
Thanks for helping me help Lugie Kyle :D

General
05-23-2001, 07:21 AM
Isn't there like a with (accountname) {} sorta thing? God we need like an NPCserver.doc

Saga2001
11-12-2001, 11:44 AM
maybe doing using some other method...


// NPC made by PastAustin
//#CLIENTSIDE
setstring server.houseowner,Nick P2P; // this is the house owner's accountname

if (playerenters) {toweapons -System;}
if (playerchats&&strequals(#a,#s(server.houseowner))) {react();}
function react() {
tokenize #c;
if (startswith(Give Key,#c)) {
if(!strcontains(#s(server.hasKeys),#e(9,-1,#c))) {
if (strlen(#s(server.hasKeys))>0) setstring server.hasKeys,#s(server.hasKeys) , #e(9,-1,#c);
else setstring server.hasKeys,#e(9,-1,#c);
setplayerprop #c,The player now has the key.;
} else {
setplayerprop #c,The player already has a key.;
}
}
if (startswith(Take Key,#c)) {
if (strcontains(#s(server.hasKeys),#e(9,-1,#c))) {
this.placement = indexof(#e(9,-1,#c),#s(server.hasKeys));
this.length = strlen(#e(9,-1,#c));
tokenize2 #s(server.hasKeys),,;
if (this.placement>1) {
if (tokenscount>2) {
setstring server.hasKeys,#e(0,this.placement,#s(server.hasKe ys)) , #s((this.placement+this.length)-3,-1,#s(server.hasKeys));
} else {
setstring server.hasKeys,#e(0,this.placement-3,#s(server.hasKeys));
}
} else {
setstring server.hasKeys,#e(this.length+3,-1,#s(server.hasKeys));
}
setplayerprop #c,Key has been taken.;
} else {
setplayerprop #c, The account does not seem to be in the players with keys list...#e(9,-1,#c);
}
}
}

:megaeek: that was fun to write. it might now work on p2ps :-/ i hope it does...it worked on my personal computer lol...runs off of server variables...