Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > Code Gallery
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-07-2011, 07:18 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Account Upgrade Status

Due to the introduction of Community names there has been what I consider 4 different account types.

- Gold
- Classic
- Community (People with an actual community name not Graal######)
- Trial

This snippet will let you identify them accordingly, and provide a proper string for use in profiles.

PHP Code:
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")) {
        
temp.status "Community";
      } else {
        
temp.status "Trial";
      }
      break;
  }
  return 
temp.status;

__________________
Quote:

Last edited by fowlplay4; 03-07-2011 at 07:37 AM..
Reply With Quote
  #2  
Old 03-07-2011, 10:14 AM
PowerProNL PowerProNL is offline
Retired Zone Manager
PowerProNL's Avatar
Join Date: Feb 2008
Location: Holland
Posts: 266
PowerProNL can only hope to improve
Send a message via AIM to PowerProNL
Never heard of 'community subscription' and I have my own acc (not Graal#), but useful for new servers
__________________
Graal Mail: [email protected]
McPowerProNL, I'm loving it
Reply With Quote
  #3  
Old 03-26-2012, 03:22 AM
r3ckless r3ckless is offline
Owner of Corinthia
Join Date: Dec 2011
Location: MAssachusetts, USA
Posts: 131
r3ckless is an unknown quantity at this point
Send a message via AIM to r3ckless Send a message via MSN to r3ckless
This is what I have, and it isn't returning my upgrade status...
What am I doing wrong?

PHP Code:
findplayer("Stowen").addweapon(this); 

//#CLIENTSIDE

function onCreated() {
getUpgradeStatus();
sleep("1");
player.chat pl.upgradestatus;
}

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")) {
        
temp.status "Community";
      } else {
        
temp.status "Trial";
      }
      break;
  }
  return 
temp.status;

__________________

Yep.

Reply With Quote
  #4  
Old 03-26-2012, 03:25 AM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by r3ckless View Post
This is what I have, and it isn't returning my upgrade status...
What am I doing wrong?

PHP Code:
findplayer("Stowen").addweapon(this); 

//#CLIENTSIDE

function onCreated() {
getUpgradeStatus();
sleep("1");
player.chat pl.upgradestatus;
}

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")) {
        
temp.status "Community";
      } else {
        
temp.status "Trial";
      }
      break;
  }
  return 
temp.status;

you're referring to an object, pl, that doesn't exist.

+ you're not even using the function he gave you.
__________________
Reply With Quote
  #5  
Old 03-26-2012, 03:31 AM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by r3ckless View Post
This is what I have, and it isn't returning my upgrade status...
What am I doing wrong?
I suggest you start with something much easier if this is above your level, which it clearly seems to be.
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #6  
Old 03-26-2012, 03:50 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
I've updated this function, there was a bug.

PHP Code:
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.account || (!pl.account.starts("Graal") && !pl.account.starts("pc:"))) { 
        
temp.status "Community"
      } else { 
        
temp.status "Trial"
      } 
      break; 
  } 
  return 
temp.status

Control-NPC Usage:

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.account || (!pl.account.starts("Graal") && !pl.account.starts("pc:"))) { 
        
temp.status "Community"
      } else { 
        
temp.status "Trial"
      } 
      break; 
  } 
  return 
temp.status

__________________
Quote:
Reply With Quote
  #7  
Old 04-11-2012, 07:57 PM
Deas_Voice Deas_Voice is offline
Deas
Deas_Voice's Avatar
Join Date: Jun 2007
Location: Sweden
Posts: 2,264
Deas_Voice is a jewel in the roughDeas_Voice is a jewel in the rough
Send a message via AIM to Deas_Voice Send a message via MSN to Deas_Voice Send a message via Yahoo to Deas_Voice
you mind giving some information about this "community" subscription?
i'm sure there's a lot of us who haven't heard about that before.

for a instance, how do you obtain such thing?
__________________
.
WTF is real life, and where do I Download it?
There is no Real Life, just AFK!
since 2003~
I Support~
ღAeonღ | ღTestbedღ | ღDelteriaღ

if you are going to rep me, don't be an idiot, leave your name!
I got nothing but love for you
Reply With Quote
  #8  
Old 04-11-2012, 08:12 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Quote:
Originally Posted by Deas_Voice View Post
you mind giving some information about this "community" subscription?
i'm sure there's a lot of us who haven't heard about that before.

for a instance, how do you obtain such thing?
I invented it. It's basically a Graal###### account that has a community name which means they've upgraded at least once.

I use it on Zodiac to provide benefits above Trial status.
__________________
Quote:
Reply With Quote
  #9  
Old 04-11-2012, 09:31 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Yes that also means you can access the forums.
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 03:47 AM.


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