// I have this piece of code for generating 10 extra hp for everyone in the SAILOR class..
public GenerateHP() {
new Float:phealth;
for(new z = 0; z < MAX_PLAYERS; z++ ) {
if(gTeam[z] == SAILOR) {
GetPlayerHealth(z, phealth);
GameTextForPlayer(z, "~g~HP Generated!", 6000, 5);
if(phealth >= 90 ) {
SetPlayerHealth(z, 100);
}
else if(phealth <= 90 ) {
SetPlayerHealth(z, phealth+10);
}
}
}
}
// I call it with this timer in the OnGameModeInIt() , it compiless errorles, but ingame this wont work :/ ..
SetTimer("GenerateHP", 60000, 1);
// For testing reasons i made this tiny command, when i use this ingame, it suddenly works :/ ..
if(strcmp(cmd, "/hpgenerate", true)==0)
{
GenerateHP();
return 1;
}