Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Help With The CODES! (https://forums.graalonline.com/forums/showthread.php?t=73351)

Dionysus 04-08-2007 03:44 AM

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");



Novo 04-08-2007 03:54 AM

Quote:

Originally Posted by Dionysus (Post 1297889)
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;
  } 

?

cbk1994 04-08-2007 04:36 AM

I think the answer you're looking for is no. The best way to check would be player.level or player.level.name.

Gambet 04-08-2007 04:53 AM

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.

Twinny 04-08-2007 04:59 AM

Quote:

Originally Posted by Gambet (Post 1297908)
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?

Gambet 04-08-2007 05:29 AM

Quote:

Originally Posted by Twinny (Post 1297909)
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.

Chandler 04-08-2007 07:48 AM

player.isexternal


All times are GMT +2. The time now is 05:59 PM.

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