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 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
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 01:07 AM.


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