[HELP] Godmode problem
#1

Код:
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?
Reply
#2

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;
}
Reply
#3

Thx, figured that out ) in the end.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)