Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Actionplayeronline substitute? (https://forums.graalonline.com/forums/showthread.php?t=45473)

DarkDragoon_Lloyd 06-14-2003 08:38 AM

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?

zell12 06-14-2003 09:18 AM

something along the lines of this mabey?
if (actionplayeronline) {
for (i=0; i<allplayerscount; i++) {
with (allplayers[i]) {
commands...
}
}
}

Neoreno 06-14-2003 01:31 PM

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.

CheeToS2 06-14-2003 03:39 PM

Quote:

Originally posted by Neoreno
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.
actionplayeronline isn't triggered when an RC logs on at all

osrs 06-14-2003 04:41 PM

NPC Code:

if(actionplayeronline){
for(i=0;i<allplayerscount;i++){
with(allplayers[i]){
if(strlen(#F)<=0){
}
}
}
}



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)

CheeToS2 06-14-2003 04:43 PM

Quote:

Originally posted by osrs
NPC Code:

if(actionplayeronline){
for(i=0; i<allplayerscount; i++){
with(allplayers[i]){
if(strlen(#F)<=0){
}
}
}
}



well,wouldnt this detect when a RC logged on?!

no, that would make it so when a player logs on, it executes that script on whatever RCs are already logged on

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

osrs 06-14-2003 04:50 PM

Quote:

Originally posted by CheeToS2

no, that would make it so when a player logs on, it executes that script on whatever RCs are already logged on

Hmm,i read the script again and you are completely right.

screen_name 06-15-2003 05:01 PM

Quote:

Originally posted by CheeToS2

actionplayeronline isn't triggered when an RC logs on at all

Was I the only one that read this?

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.

Falados 06-16-2003 03:42 AM

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.

CheeToS2 06-16-2003 04:46 AM

Quote:

Originally posted by Falados
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.
You just said the same thing I did, with different words ;-;

Falados 06-17-2003 05:15 PM

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.