28.09.2013, 16:35
You messed it up a bit with the brace so the rest of the code was out of the command and never use a semicolon (; ) in if statement.
pawn Код:
CMD:slenderkidnap(playerid,params[])
{
if((GetPlayerScore(playerid) > 150) return SendClientMessage(playerid, COLOR_NAVY, "You need 150 score to be the SlenderMan"); //If the player has less than 150 score, he will get this message
new id;
if (sscanf(params, "u", id)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /slenderkidnap [id]"); //if the ID isn't added, then it will show the usage.
if(!IsPlayerConnected(targetid) || targetid == playerid) return SendClientMessage(playerid, COLOR_ORANGE, "This player is offline, or you're trying to kidnap yourself."); //If the player ID isn't "valid".
new Float:XX,Float:YY,Float:ZZ;
GetPlayerPos(id, XX, YY, ZZ);
if(!IsPlayerInRangeOfPoint(playerid,5,XX, YY, ZZ)) return SendClientMessage(playerid, COLOR_RED, "You're too far from the target!");
else
{
SendClientMessage(id, COLOR_NAVY, "You've got kidnapped!"); //Kidnapped will get this.
SetPlayerInterior(id, 1); //His interior will be set to the meat factory
SetPlayerPos(id, 963.418762,2108.292480,1011.030273); //And the pos.
}
return 1;
}