SA-MP Forums Archive
Spawn health/armor - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Spawn health/armor (/showthread.php?tid=274023)



Spawn health/armor - deqn_0000 - 04.08.2011

How can I set an icons with health and armor on every 1 gang?


Re: Spawn health/armor - Toreno - 04.08.2011

You need to create a pickup, and when player enters a specific pickup, you give health/armour.
pawn Код:
new cash;
 
public OnGameModeInit()
{
    cash = CreatePickup(1274, 2, 0.0, 0.0, 9.0);
    return 1;
}
 
public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == cash) GivePlayerMoney(playerid,10000);
    return 1;
}



Re: Spawn health/armor - deqn_0000 - 04.08.2011

Can you tell me the script command for health/armor ?


Re: Spawn health/armor - (LifeStealeR) - 04.08.2011

pawn Код:
if(strcmp(cmdtext,"/refill", true) == 0) {
       SendClientMessage(playerid, COLOR_GREEN, "Your health and armour has been succesfully refilled ");
       SetPlayerHealth(playerid, 100);
       SetPlayerArmour(playerid, 100);
       return 1;
}
isn't so hard


Re : Spawn health/armor - Soumi - 04.08.2011

Код:
//At the top of your script
new healthpickup, armorpickup;

public OnGameModeInit()
{
    healthpickup = CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);
    armorpickup =  CreatePickup(model, type, Float:X, Float:Y, Float:Z, Virtualworld);
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    if(pickupid == healthpickup) SetPlayerHealth(playerid, 100);
    if(pickupid == armorpickup) SetPlayerArmour(playerid, 100);
    return 1;
}
For more information about the CreatePickup https://sampwiki.blast.hk/wiki/CreatePickup
for a list of Pickup IDs http://weedarr.wikidot.com/pickups


Re: Spawn health/armor - Tigerbeast11 - 04.08.2011

The Basic CMD for health and armour are:

Код:
SetPlayerHealth(playerid, 100);
       SetPlayerArmour(playerid, 100);



Re: Spawn health/armor - deqn_0000 - 04.08.2011

@Tigerbeast11 I wanna pickup object
@Soumi When i use it I got more 26 errors


Re : Spawn health/armor - Soumi - 04.08.2011

Did u changed this model, type, Float:X, Float:Y, Float:Z, Virtualworld?


Re: Spawn health/armor - deqn_0000 - 04.08.2011

yes really