13.08.2015, 19:01
this health system edit on onplayerupdate or onplayertakedamage plz help me
public OnPlayerUpdate(playerid){
new Float:health;
GetPlayerHealth(playerid,health);
if (health < 50.0) {SendClientMessage(playerid, -1, #Warning);}
return true;
}
CMD:killme(playerid,params[]) {
new Float:health;
GetPlayerHealth(playerid,health);
if (health > 99.0) { SendClientMessage(playerid, -1, "Your health full can't use this command :)");}
else {
SetPlayerHealth(playerid,0);
}
return 1;
}
forward dialog3(playerid);
public dialog3(playerid)
{
new Float:health;
GetPlayerHealth(playerid,health);
if (health < 80.0) {
SendClientMessage(playerid,red,"[NGP]: you cannot use cmds while you in a fight or lossing health");
}else{
SetTimerEx( "dialog3", 15000, false, "i",playerid);
}
return 1;
}
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
SetPVarInt(playerid,"health22",1);
SetTimerEx( "health21", 10000, false, "i",playerid);
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
SetPVarInt(playerid,"health22",0);
return 1;
}
forward dialog3(playerid);
public dialog3(playerid)
{
if(GetPVarInt(playerid, "health22") == 1) {
SendClientMessage(playerid,-1,"[NGP]: you cannot use cmds while you in a fight or lossing health");
}else{
SetTimerEx( "dialog3", 15000, false, "i",playerid);
}
return 1;
}
forward health21(playerid);
public health21(playerid)
{
SetPVarInt(playerid,"health22",0);
return 1;
}