![]() |
Actionplayeronline substitute?
OK, well I was working on a script, and it required actionplayeronline, but apparently it doesn't check if someone gets onto RC...
Is there some way I could substitute a script for actionplayeronline? I was thinking something that sees if allplayerscount has increased from the previous ammount, and that might work(although, it could be flawed if a player logged off around the same time a player logged on)... \= Any suggestions? |
something along the lines of this mabey?
if (actionplayeronline) { for (i=0; i<allplayerscount; i++) { with (allplayers[i]) { commands... } } } |
If a player logs on, use a for loop and check if the player that logged on has a levelname of "". That'll generally be an RC.
|
Quote:
|
NPC Code: well,wouldnt this detect when a RC logged on?! also,i think you cant replace actionplayeronline for checking when a player enters on the playerworld. (I may be wrong) |
Quote:
you could make two strings comparing the RCs that were online last time the script checked, but still, it would depend on when a player logs on, which could be hours. You could just make it a timeout too, instead of actionplayeronline.. but it would take up more resources |
Quote:
|
Quote:
If it's true, then the scripts that you guys have produced doesn't matter. Hell, you could have several RCs log on before another player does. |
You could have a looping NPC that checks the RCs that are currently online and stores a list of their accounts in a string, then every loop, check the new list of RC accounts to the old list to see if some RC logged off or logged on, and act accordingly. Although I dont recommend server-side loops for something unimportant like a staff-tool or something.
|
Quote:
|
Oops, I wasn't reading replys, I was just giving a suggestion.
|
| All times are GMT +2. The time now is 12:59 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.