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[2] SPC "#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[2] SPC "#bNext time you might be jailed!");
}
echo("NPC-Server:" SPC params[1] SPC "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.