static gTeam[MAX_PLAYERS];
#define TEAM_COP 2
new Health[MAX_TEAM];
Health[TEAM_COP] = SetTimerEx("Increasing",2000,1,"d",TEAM_COP);//Wherever you want to start increasing the team HP
forward Increasing(teamid);//Forwarding your callback
public Increasing(teamid)
{
new Float:x;//Create a new float variable "x"
foreach(Player,i)//Use foreach
{
if(gTeam[i] == teamid)//If player tim is teamid which in this case is TEAM_COP
{
GetPlayerHealth(playerid,x);//You know..
SetPlayerHealth(playerid,x + 3);//This already..
}
}
return 1;
}
KillTimer(Health[TEAM_COP]);//If you want to stop increasing
Thank You a lot ! i have two questions please,
1-i need only the include foreach to run it? 2-how to Fix the Max HP to 200 ? Thanx |
GetPlayerHealth(playerid,x);
if(x => 200)
{
SetPlayerHealth(playerid,200);
C:\DOCUME~1\mrich\Bureau\alaee\ANEPAS~1\ZOMBIE~1\GAMEMO~1\ZMRP.pwn(10) : error 017: undefined symbol "MAX_TEAM" C:\DOCUME~1\mrich\Bureau\alaee\ANEPAS~1\ZOMBIE~1\GAMEMO~1\ZMRP.pwn(12) : error 010: invalid function or declaration C:\DOCUME~1\mrich\Bureau\alaee\ANEPAS~1\ZOMBIE~1\GAMEMO~1\ZMRP.pwn(473) : error 017: undefined symbol "playerid" C:\DOCUME~1\mrich\Bureau\alaee\ANEPAS~1\ZOMBIE~1\GAMEMO~1\ZMRP.pwn(474) : error 017: undefined symbol "playerid" C:\DOCUME~1\mrich\Bureau\alaee\ANEPAS~1\ZOMBIE~1\GAMEMO~1\ZMRP.pwn(480) : error 021: symbol already defined: "KillTimer" C:\DOCUME~1\mrich\Bureau\alaee\ANEPAS~1\ZOMBIE~1\GAMEMO~1\ZMRP.pwn(797) : warning 203: symbol is never used: "Health" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase Edite : Please tell me where i put each code, for now i have:Under foreachpawn Код:new Health[MAX_TEAM];Health[TEAM_ZOMBIE] = SetTimerEx("Increasing",2000,1,"d",TEAM_ZOMBIE);//Wherever you want to start increasing the team HPforward Increasing(teamid);//Forwarding your callback
Can u Say to me where i put the full script ? Thanx for Hellping ;)
5 Errors.