go and blame Stormeus for too much knowledge about C++ ...
Where do I come into any of this? Ah well, might as well get involved now.
VC:MP Pawn does not support parameters in timers. What you'd have to do is set a timer to go off every second (which will cause srs lag). It would be a better idea to have that timer handle anything that involves timers with parameters.
PlayerInfo[playerid][TimeHeal] would not be set to one. You would use
PlayerInfo[playerid][TimeHeal] = time(); Then you'd change your UMAD function to look something like this:
[pawn]
public MADBRO()
{
new madbros = 0;
for(madbros < MAX_PLAYERS, madbros++)
{
if(IsPlayerConnected(madbros))
{
if(UMAD[madbros][TIMEHEAL] != 0 && (time() - UMAD[madbros][TIMEHEAL]) >= 5)
{
SetPlayerHealth(madbros,100);
SendClientMessage(madbros,0x00000ff,"Healed");
UMAD[madbros][TIMEHEAL] = 0;
}
}
}
return 1;
}
// lol why u mad tho
[/pawn]
Aside from deleting all those umad comments, a conditional line was changed:
if(UMAD[madbros][TIMEHEAL] > 0 && (time() - UMAD[madbros][TIMEHEAL]) >= 5)This checks if they're waiting to be healed. Then it sees if the timestamp of when they used the command, taken from the current timestamp (number of seconds since the Unix Epoch. Google it) is at
least 5 if something lags or bugs out.
Then it heals them.
Also, you'd have to use
SetTimer("MADBRO", 1000, 1); in
OnScriptLoad instead of calling the timer every time the command is used, because Force has a point -- your server will have shitloads of timers going off to run the same timer because you used 0 for the number of iterations. Eventually, it'll get to a point where you're healed instantly.
tl;drThere I fixed it.