Why other players cant see the health pickup on dead bodie?
#1

Top of script

Код:
new Health;
I did that on OnPlayerDeath

Код:
	// Getting the player's Health pickup
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid,x,y,z);
	Health = CreatePickup(1240,4,x+2,y,z,0);
	SetTimer("Health_Timer", 15000, false);
Код:
forward Health_Timer();
public Health_Timer()
{
    DestroyPickup(Health);
    return 1;
}
Reply
#2

try this OnPlayerDeath

Код:
	// Getting the player's Health pickup
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid,x,y,z);
	Health = CreatePickup(1240,4,x+2,y,z,GetPlayerVirtualWorld(playerid));
	SetTimer("Health_Timer", 15000, false);
Reply
#3

and this code also bugs your system when 2 player dies in a same time.
I'll rewrite your code in seconds.
Reply
#4

Код:
new Health[MAX_PLAYERS];
OnPlayerDeath

Код:
	// Getting the player's Health pickup
	new Float:x,Float:y,Float:z;
	GetPlayerPos(playerid,x,y,z);
	Health[playerid] = CreatePickup(1240,4,x,y,z+0.2,GetPlayerVirtualWorld(playerid));
	SetTimerEx("Health_Timer", 15000, false, "i", playerid);
Код:
forward Health_Timer(playerid);
public Health_Timer(playerid)
{
    DestroyPickup(Health[playerid]);
    return 1;
}
Reply
#5

^^ This guy has a clue (He just needs to learn about the edit button next lol)
Reply
#6

You don't even need an array for this, simply pass the pickupid in timer like this:
PHP код:
SetTimerEx("Health_Timer"15000false"i"CreatePickup(1240,4,x,y,z+0.2,GetPlayerVirtualWorld(playerid))); 
And then delete pickup in timer:
PHP код:
forward Health_Timer(pickupid);
public 
Health_Timer(pickupid)
{
    
DestroyPickup(pickupid);
    return 
1;

Reply
#7

Trust you to come out with knowledge.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)