freeze and unfreeze

Started by Coolkid, Mar 04, 2016, 03:36 AM

Previous topic - Next topic

Coolkid

Plz tell me whats wrong in this code i will be thank ful thanks
[spoiler]else if (cmd == "freeze"){
if ( params.len() < 2) MessagePlayer(msg.C +" /"+ cmd +" <All/Nick/ID> <text>", player );
else if (params[0].tolower() == "all"){
foreach(i, val in playerson){
FindPlayer(i).IsFrozen = true;
}
Message(msg.I +" Admin "+ player.Name +" has frozen everyone in the server. Reason : " + params[1] );
}
else if ( !GetPlayer(params[0]) ) MessagePlayer( msg.E +" Unknown Player", player );
else {
GetPlayer(params[0]).IsFrozen = true;
Message(msg.I +" Admin "+ player.Name +" has freezed "+GetPlayer(params[0])+" in the server. Reason : " + params[1] );
}
    }

else if (cmd == "unfreeze"){
if ( params.len() < 2) MessagePlayer(msg.C +" /"+ cmd +" <All/Nick/ID> <text>", player );
else if (params[0].tolower() == "all"){
foreach(i, val in playerson){
FindPlayer(i).IsFrozen = false;
}
Message( msg.I +"Admin "+ player.Name +" has unfreezed everyone in the server. Reason : " + params[1] );
}
else if ( !GetPlayer(params[0]) ) MessagePlayer( msg.E +" Unknown Player", player );
else {
GetPlayer(params[0]).IsFrozen = false;
Message( msg.I + "Admin "+ player.Name +" has unfreezed "+GetPlayer(params[0])+" in the server. Reason : " + params[1] );
}
    }
[/spoiler]

DizzasTeR

Tell me what is the error that occurs on those commands.

Anik

I dont think anyone will help you. As this is not the appropriate board for this topic.

KAKAN

else if (cmd == "freeze"){
  if ( params.len() < 2) MessagePlayer(msg.C +" /"+ cmd +" <All/Nick/ID> <text>", player );
local reason;
for( local i = 1; i < params.len() ) reason += params[i] + " ";
if (params[0].tolower() == "all"){
   foreach(i, val in playerson){
    FindPlayer(i).IsFrozen = true;
   }
   Message(msg.I +" Admin "+ player.Name +" has frozen everyone in the server. Reason : " + reason );
  }
  else if ( !GetPlayer(params[0]) ) MessagePlayer( msg.E +" Unknown Player", player );
  else {
    GetPlayer(params[0]).IsFrozen = true;
   Message(msg.I +" Admin "+ player.Name +" has freezed "+GetPlayer(params[0])+" in the server. Reason : " + reason );
  }
    }
 
This must be what you are looking for, every noob does that. Well, if so, then test it and modify the unfreeze cmd.
oh no

Coolkid