Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-21-2007, 01:16 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
GS1: Spar Management System

PHP Code:
//Spar Management System
//By: Gambet

if (created)
{
 
setstring this.accounts_allowed,account1,account2//etc... (Define this part yourself)
 
setstring this.guilds_allowed,guild1,guild2//etc... (Define this part yourself)
 
showcharacter;
 
ap 100;
 
setcharprop #n,Spar Management (For Spar Mods);
 
setcharprop #2,no-shield.png;
 
setcharprop #8,body13.png;
 
setcharprop #C0,black;
 
setcharprop #C1,black;
 
setcharprop #C2,black;
 
setcharprop #C3,black;
 
setcharprop #C4,black;
}

if (
playerenters)
{
 if (
lindexof(#a,this.banned) >= 0)
  
{
   
Banned();
  }
 
setcharprop #3,head#v(int(random(0,1000))).png;
}

if (
playertouchsme)
{
 if (
lindexof(#a,this.accounts_allowed) > -1 || lindexof(#g,this.guilds_allowed) > -1)
  
{
  
say2 Spar Management Commands#b:ban account#b:unban account#b:kick account#b:banlist;
  
}
 else
  {
   
setplayerprop #c,You are not allowed to access the spar management commands!;
  
}
}

if (
playerchats)
{
 if (
lindexof(#a,this.accounts_allowed) > -1 || lindexof(#g,this.guilds_allowed) > -1)
  
{
   
tokenize #c;
   
if (strequals(#t(0),:kick))
    
{
     
setstring this.set_player,#t(1);
     
setstring this.online,;
     if (!
strequals(#s,this.set_player),)
      
{
       
with (getplayer(#s(this.set_player)))
        
{
         if (
strequals(#F,#L))
          
{
           
addstring this.online,#a;
           
setstring this.error_msg,kicked;
           
Kick();
          }
         else
          {
           
set this.notinlevel;
          }
        }
      }
     if (
lindexof(#s(this.set_player),this.online) == -1)
      
{
        
Offline();
      }
     if (
this.notinlevel)
      {
       
setplayerprop #c,Target player is not currently in the spar arena!;
       
unset this.notinlevel;
       
Clear();
      }
     else
      {
       
Clear();
      }
    } 
   elseif (
strequals(#t(0),:ban))
    
{
     
setstring this.set_player,#t(1);
     
if (lindexof(#s(this.set_player),this.banned) == -1)
      
{
       
addstring this.banned,#s(this.set_player);
       
setplayerprop #c,You have just banned #s(this.set_player) from the spar arena!;
       
with (getplayer(#s(this.set_player)))
        
{
         
Banned();
        }
      }
     else
      {
       
setplayerprop #c,#s(this.set_player) is already banned!;
      
}
     
Clear();
    }
   elseif (
strequals(#t(0),:unban))
    
{
     
setstring this.set_player,#t(1);
     
if (lindexof(#s(this.set_player),this.banned) > -1)
      
{
       
removestring this.banned,#s(this.set_player);
       
setplayerprop #c,You have just unbanned #s(this.set_player) from the spar arena!;
      
}
     else
      {
       
setplayerprop #c,#s(this.set_player) is not on the banned list!;
      
}
     
Clear();
    }
   elseif (
strequals(#t(0),:banlist))
    
{
     
tokenize #s(this.banned);
     
for(a=0a<tokenscounta++) 
      {
       
setstring this.in_list,#s(this.in_list)#b#v(a+1) - #t(a);
      
}
     
say2 Accounts Banned#s(this.in_list);
     
setstring this.in_list,;
    }
  }
}

function 
Banned()
{
 
setstring this.error_msg,banned;
 
Kick();
 
Clear();
}

function 
Clear()
{
 unset 
this.online;
 unset 
this.set_player;
 unset 
this.error_msg;
}

function 
Kick()
{
 
setlevel2 LEVELNAME_TO_WARP_PLAYER,X_TO_WARP_PLAYER,Y_TO_WARP_PLAYER//Define this part yourself
 
setplayerprop #c,You have been #s(this.error_msg) from the spar arena!;
}

function 
Offline()
{
 
setplayerprop #c,#s(this.set_player) is not online!;
 
unset this.set_player;
 unset 
this.onlinefailed;



NOTE: You can pretty much customize it to be a management for any level, really.



Last edited by Gambet; 03-21-2007 at 01:27 AM..
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:38 PM.


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