Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 03-30-2007, 09:16 PM
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
Simply done:

PHP Code:
var = "godofwarares"// An example. Var should equal your account.
clientr.levelbans.delete(clientr.levelbans.index(var)); 


For that you use remove() -_-
Reply With Quote
  #17  
Old 03-30-2007, 09:34 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Quote:
Originally Posted by Gambet View Post
For that you use remove() -_-
Yes, if you want to remove a specific index its remove, and for a specific string its delete.
Reply With Quote
  #18  
Old 03-30-2007, 09:36 PM
napo_p2p napo_p2p is offline
oh snaps
napo_p2p's Avatar
Join Date: Sep 2003
Location: Pismo Beach, California
Posts: 2,118
napo_p2p has a spectacular aura aboutnapo_p2p has a spectacular aura about
Send a message via AIM to napo_p2p Send a message via MSN to napo_p2p
Quote:
Originally Posted by Rapidwolve View Post
Yes, if you want to remove a specific index its remove, and for a specific string its delete.
Backwards .
__________________
Scito hoc super omnia.
Haec vita est tua una sola.
Dum vita superest, utere maxime quoque puncto, momento, et hora quae habes.
Tempus neminem non manet.
Noli manere tempus.
Carpe Diem

Seize the Day.
Reply With Quote
  #19  
Old 03-30-2007, 09:41 PM
Gambet Gambet is offline
Registered User
Join Date: Oct 2003
Posts: 2,712
Gambet is on a distinguished road
Quote:
Originally Posted by napo_p2p View Post
Backwards .


^




><
Reply With Quote
  #20  
Old 03-30-2007, 10:47 PM
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
God damnit.

delete() = DELETES an INDEX from a ARRAY
remove() = DELETES a TEXT from an ARRAY
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #21  
Old 03-30-2007, 11:23 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Okay, this will work.
Maybe it's not the most efficient, TOO BAD!

This is the tool:
PHP Code:
function onActionServerSidecmdacclevel )
{
switch ( 
cmd )
{
case 
"banPlayer":
{
temp.findPlayeracc );
if ( 
temp.== NULL )
{
player.chat "Player offline!";
break;
}
if ( 
temp.i.clientr.levelbans.index( @ level ) > -)
{
break;
}
temp.i.clientr.levelbans.addlevel );
break;
}
case 
"unBanPlayer":
{
temp.findPlayeracc );
if ( 
temp.== NULL )
{
player.chat "Player offline!";
break;
}
if ( 
temp.i.clientr.levelbans.index( @ level ) == -)
{
break;
}
temp.i.clientr.levelbans.deletetemp.i.clientr.levelbans.index( @ level ) );
break;
}
}
}
//#CLIENTSIDE
function onPlayerChats()
{
tokens player.chat.tokenize();
if ( 
player.chat.starts"/ban" ) ) // Say /ban account levelname
{
triggerserver"gui"name"banPlayer"tokens[1], tokens[2] );
}
if ( 
player.chat.starts"/unban" ) ) // Say /unban account levelname
{
triggerserver"gui"name"unBanPlayer"tokens[1], tokens[2] );
}

and the code in a system script. (replace the setlevel2 with where you want it to warp the player.)
PHP Code:
function onActionServerSidecmd )
{
if ( 
cmd == "unstickPlayer" )
{
player.setlevel2"levelname"x);
}
}
//#CLIENTSIDE
function onCreated()
{
testPlayer();
}
function 
onPlayerEnters()
{
testPlayer();
}
function 
testPlayer()
{
if ( 
clientr.levelbans.index( @ player.level.name ) > -)
{
player.chat "I am banned from this level!";
triggerserver"gui"name"unstickPlayer" );
}

Hope I didnt make any errors, sorry about bad formatting.
(I used delete just because I know it works. Like to see how remove removes a text)
__________________
Reply With Quote
  #22  
Old 03-30-2007, 11:24 PM
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
Quote:
Originally Posted by cbkbud View Post
Okay, this will work.
Maybe it's not the most efficient, TOO BAD!

This is the tool:
PHP Code:
function onActionServerSidecmdacclevel )
{
switch ( 
cmd )
{
case 
"banPlayer":
{
temp.findPlayeracc );
if ( 
temp.== NULL )
{
player.chat "Player offline!";
break;
}
if ( 
temp.i.clientr.levelbans.index( @ level ) > -)
{
break;
}
temp.i.clientr.levelbans.addlevel );
break;
}
case 
"unBanPlayer":
{
temp.findPlayeracc );
if ( 
temp.== NULL )
{
player.chat "Player offline!";
break;
}
if ( 
temp.i.clientr.levelbans.index( @ level ) == -)
{
break;
}
temp.i.clientr.levelbans.deletetemp.i.clientr.levelbans.index( @ level ) );
break;
}
}
}
//#CLIENTSIDE
function onPlayerChats()
{
tokens player.chat.tokenize();
if ( 
player.chat.starts"/ban" ) ) // Say /ban account levelname
{
triggerserver"gui"name"banPlayer"tokens[1], tokens[2] );
}
if ( 
player.chat.starts"/unban" ) ) // Say /unban account levelname
{
triggerserver"gui"name"unBanPlayer"tokens[1], tokens[2] );
}

and the code in a system script. (replace the setlevel2 with where you want it to warp the player.)
PHP Code:
function onActionServerSidecmd )
{
if ( 
cmd == "unstickPlayer" )
{
player.setlevel2"levelname"x);
}
}
//#CLIENTSIDE
function onCreated()
{
testPlayer();
}
function 
onPlayerEnters()
{
testPlayer();
}
function 
testPlayer()
{
if ( 
clientr.levelbans.index( @ player.level.name ) > -)
{
player.chat "I am banned from this level!";
triggerserver"gui"name"unstickPlayer" );
}

Hope I didnt make any errors, sorry about bad formatting.
You DO know that there is a /style command on RC for lazy people?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #23  
Old 03-31-2007, 02:32 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by xXziroXx View Post
You DO know that there is a /style command on RC for lazy people?
Yes, I do but I was unable to get to RC, and the RC's style command is really messed up.
__________________
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 08:35 AM.


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