Question
#1

Hello,

I have a question regarding this code:
Код:
new Spawned[SCRIPT_MAX_PLAYERS];
new Float:ScriptHealth[SCRIPT_MAX_PLAYERS];

Check_Health(playerid)
{
	new Float:fHealth = GetPlayerHealth(playerid);

	if (fHealth > ScriptHealth[playerid])
		return 0;

	return 1;
}

public OnPlayerSpawn(playerid)
{
	ScriptHealth[playerid] = 50;
	SetPlayerHealth(playerid, ScriptHealth[playerid]);

	Spawned[playerid] = 1;

	return 1;
}

public OnPlayerUpdate(playerid)
{
	if (Spawned[playerid] == 1 && !Check_Health())
	{
		Kick(playerid);
	}

	return 1;
}
My question is: If the player has a high ping, could this cause the player to be kicked for having incorrect health as soon as they spawn because their health didn't change in time? Or is the networking for sa-mp set up in such a way it should be okay?

Also, would it make a difference if I put it in a timer instead of OnPlayerUpdate as far as the possibility of false kicking from ping?

Thanks.
Reply


Messages In This Thread
Question - by gtaplayer1 - 24.01.2014, 10:38
Re: Question - by Shetch - 24.01.2014, 10:56
Re: Question - by gtaplayer1 - 24.01.2014, 11:01
Re: Question - by Threshold - 24.01.2014, 11:18
Re: Question - by Shetch - 24.01.2014, 11:27
Re: Question - by gtaplayer1 - 24.01.2014, 11:31
AW: Question - by Nero_3D - 24.01.2014, 12:11

Forum Jump:


Users browsing this thread: 1 Guest(s)