SA-MP Forums Archive
can't take HP pickup on interiors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: can't take HP pickup on interiors (/showthread.php?tid=650363)



can't take HP pickup on interiors - wallen - 26.02.2018

PHP код:
public OnPlayerPickUpPickup(playeridpickupid)
{
    if(
pickupid == Health[playerid])
    {
        new 
Float:h;
        
GetPlayerHealth(playeridh);
        
SetPlayerHealth(playeridh+10.0);
        
DestroyPickup(pickupid);
    }
    return 
1;

??


Re: can't take HP pickup on interiors - PepsiCola23 - 26.02.2018

how do you create the pickups ?


Re: can't take HP pickup on interiors - wallen - 26.02.2018

PHP код:
    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"10000false"i"playerid); 



Re: can't take HP pickup on interiors - NaS - 26.02.2018

You could try Type 1 here.

Type 4 will disappear after 15-20 seconds and respawn on death. Since you destroy it when picking it up, this type shouldn't be neccessary.


Re: can't take HP pickup on interiors - wallen - 26.02.2018

Quote:
Originally Posted by NaS
Посмотреть сообщение
You could try Type 1 here.

Type 4 will disappear after 15-20 seconds and respawn on death. Since you destroy it when picking it up, this type shouldn't be neccessary.
What you mean by type 4


Re: can't take HP pickup on interiors - PepsiCola23 - 26.02.2018

he means to change the type of the pickup in the params

PHP код:
CreatePickup(modeltypeFloat:XFloat:YFloat:Zvirtualworld
like this

PHP код:
CreatePickup(model1Float:XFloat:YFloat:Zvirtualworld



Re: can't take HP pickup on interiors - Ducati - 26.02.2018

Quote:
Originally Posted by wallen
Посмотреть сообщение
What you mean by type 4
Try changing this:
Код:
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", 10000, false, "i", playerid);
To this:
Код:
new Float:x,Float:y,Float:z; 
GetPlayerPos(playerid,x,y,z); 
Health[playerid]=CreatePickup(1240,1,x,y,z+0.2,GetPlayerVirtualWorld(playerid));
SetTimerEx("Health_Timer", 10000, false, "i", playerid);