// What should I be putting here
{
if (PlayerInfo[playerid][prodshp] == 1)
{
if(GetPlayerHealth(i))
{
new Float:health;
GetPlayerHealth(playerid,health);
if (health < 10.0)
{
(PlayerInfo[playerid][prodshp] == 0)
SendClientMessage(playerid, COLOR_GREEN, "Don't forget to wear safety equipment, to prevent hurting yourself!");
}
}
}
return 1;
}
new timer1;
timer1 = SetTimer("MyCheckingFunction", 5000, true);
forward MyCheckingFunction(playerid); public MyCheckingFunction(playerid) { if (PlayerInfo[playerid][prodshp] == 1) { if(GetPlayerHealth(i)) { new Float:health; GetPlayerHealth(playerid,health); if (health < 10.0) { (PlayerInfo[playerid][prodshp] == 0) SendClientMessage(playerid, COLOR_GREEN, "Don't forget to wear safety equipment, to prevent hurting yourself!"); } } } }
on top
Код:
new timer1; Код:
timer1 = SetTimer("MyCheckingFunction", 5000, true); Код:
forward MyCheckingFunction(playerid); public MyCheckingFunction(playerid) { if (PlayerInfo[playerid][prodshp] == 1) { if(GetPlayerHealth(i)) { new Float:health; GetPlayerHealth(playerid,health); if (health < 10.0) { (PlayerInfo[playerid][prodshp] == 0) SendClientMessage(playerid, COLOR_GREEN, "Don't forget to wear safety equipment, to prevent hurting yourself!"); } } } } |
new gTimer;
//---OnGameModeInit
gTimer = SetTimer("WarnPlayersAboutHealth", 600000, true); /* 600000 miliseconds = 10 minutes */
//---Somewhere
stock WarnPlayersAboutHealth() {
new Float:health;
for (new x; x < MAX_PLAYERS; x++) {
if (PlayerInfo[x][prodshp] != 1) continue;
GetPlayerHealth(x, health);
if (health < 10.0) {
PlayerInfo[x][prodshp] == 0;
SendClientMessage(x, -1, "Don't forget to wear safety equipment, to prevent hurting yourself!");
}
}
return 1;
}