Quote:
Originally Posted by EnzoMetlc
Guнate de esto:
pawn Код:
// En tus variables globales agrega este array y la variable new VidaPorSegundos[MAX_PLAYERS]; new TimerVida;
// Colуcalo en donde quieras. // Timer para llamar la funciуn. TimerVida = SetTimerEx("HealthTimer", 10000, true, "d", playerid);
// Funciуn forward HealthTimer(playerid); public HealthTimer(playerid) { VidaPorSegundos[playerid] ++; SetPlayerHealth(playerid, GetPlayerHealth(playerid)+10); if(VidaPorSegundos[playerid] == 6) { KillTimer(TimerVida); } }
|
Recuerda que GetPlayerHealth usa dos parametros, las cuales son
-playerid
-float
serнa de esta forma:
pawn Код:
new Float:Vida;
SetPlayerHealth(playerid, GetPlayerHealth(playerid, Vida) + 5);
o
pawn Код:
new Float:Vida;
GetPlayerHealth(playerid, Vida);
SetPlayerHealth(playerid, Vida + 5);
ese cуdigo estarнa dando error de argumentos.