SA-MP Forums Archive
[HELP] Godmode problem - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] Godmode problem (/showthread.php?tid=187213)



[HELP] Godmode problem - viKKmaN - 01.11.2010

Код:
public OnPlayerUpdate(playerid)
{
	if(IsGod[playerid])
	{
	    SetPlayerHealth(playerid, 100.0);
		if(IsPlayerInAnyVehicle(playerid))
		{
			SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
		}
	}
}
I have this code, which technically, if the variable IsGod[playerid] = 1 the player is under "godmode" effect.
When i enter my server, with my friend, because of this chunk of code, we are not able to see each other, nor interact...
Can any1 explain this 2 me?


Re: [HELP] Godmode problem - Hiddos - 01.11.2010

You're supposed to return '1' at OnPlayerUpdate in order for players to synchronize with others,
so:

pawn Код:
public OnPlayerUpdate(playerid)
{
    if(IsGod[playerid])
    {
        SetPlayerHealth(playerid, 100.0);
        if(IsPlayerInAnyVehicle(playerid))
        {
            SetVehicleHealth(GetPlayerVehicleID(playerid), 1000.0);
        }
    }
        return 1;
}



Re: [HELP] Godmode problem - viKKmaN - 01.11.2010

Thx, figured that out ) in the end.