View Single Post
  #8  
Old 03-31-2006, 07:39 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Uhm, isn't case a lot better then doing if (params[1] == "blah") { } ?

And why not use substring? And is their any reason why .graal was used, and not .nw?


Here, I did some edits, you don't need to use "" anymore as their is no need for tokens.

If theirs a bug with it, just tell me ;O. I tested, it worked fine:

PHP Code:
function onActionServerSide(action) {
  switch (
action) {
    case 
"kick": {
      
plyr findplayer(params[2]);
      if (
plyr.level == "") return;
      if (
plyr.level == "onlinestartlocal.nw") {
        
plyr.setlevel2("jail.graal",33,31);
        
plyr.say2("You have been kicked from#b" SPC params[2SPC "#bNext time you might be jailed!");
      } else {
        
plyr.setlevel2("onlinestartlocal.nw",30.5,12.6);
        
plyr.say2("You have been kicked from#b" SPC params[2SPC "#bNext time you might be jailed!");
      }
      echo(
"NPC-Server:" SPC params[1SPC "has kicked" SPC plyr.level SPC "from" SPC params[2]@".");
      break;
    }
  }
}

//#CLIENTSIDE
function onWeaponfired(){
  if (
player.account == "wild8900"){
    
say2("Commands:#b/kick \"account\"");
  } else {
    
say2("You should not have this item.");
    
destroy();
  }
}
function 
onPlayerChats(){
  if (
player.chat.starts("/kick")) {
    
triggerserver("gui","WEAPONNAME","kick",player.account,player.chat.substring(6,-4)); 
  }

Also, if you use the above (its GS2) make sure you change WEAPONNAME to the name of the weapon.

*Edit* Alright, I added the check..and yeah, I do not know how to use GS2 return :-(. If anyone wants to post the correction way, you may do so, but I think that works fine.

Also, I took player.level off the params, and made it so you can get the level via findplayer (plyr.level). I also didn't test this version.

Last edited by KuJi; 03-31-2006 at 02:06 PM..
Reply With Quote