Wasted
#1

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

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);
Reply
#2

This:

pawn Code:
if(GetPlayerState(playerid) == PLAYER_STATE_WASTED)
        {
Should be this:

pawn Code:
if(GetPlayerState(pID) == PLAYER_STATE_WASTED)
        {
You're getting your own state doing that!

Hope this helped.

Have fun!
Reply
#3

Dont work.....
Reply
#4

Bump
Reply
#5

Bump
Reply
#6

Bump
Reply
#7

Actually, just realised.

There is only a second or two where a player is actually dead, that probably won't work.

Remove this line:

pawn Code:
if(GetPlayerState(pID) == PLAYER_STATE_WASTED)
        {
Reply
#8

So how about when i do this near a player who is alive? i can use it on him but i only want to use this when the player is dead, on his body
Reply
#9

pawn Code:
if(IsPlayerCop(pID) && GetPVarInt(pID, "Dead") == 1)
That line checks if the player is dead. You'd need to make a death system, to force the player down for a few seconds, at least.
Reply
#10

What do you mean How i can do that??
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)