Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Code Gallery (https://forums.graalonline.com/forums/forumdisplay.php?f=179)
-   -   GS1: Spar Management System (https://forums.graalonline.com/forums/showthread.php?t=72970)

Gambet 03-21-2007 01:16 AM

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.


:)

godofwarares 03-21-2007 01:50 AM

Why GS1?

Gambet 03-21-2007 02:23 AM

Quote:

Originally Posted by godofwarares (Post 1291163)
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.

xXziroXx 03-21-2007 04:48 AM

*sobs* He made me help him, and.. and.. now I have nightmares! BWAAAA!!!

Chandler 03-21-2007 07:23 AM

You've formatted it like it's GS2. However, I do admire people still using GS1... to an extent!
::Cool::

theHAWKER 03-21-2007 09:09 PM

So, whats it do exactly?

Gambet 03-21-2007 10:11 PM

Quote:

Originally Posted by theHAWKER (Post 1291423)
So, whats it do exactly?

Allows you to ban, unban, view the banned list, and kick people from a spar complex.

theHAWKER 03-22-2007 03:09 AM

oh, kinda cool :D


All times are GMT +2. The time now is 02:42 PM.

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