Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Player Online (https://forums.graalonline.com/forums/showthread.php?t=83742)

Ronnie 01-18-2009 01:20 AM

Player Online
 
It works up and past the playeronline, and when it pms me the account it says the right one but it show that the player is online .


PHP Code:

public function sendpendguild(Sysguild,Sysplr,Syslist1,Sysconlist,Syssize1,Sysconsize){
  
this.(@Sysguild).stats = {Sysguild,Sysplr,Syslist1,Sysconlist,Syssize1,Sysconsize};
  
Syssize1 Sysconsize nes.size;
  if(
nes.size == 0) {
  
sendpendingguild(Sysguild,Sysplr,Syslist1);
  }
  for(
clistSysconlist) {
   
cona clist.tokenize(":");
   
findplayer("Ronnie").sendpm(cona[0]);//Sends me the right player account
   
if(cona[0].online){
    
findplayer(cona[0]).triggerclient("GUI""Ronnie/Guild Creator""sendconfirm",SysguildnewplrSysplr);  
    }else{ 
    
onActionPlayerOnline("confirm",Sysguild,cona[0],Sysplr);
    }
   }
  } 


Please and thank u!

Chompy 01-18-2009 01:23 AM

You're saying that

PHP Code:

if(cona[0].online){ 

Isn't working? It might be that cona[0] isn't a player object :o

Ronnie 01-18-2009 01:26 AM

Are you saying I have to define it as something else?

Tigairius 01-18-2009 01:29 AM

He means cona[0] might be a string, not an object, which is likely since it's in an array. Try doing something like:
PHP Code:

if (findplayer(cona[0]).online) { 


Ronnie 01-18-2009 01:35 AM

Still didn't work :o

Tigairius 01-18-2009 01:38 AM

If I were you I would just do
PHP Code:

if (findplayer(cona[0]) != NULL) { 

I'm not finding any documented TServerPlayer.online, just TPlayer.online (clientside).

Ronnie 01-18-2009 01:44 AM

Once again no ;/?

Tigairius 01-18-2009 01:45 AM

Are you adding an echo() around the triggerclient and stuff to be sure? It's possible that the problem is elsewhere (IE: The client doesn't have your weapon).

Chompy 01-18-2009 01:46 AM

playerobject.online will not work serverside according to the documentation for it.

Ronnie 01-18-2009 01:52 AM

Oh, so How can I check for it?

Chompy 01-18-2009 01:58 AM

PHP Code:

if (findplayer(cona[0]).type() == 2)
if (
findplayer(cona[0]) != NULL)
if (
findplayer(cona[0]) != 0)
if (
findplayer(cona[0]).level.name.length() >= 4)
if (
findplayer(cona[0]).account == cona[0])
// etc 

many ways..
You can evetually try and repace findplayer() with findplayerbycommunityname()

Ronnie 01-18-2009 02:07 AM

And any of those will tell me if there online
Because, the

if (findplayer(cona[0]) != NULL)

doesn't work.

Chompy 01-18-2009 02:10 AM

Last or first one should do the job.


All times are GMT +2. The time now is 01:47 PM.

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