Graal Forums

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

Ohk4y 11-13-2011 07:52 PM

Player Subscription Check
 
I have been trying to figure out how to check if the player is Gold, trial, or classic for a while now and I came across
PHP Code:

player.subscription 

and on Esteria, it won't display my upgrade status if I do the following clientside or serverside
PHP Code:

player.chat = player.subscription 

Is there another way to check for this?
- Thanks

fowlplay4 11-13-2011 07:57 PM

There is no player.subscription, it's player.upgradestatus. Here's some sample usage...

Control-NPC:

PHP Code:

function onActionPlayerOnline() {
  
clientr.upgradestatus = getUpgradeStatus(player);
}

function 
getUpgradeStatus(pl) { 
  
temp.status = pl.upgradestatus; 
  switch (
pl.upgradestatus) { 
    case 
"gold": 
      
temp.status = "Gold"; 
      break; 
    case 
"classic": 
      
temp.status = "Classic"; 
      break; 
    case 
"trial": 
      if (
pl.communityname && !pl.communityname.starts("Graal") && !pl.account.starts("pc:")) { 
        
temp.status = "Community"; 
      } else { 
        
temp.status = "Trial"; 
      } 
      break; 
  } 
  return 
temp.status; 
} 


Ohk4y 11-13-2011 08:00 PM

Thank you! it works
Rep +

MysticalDragon 11-14-2011 05:06 PM

And for the record /scripthelp is your friend! /scripthelp upgrade returned this
TServerPlayer.upgradestatus - string (read only). And to test that I just did in the top of a script (serverside of course)
NPC Code:
temp.md = findplayer("MysticalDragon").upgradestatus;
echo("Echo Test" SPC temp.md);


and that returns in RC "Echo Test gold".


All times are GMT +2. The time now is 02:27 AM.

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