Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-08-2007, 03:44 AM
Dionysus Dionysus is offline
RTK| God of Wine
Dionysus's Avatar
Join Date: Apr 2007
Location: United States
Posts: 14
Dionysus is on a distinguished road
Send a message via AIM to Dionysus
Help With The CODES!

Is there an easier way to check whos on RC than this below???

PHP Code:
// NPC made by *Dionysus
function onActionServerside(){
  if (
params[0] == "rccheck") {
    
setstring"temp.admins"NULL);
    for(
i=0;i<allplayerscount;i++) {
      
with(allplayers[i]) {
        if (
player.level == "") {
          
addstring"this.admins"player.account);
        }
      }
    }
  }
}
//#CLIENTSIDE
function onCreated(){
  
triggeraction(0,0,"serverside",name,"rccheck");

__________________


Reply With Quote
  #2  
Old 04-08-2007, 03:54 AM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
Quote:
Originally Posted by Dionysus View Post
Is there an easier way to check whos on RC than this below???

PHP Code:
// NPC made by *Dionysus
function onActionServerside(){
  if (
params[0] == "rccheck") {
    
setstring"temp.admins"NULL);
    for(
i=0;i<allplayerscount;i++) {
      
with(allplayers[i]) {
        if (
player.level == "") {
          
addstring"this.admins"player.account);
        }
      }
    }
  }
}
//#CLIENTSIDE
function onCreated(){
  
triggeraction(0,0,"serverside",name,"rccheck");

PHP Code:
//#CLIENTSIDE
function getAdmins()
  {
  
admins = new[0];
  for (
plallplayers )
    {
    if ( 
pl.level == null )
      
admins.addpl.account );
    }

  return 
admins;
  } 
?
Reply With Quote
  #3  
Old 04-08-2007, 04:36 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I think the answer you're looking for is no. The best way to check would be player.level or player.level.name.
__________________
Reply With Quote
  #4  
Old 04-08-2007, 04:53 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
There's a very easy way:


Get on player and say: showadmins







But on a real note, you can do an allplayers loop and only record those accounts that are not in a level. The problem with this is that you'll get IRC bots as well, but just exclude them from the loop via a restricted string array or so to skip them.
Reply With Quote
  #5  
Old 04-08-2007, 04:59 AM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by Gambet View Post
The problem with this is that you'll get IRC bots as well, but just exclude them from the loop via a restricted string array or so to skip them.
Just check that the nickname/account does not start with # to exclude IRC bots though they should be excluded if you check for null levels?
Reply With Quote
  #6  
Old 04-08-2007, 05:29 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by Twinny View Post
Just check that the nickname/account does not start with # to exclude IRC bots though they should be excluded if you check for null levels?


Not sure actually, though if your server uses IRC bots I'm sure you could easily check.
Reply With Quote
  #7  
Old 04-08-2007, 07:48 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
player.isexternal
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:37 PM.


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