Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Server (https://forums.graalonline.com/forums/forumdisplay.php?f=14)
-   -   Does it work with npcserver tho..... (https://forums.graalonline.com/forums/showthread.php?t=16702)

Saga2001 11-12-2001 11:48 AM

Does it work with npcserver tho.....
 
ok.
i made a script on a different threa, it was a playerhouse key type thing, and i want to know if it would work on npc server, i am new to npcserver, and i am a nat cadet on andor, and if it doesn't than can anyone tell me why?

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);
}
}
}


Saga2001 11-12-2001 11:59 AM

oops
 
forgot to end code...
oh well
but mind you thats my first script for npc server lol so if it don't work sorry...

Andor_GP1 11-12-2001 09:46 PM

Well it can't be clientside if its gonna read and set serverflags =p

Saga2001 11-12-2001 11:36 PM

? weirdness ?
 
Weird, I need to find a place with tutorials about npc server...
I do not think I understand why...I know that server flags are server side, but if I remove the //#CLIENTSIDE will it work.
--PastAustin (Carrot)

IceFire_TK 11-13-2001 01:46 AM

[SPAM] This is Spam[/SPAM]
[*****]This is my ****[/*****]


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

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