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)

General 05-23-2001 06: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

well...
 
maybe doing using some other method...

NPC Code:

// 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...


All times are GMT +2. The time now is 11:19 PM.

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