Thread: Mute Script
View Single Post
  #3  
Old 12-27-2011, 02:28 AM
Gunderak Gunderak is offline
Coder
Gunderak's Avatar
Join Date: Jun 2011
Location: Australia
Posts: 795
Gunderak is on a distinguished road
Not a bad start, But why not do something like this?
PHP Code:
function onActionServerSide(){
  if(
params[0] == "Mute"){
    
temp.muted = GetPlayer(params[1]);
    
//handle other stuff here
  
}
}
function 
GetPlayer(plyr){
  for(
temp.pl : allplayers){
     if(
pl.nick.starts(plyr)){
       
temp.plyr = pl;
     } 
  }
}return 
plyr; 
And just send the players chat of someone's name in the trigger.
Then all you have to do is like /mute Bbo
And if you're name was BboyEatsBacon it would select you.
So for the clientside what I mean is do something like this.
PHP Code:
temp.items = player.chat.tokenize();
temp.plyr = items[1];
triggerserver("weapon", this.name, "Mute", plyr); 
__________________

Gund for president.

Remote PM {P*}x (Graal813044) from eraiphone -> Stefan: I hav 1 qustion
*Gunderak: he hav 1
*Gunderak: qustion

Last edited by Gunderak; 12-27-2011 at 06:02 AM..
Reply With Quote