View Single Post
  #9  
Old 03-01-2010, 05:27 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Here's the update, thrown together to fix it fast for UN. It relies pretty much on the default setnick, so if there's any possible abuse it's out of my hands.

PHP Code:
function onActionServerside(cmd,guildname) {
  if (
cmd == "setTag") {
    
temp.checklocaltag getguildnick(guildname,player.account);
    if (
checklocaltag != nullplayer.triggerclient("gui",this,"SetGuildTag",checklocaltag,guildname);
    else {
      if (
serveroptions.globalguilds == false) {
        
temp.player.nick.substring(0,player.nick.pos("("));
        
player.triggerclient("gui",this,"FailedTag",null,guildname);
      } else 
sendtext("lister""checkinguild", {player.account,guildname});
    }
  }
}

function 
replacetext(txt,a,b) {
  if (
txt.pos(a)<0) return txt;
  
temp.txtpos txt.positions(a);
  
temp.newtxt txt.substring(0,txtpos[0]);
  for (
temp.i=0;i<txtpos.size();i++) {
    
newtxt @= b;
    
newtxt @= txt.substring(txtpos[i]+a.length(),txt.substring(txtpos[i]+a.length()).pos(a));
  }
  return 
newtxt;
}

function 
onReceiveText() {
  if (
params[0] != "lister") return;

  if (
params[1] == "inguild") {
    
temp.acc params[2][0];
    
temp.guildname params[2][1];
    
temp.guildnick params[2][2];
    
temp.guildrank params[2][3];

    if (
guildnick == nullfindplayer(acc).triggerclient("gui",this,"FailedTag",null,guildname);
    else 
findplayer(acc).triggerclient("gui",this,"SetGuildTag",guildnick,guildname);
  }
}

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat.starts("setguild")) {
    
temp.guildtag player.chat.substring(9);
    if (
guildtag.starts("(") && guildtag.ends(")")) guildtag guildtag.substring(1,guildtag.length()-2);
    if (
guildtag == null) {
    
temp.player.nick.substring(0,player.nick.pos("("));
    
shared.chat("setnick" SPC n);
    } else 
triggerServer("gui",name,"setTag",guildtag);
  }
}

function 
onActionClientside(cmd,tag,guild) {
  if (
cmd == "FailedTag") {
    
temp.player.nick.substring(0,player.nick.pos("("));
    
shared.chat("setnick" SPC n SPC "(" guild ")");
  } else if (
cmd == "SetGuildTag"shared.chat("setnick" SPC tag SPC "(" guild ")");
}

function 
onRemotePlayerChats(pl,chat) {
  if (
chat == "Wait 10 seconds before changing your nick again!" ||
      
chat == "That guild does not exist or is inactive" ||
      
chat == "You are not member of the guild or the nickname is wrong" || 
      
chat == "Global guilds are disabled on this server" ||
      
chat.starts("setnick") || chat.starts("setguild")) pl.chat "";


Last edited by DustyPorViva; 03-01-2010 at 07:36 AM..
Reply With Quote