11.04.2014, 14:21
I created a command where it only can be used on dead bodys but now i cant use it even if player is not dead, if player is dead it will be able to use but if he is alive and i type the command near him, it will say "no bodys close enough" or something, how i do this ?
Done something like this but it not work
Done something like this but it not work
pawn Code:
if(sscanf(params, "u", pID))
{
pID = GetClosestPlayer(playerid);
new Float:x, Float:y, Float:z;
GetPlayerPos(pID, x ,y, z);
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED)
{
if(IsPlayerInRangeOfPoint(playerid, 10.0, x, y, z))
{
if(IsPlayerCop(pID) && GetPVarInt(pID, "Dead") == 1) format(string, sizeof string, "* %s (%d) Poops Officer %s (%d)'s Corpse.", PlayerName(playerid), playerid, PlayerName(pID), pID);
else if(!IsPlayerCop(pID) && GetPVarInt(pID, "Dead") == 1) format(string, sizeof string, "* %s (%d) Poops %s (%d)'s Corpse.", PlayerName(playerid), playerid, PlayerName(pID), pID);