View Single Post
  #1  
Old 02-02-2007, 06:44 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
Basic Guild Control

This is a rather basic and simple way to add and remove players to/from a guild, but thats the purpose. This is a tool for playerworld that does not require anything special to control their guilds.


wNPC:

PHP Code:
function onActionServerSide()
{
  
tokens player.chat.tokenize();
  switch (
params[0]) {
    case 
"add":
      if (
getguildnick(params[3], params[1]) == NULL) {
        
player.chat "Added" SPC params[1SPC "to" SPC params[3] @ "!";
        
with (findPlayer(params[1])) {
          
player.sendPM("You have been added to the guild" SPC params[3] @ "!<br><br>Say \"setnick" SPC params[2SPC "(" params[3] @ ")\" to put your tag on!");
          
player.chat "New PM arrived from the NPC-Server!";
        }
        
addguildmember(params[3], params[1], params[2]);
      } else 
player.chat "Error!" SPC params[1SPC "is already in the guild" SPC params[3] @ "!";
    break;
    
    case 
"remove":
      if (
getguildnick(params[2], params[1]) != NULL) {
        
player.chat "Removed" SPC params[1SPC "from" SPC params[2] @ "!";
        
with (findPlayer(params[1])) {
          
player.sendPM("You have been removed from the guild" SPC params[2] @ "!");
          
player.chat "New PM arrived from the NPC-Server!";
        }
        
removeguildmember(params[2], params[1]);
      } else 
player.chat "Error!" SPC params[1SPC "is not in" SPC params[2] @ "!";
    break;
  }
}

//#CLIENTSIDE
function onPlayerChats()
{
  
tokens player.chat.tokenize();
  switch (
tokens[0]) {
    case 
"/add":
      
triggerServer("gui"name"add"tokens[1], tokens[2], tokens[3]);
    break;
    
    case 
"/remove":
      
triggerServer("gui"name"remove"tokens[1], tokens[2]);
    break;
  }

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote