SA-MP Forums Archive
Taking damage while paused - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Taking damage while paused (/showthread.php?tid=637140)



Taking damage while paused - aoky - 09.07.2017

I'm using weapon config/sky plugin and want to remove this feature, how can I do that?


Re: Taking damage while paused - Freedom. - 09.07.2017

Code:
forward OnPlayerPause(playerid);
public OnPlayerPause(playerid)
{
	SetPVarInt(playerid, "IsPaused", 1);
	return 1;
}

forward OnPlayerUnPause(playerid);
public OnPlayerUnPause(playerid)
{
	SetPVarInt(playerid, "IsPaused", 0);
	return 1;
}

public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart)
{
	if (issuerid != INVALID_PLAYER_ID && weapon != 51)
	{
	    if (GetPVarInt(playerid, "IsPaused") == 1)
		{
			return 0;
		}
	}
	return 1;
}



Re: Taking damage while paused - aoky - 09.07.2017

Doesn't work, bro.


Re: Taking damage while paused - Kane - 09.07.2017

Do the plugins have Streamer_ToggleIdleUpdate(playerid, true); anywhere? Could be it.


Re: Taking damage while paused - aoky - 09.07.2017

Nope.