Graal Forums

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

nyghtGT 09-25-2001 10:17 AM

tokenizing test ...
 
would this be correct ?

if (playerchats && startswith(jail player,#c) && strequals(#g,GP)) {tokenize #c;
setstring server.jailaccount,#t(3);
}

so if the GP says jail account nyghtGT it would set the string
server.jailaccount=nyghtGT right ?

This is my first time using tokenizing like this so thats why i am asking ...

BocoC 09-25-2001 11:48 AM

Re: tokenizing test ...
 
Quote:

Originally posted by nyghtGT
would this be correct ?

if (playerchats && startswith(jail player,#c) && strequals(#g,GP)) {tokenize #c;
setstring server.jailaccount,#t(3);
}

Nope. #t(n) starts at zero. jail is #t(0), player is #t(1), and the player name is #t(2). So:
NPC Code:

if (playerchats && startswith(jail player,#c)) {
if (strequals(#g,GP)) {
tokenize #c;
setstring server.jailaccount,#t(2);
}
}


nyghtGT 09-25-2001 12:14 PM

kool ...
 
thanx ...


All times are GMT +2. The time now is 09:21 AM.

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