[Ajuda] Perder vida com o tempo
#6

Certo, mesmo definindo o 'Float' eu tenho que definir a public para fazer perder vida a cada 1 segundo (SetTimer...1000 ms....):

Preciso de algo como isso:
Quote:

forward PerderVida();
public PerderVida()
{
new Float:tmphealth;
for(new i; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(!(PLAYER_STATE_ONFOOT <= GetPlayerState(i) <= PLAYER_STATE_PASSENGER)) continue; //Ignores players that are dead, spectating or in class-selection
for(new e; e < sizeof(InfecAreas); e++)
{
if(IsPlayerInPlace(i, RandomSpawns[e][0], RandomSpawns[e][1], RandomSpawns[e][2], RandomSpawns[e][3]))
{
GetPlayerHealth(i, tmphealth);
tmphealth -= 1.0; //Change it to the amount that you want, the player will lose this amount of health while he is in the area
SetPlayerHealth(i, tmphealth);
break; //Stops the areas loop
}
}
return 1;
}

Reply


Messages In This Thread
Perder vida com o tempo - by F1N4L - 25.11.2015, 23:19
Re: Perder vida com o tempo - by Coringa_Vilao - 26.11.2015, 01:07
Re: Perder vida com o tempo - by cicinho - 26.11.2015, 08:49
Re: Perder vida com o tempo - by PT - 26.11.2015, 09:29
Re: Perder vida com o tempo - by BykiLler - 26.11.2015, 12:51
Re: Perder vida com o tempo - by F1N4L - 26.11.2015, 13:24
Re: Perder vida com o tempo - by F1N4L - 26.11.2015, 22:35
Re: Perder vida com o tempo - by BykiLler - 27.11.2015, 15:09

Forum Jump:


Users browsing this thread: 2 Guest(s)