SA-MP Forums Archive
[Ajuda] Vida ao morrer - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Vida ao morrer (/showthread.php?tid=542513)



Vida ao morrer - s4kuL - 19.10.2014

pawn Код:
new HealthPickup[MAX_PLAYERS];


//OnPlayerDeath

HealthPickup[playerid] = CreatePickup(1240, 3, x-3, y, z, 0);
SetTimer("HealthPickupDelete", 5000, true);


//OnPlayerPickUpPickup

if(pickupid == HealthPickup[playerid])
{
    new Float:health;
    GetPlayerHealth(playerid,health);
    SetPlayerHealth(playerid, health+30);
    DestroyPickup(HealthPickup[playerid]);
    return 1;
}

//Callback
forward HealthPickupDelete(playerid);
public HealthPickupDelete(playerid)
{
    DestroyPickup(HealthPickup[playerid]);
    return 1;
}

O servidor ta ficando com vбrias pickups de vida espalhada :/ sу some quando o player passa em cima.
O timer nгo estб deletando as pickup.. o que pode ser?


Re: Vida ao morrer - MultiKill - 19.10.2014

Use o SetTimerEx:
pawn Код:
HealthPickup[playerid] = CreatePickup(1240, 3, x-3, y, z, 0);
SetTimerEx("HealthPickupDelete", 5000, true, "d", playerid);

forward HealthPickupDelete(id);
public HealthPickupDelete(id)
{
    DestroyPickup(HealthPickup[id]);
    return 1;
}



Re: Vida ao morrer - s4kuL - 19.10.2014

Multi agora a vida tб sumindo com 1 segundo ou menos..


Re: Vida ao morrer - MultiKill - 19.10.2014

pawn Код:
HealthPickup[playerid] = CreatePickup(1240, 3, x-3, y, z, 0);
SetTimerEx("HealthPickupDelete", 5000, false, "d", HealthPickup[playerid]);

forward HealthPickupDelete(id);
public HealthPickupDelete(id)
{
    DestroyPickup(id);
    return 1;
}