Spawn health/armor
#1

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

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;
}
Reply
#3

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

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
Reply
#5

Код:
//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
Reply
#6

The Basic CMD for health and armour are:

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

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

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

yes really
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)