SA-MP Forums Archive
pickup stand up armor and money. - 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: pickup stand up armor and money. (/showthread.php?tid=399416)



pickup stand up armor and money. - Mustafa6155 - 14.12.2012

Hello guys this is my code for the Health an Armor pickup when a player died.
pawn Код:
#include <a_samp>
new Health;
new Armor;

public OnPlayerDeath(playerid, killerid, reason)
{
                new Float:x,Float:y,Float:z;
                GetPlayerPos(playerid,x,y,z);
                Health = CreatePickup(1240,4,x,y,z,0);
                GetPlayerPos(playerid,x,y,z);
                Armor = CreatePickup(1242,4,x,y,z,0);
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == Health) SetPlayerHealth(playerid,100), DestroyPickup(Health);
    if(pickupid == Armor) SetPlayerArmour(playerid,100), DestroyPickup(Armor);
    return 1;
}
But i want around it. like the guns.



Re: pickup stand up armor and money. - DaRk_RaiN - 14.12.2012

pawn Код:
new Float:x,Float:y,Float:z;
                GetPlayerPos(playerid,x,y,z);
                Health = CreatePickup(1240,4,x+2,y,z,0);
                GetPlayerPos(playerid,x,y,z);
                Armor = CreatePickup(1242,4,x-2,y,z,0);