View Single Post
  #8  
Old 07-05-2011, 11:15 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
Ah I get it now... You want to set a rank prefix in front of the player's name. I.e:

King, fowlplay4 (Guild)

Here's a function that would do that:

PHP Code:
function setGuildTag(guild_name, rank) {
  
player.guild = guild_name;
  if (!
player.nick.starts((rank @ ", "))) {
    
player.nick = format("%s, %s", rank, player.nick);
  }
} 
Usage:

PHP Code:
function onActionServerSide(cmd) {  
  switch (
cmd) {  
    case 
"tagOn": {  
      
setGuildTag(clientr.towntag, clientr.towntagrank);
      break;  
    }  
  }  
}

function 
setGuildTag(guild_name, rank) {
  
player.guild = guild_name;
  if (!
player.nick.starts((rank @ ", "))) {
    
player.nick = format("%s, %s", rank, player.nick);
  }
}

/* your other code */ 
__________________
Quote:

Last edited by fowlplay4; 07-05-2011 at 11:37 PM..
Reply With Quote