How to make bleeding system timer
#8

@Dirda here you go mate

Код HTML:
// Variable and a Timer that activate the injure system.

new Injured[MAX_PLAYERS], Timer:InjureTime[MAX_PLAYERS];

// You need to add this variables and timers that i added under OnPlayerTakeDamage / OnPlayerDeath / OnPlayerDisconnect
// You need to add this variables and timers that i added under OnPlayerTakeDamage / OnPlayerDeath / OnPlayerDisconnect
// You need to add this variables and timers that i added under OnPlayerTakeDamage / OnPlayerDeath / OnPlayerDisconnect

public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
	if(Injured[playerid] == 1) return 1;
	Injured[playerid] = 1, InjureTime[playerid] = repeat InjuredTime(playerid);
	return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    Injured[playerid] = 0;
	stop InjureTime(playerid);
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    Injured[playerid] = 0;
	stop InjureTime(playerid);
	return 1;
}

// This timer you can add everywhere in your script, mostly go at the bottom.

timer InjuredTime[5000](playerid)
{
    new Float:HP;
	GetPlayerHealth(playerid, HP);
	if(Injured[playerid] == 1) SetPlayerHealth(playerid, HP-1);
	return 1;
}
Ann me if is something wrong.
Reply


Messages In This Thread
How to make bleeding system timer - by Dirda - 05.04.2018, 09:05
Re: How to make bleeding system timer - by m4karow - 05.04.2018, 09:09
Re: How to make bleeding system timer - by Dirda - 05.04.2018, 09:41
Re: How to make bleeding system timer - by jasperschellekens - 05.04.2018, 09:44
Re: How to make bleeding system timer - by Dirda - 05.04.2018, 09:49
Re: How to make bleeding system timer - by Logic_ - 05.04.2018, 09:54
Re: How to make bleeding system timer - by Dirda - 05.04.2018, 10:15
Re: How to make bleeding system timer - by MarianImmortalGod - 05.04.2018, 10:38

Forum Jump:


Users browsing this thread: 2 Guest(s)