All pastes #159600 Raw Edit

Something

public text v1 · immutable
·published 2006-09-03 07:38 UTC
rendered paste body
// 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.0 ) {
	            SetPlayerHealth(z, 100.0);
			}
			else if(phealth <= 90.0 ) {
			    SetPlayerHealth(z, phealth+10.0);
			}
		}
	}
}

// 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;
}