Quote:
Originally Posted by Shadoww5
Tem certeza ?
Nгo testado:
PHP код:
#include <a_samp>
new Drop[MAX_PLAYERS] = -1;
new Float:Health[MAX_PLAYERS];
public OnPlayerDeath(playerid, killerid, reason)
{
GetPlayerHealth(playerid, Health[playerid]);
if(Health[playerid])
{
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
Drop[playerid] = CreatePickup(1240, 4, x, y, z - 0.8);
}
return 1;
}
public OnPlayerPickUpPickup(playerid, pickupid)
{
for(new i, p = GetMaxPlayers(); i < p; i ++)
{
if(!IsPlayerConnected(i) || pickupid != Drop[i]) continue;
new Float:HP;
GetPlayerHealth(playerid, HP);
SetPlayerHealth(playerid, HP + Health[i]);
Drop[i] = -1;
Health[i] = -1;
DestroyPickup(pickupid);
break;
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
DestroyPickup(Drop[playerid]);
return 1;
}
|
Nгo se salva uma Pickup em uma array MAX_PLAYERS. Atй por que vocк pode morrer 2/3 vezes antes de a Pickup se destruir.