04.08.2011, 10:30
How can I set an icons with health and armor on every 1 gang?
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;
}
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;
}
//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; }
SetPlayerHealth(playerid, 100); SetPlayerArmour(playerid, 100);