![]() |
Script Help.
Well, i'm trying to get this so that when a player gets online he adds his account name to a string and then an NPC checks that string and if the players online don't match the names in the string, a little message saying, "Player <accout namr> has left game."
Currently I Have: NPC Code: Any help or input would be appreciated. BTW, this is all serverside database NPCs. |
LOL, the way I was considering doing something like this was:
[code] if (actionplayeronline) { setstring this.online,#s(this.online),#a; timeout=1; } if (timeout) { tokenize2 ,,#s(this.online); for (i=0;i<tokenscount;i++) { with (getplayer(#t(i))) { if (!playerisonline) { actions to show that they are not online; for (o=0;o<tokenscount;o++) { deletestring this.online,#s(this.online)-#t(i);} } } } } ---Shifter gtg bell rang! |
if (actionplayeronline) { << - Put this in the Control NPC, then add it to the string and check the name, etc etc
|
There is an easyer way of check if a string is in a string array. Do this:
if(lindexof(str,strarray)>-1) thats to check if it is in a string array if(lindexof(str,strarray)=-1) checks if it isnt in a string array |
I loved it when Stefan released string arrays.
Before that I had to: NPC Code: All that code compacted into one little bit of code. :p |
All times are GMT +2. The time now is 06:03 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.