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 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
  #2  
Old 03-21-2007, 01:50 AM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Why GS1?
__________________
What signature? I see no signature?
Reply With Quote
  #3  
Old 03-21-2007, 02:23 AM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by godofwarares View Post
Why GS1?


Originally made it assuming NP didn't have something like it but it turns out that the GPs already have a similar system that works fine the way it is so to spare me from completely wasting my time, I decided to release it to the public in hopes that it can help someone else out, and in the end, end up being useful after all.


NP is currently GS1, which is why I have to script in GS1 when I script on NP.
Reply With Quote
  #4  
Old 03-21-2007, 04:48 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
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
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
*sobs* He made me help him, and.. and.. now I have nightmares! BWAAAA!!!
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #5  
Old 03-21-2007, 07:23 AM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
You've formatted it like it's GS2. However, I do admire people still using GS1... to an extent!
::Cool::
Reply With Quote
  #6  
Old 03-21-2007, 09:09 PM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
So, whats it do exactly?
__________________
**FLIP OUT**
Reply With Quote
  #7  
Old 03-21-2007, 10:11 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by theHAWKER View Post
So, whats it do exactly?
Allows you to ban, unban, view the banned list, and kick people from a spar complex.
Reply With Quote
  #8  
Old 03-22-2007, 03:09 AM
theHAWKER theHAWKER is offline
**FLIP OUT**
theHAWKER's Avatar
Join Date: Mar 2006
Location: canada, vancouver
Posts: 768
theHAWKER is an unknown quantity at this point
oh, kinda cool
__________________
**FLIP OUT**
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 10:57 AM.


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