cmd not working

Started by Retard, Jan 20, 2018, 03:16 PM

Previous topic - Next topic

Retard

I made this cmd it is working but itt arrests a player even if he has no wanted level
else if (cmd == "arrest") {
if( !text ) MessagePlayer("Error - /"+cmd+" Name/id", player );
else {
local plr = text != "" ? IsNum( text ) ? FindPlayer( text.tointeger() ) : FindPlayer( text ) : player;
if( !plr )MessagePlayer("Error - Unknown player", player );
else if ( plr.WantedLevel = 0 ) return MessagePlayer( RED+" This Player is Not Wanted",player );
else if ( DistanceFromPoint( player.Pos.x, player.Pos.y , plr.Pos.x, plr.Pos.y ) < 5 ) {         //DistanceFromPoint( float x1, float y1, float x2, float y2 )
plr.Pos = Vector( 392.96, -506.26, 9.39 );
}
else MessagePlayer(""+ plr.Name +" is far away.", player );
}
}

Mohamed Boubekri


  else if ( plr.WantedLevel = 0 ) return MessagePlayer( RED+" This Player is Not Wanted",player );To
  else if ( plr.WantedLevel == 0 ) MessagePlayer( RED+" This Player is Not Wanted",player );
| What now ? | Not yet ! |
Morrocan:- [ 🇲🇦 ].

Retard

Quote from: Mohamed on Jan 20, 2018, 03:49 PM  else if ( plr.WantedLevel = 0 ) return MessagePlayer( RED+" This Player is Not Wanted",player );To
  else if ( plr.WantedLevel == 0 ) MessagePlayer( RED+" This Player is Not Wanted",player );
Thanks bro it worked