16.10.2014, 08:15
pawn Код:
public OnPlayerPickUpPickup(playerid, pickupid)
{
if(pickupid == lvapickup1)
{
new Float:armour;
GetPlayerArmour(playerid, armour);
if(armour < 100.0)
{
new Float:var = armour + 50.0;
SetPlayerArmour(playerid, (var > 100.0) ? (100.0) : (var));
GameTextForPlayer(playerid, "~g~Armour +50", 3000, 3);
}
else
{
//?
}
}
else if(pickupid == lvapickup2)
{
new Float:hp;
GetPlayerHealth(playerid, hp);
if(hp < 100.0)
{
new Float:var = hp + 50.0;
SetPlayerHealth(playerid, (var > 100.0) ? (100.0) : (var));
GameTextForPlayer(playerid, "~g~Health +50", 3000, 3);
}
else
{
//?
}
}
return 1;
}
pawn Код:
SetPlayerArmour(playerid, (var > 100.0) ? (100.0) : (var));
pawn Код:
if((armour + 50.0) > 100.0) SetPlayerArmour(playerid, 100.0);
else SetPlayerArmour(playerid, armour + 50.0);