14.02.2012, 14:43
warning 213: tag mismatch
warning 209: function "cmd_ar" should return a value
error 010: invalid function or declaration
What's wrong?
warning 209: function "cmd_ar" should return a value
error 010: invalid function or declaration
pawn Код:
CMD:ar(playerid,params[])
{
new id,n[MAX_PLAYER_NAME], on[MAX_PLAYER_NAME];
if(gTeam[playerid] != TEAM_COP && gTeam[playerid] != TEAM_CIV)
{
SendClientMessage(playerid,red,"Only law enforcement can arrest wanted suspects.");
return 1;
}
if(GetDistanceBetweenPlayers(playerid,ID) > 4)
{
new string2[128];
format(string2,sizeof(string2),"%s(%d) is too far away. You cannot reach him to arrest him.",on,id);
SendClientMessage(playerid,red,string2);
return 1;
}
if(GetPlayerState(ID) == PLAYER_STATE_DRIVER || GetPlayerState(ID) == PLAYER_STATE_PASSENGER)
{
SendClientMessage(playerid,red,"You cannot arrest a suspect they are in a vehicle. Get them to exit the vehicle first.");
return 1;
}
if(GetPlayerWantedLevel(ID) < 3)
{
new string4[128];
format(string4,sizeof(string4),"%s(%d)'s wanted level is too low. You cannot jail them. Use /ticket (Player ID).",n,playerid);
SendClientMessage(playerid,red,string4);
return 1;
}
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid,red,"You can't arrest a suspect if you are in a vehicle.");
if(IsSpawned[playerid] == 0) return SendClientMessage(playerid,0xFF0000FF,"You can't use this command when you are dead or spawning.");
if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, red, "Invalid Player ID.");
if(playerid == id) return SendClientMessage(playerid,red, "You cannot arrest yourself.");
if(sscanf(params,"uz",id)) return SendClientMessage(playerid,red,"Usage:/ar [ID]");
else
{
GetPlayerName(playerid,n,sizeof(n));
GetPlayerName(id,on,sizeof(on));
new string[100];
format(string,sizeof(string),"You've arrested %s(%d).",n,id);
SendClientMessage(playerid,blue,string);
new string2[128];
format(string2, sizeof(string), "%s has been arrested by %s",n,playerid,on,id);
SendClientMessageToAll(red,string2);
}
}
return true;
}