![]() |
How to detect RC login
Hello. I'm not new to GS2, but I am new to now trying to take it seriously in creating my own things and not just know a few commands and loops and such.
I am currently trying to make a message (or announcement) to echo on RC when a players RC is logged on. I am using the control NPC to do this, and am wondering if it is possible. Right now I can only get a message to be triggered when the players client logs in. So I have something like..... PHP Code:
Sorry if this is so simple, just trying to progress. Thanks ahead for any responses. Will rep accordingly. |
check the level name
|
Unless a function was added to handle it, I've been using a timeout loop. I.e:
PHP Code:
Also instead of maintaining a 'this.staff' array you can just directly reference your server options. temp.staff = serveroptions.staff.tokenize(","); The tokenize(",") is just in case someone messes up the array formatting. |
Quote:
rep++ if i can |
Quote:
|
Quote:
perfectly explained. |
Annoying that we can't get basic events like onRemotePlayerLogin and have to use timeouts for stuff like this.
|
Like Cubical was suggesting can't you just check to see if the level exists or not with onPlayerLogin(obj)?
Or am I missing something? |
Quote:
|
Quote:
Edit: Yeah that is odd. |
Quote:
|
Quote:
|
I posted this in the Code Gallery a while back, might be useful.
http://forums.graalonline.com/forums...ad.php?t=87280 |
There should be an easier way to do this without timeout.. I have a script currently that shows players who login on your screen like XBL and PSN do.. it uses a funciton when the player logs in.. this also shows rc's... have you tried
on PlayerLogin() I think is the command.. might be wrong its been a while. then do a check for null level.. |
Quote:
PHP Code:
|
Quote:
PHP Code:
And I know this for FACT because when I login my rc.. I get the error "you do not have admin rights" unless i use in-game rc.. and it will spam my notification system so bad i have to reconnect or sit thru a half hour of spam |
I just tested it again with the script in a weapon and it did not work.
|
I retested my script, conclusion!
(F6) Does NOT show work. (Remote Control) This works with my method. Not sure why there is a difference. But I can post a demo script if you would like? *EDIT* Tested using Graal6 |
i'm not sure triggerclient would work on RC's... for the reason that any clientside actions doesn't work on RC's "players"...
|
I just tested the code on Testbed too and it doesn't work, at least not for the scenario this thread wanted to use it on.
"I am currently trying to make a message (or announcement) to echo on RC when a players RC is logged on." I just tested your script and it didn't work either. Only onPlayerLogout worked not onPlayerLogin. Therefore it's broken or not implemented. |
onPlayerLogout really shouldn't be called either. I didn't realize it was—that's probably introduced a couple bugs in things I've made before. We need onRemotePlayerLogin and onRemotePlayerLogout.
|
| All times are GMT +2. The time now is 12:42 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.