OnPlayerUpdate
#1

what is wrong with my onplayerupdate? why do players join my server is on bug, they aren't moving and show that they are paused?

Код:
public OnPlayerUpdate(playerid)
{
	WantedLevelColor(playerid);
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
	    for(new i = 0; i < sizeof(SInfo); i ++)
	    {
	        if(IsPlayerInRangeOfPoint(playerid, 4.0, SInfo[i][SX], SInfo[i][SY], SInfo[i][SZ]))
	        {
	            if(SInfo[i][SpikeCreated] == 1)
	            {
	                new panels, doors, lights, tires;
	                new carid = GetPlayerVehicleID(playerid);
                 	GetVehicleDamageStatus(carid, panels, doors, lights, tires);
                 	tires = encode_tires(1, 1, 1, 1);
                 	UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
                 	return 0;
				}
			}
		}
	}
	return 1;
he shoot me with a gun, but he is paused!
Reply
#2

help? bump
Reply
#3

https://sampforum.blast.hk/showthread.php?tid=509888

What does happen to you?
Reply
#4

Returning 0 will de-sync a player, the player can see their own updates, but other players will not see the updates so the player will appear frozen but can still move around.
Reply
#5

Код:
                        return 1;
				}
			}
		}
	}
	return 1;
ok i make it like this.. ill try to see
Reply
#6

You should also put the SInfo[i][Created] check BEFORE the IsPlayerInRange check for efficiency reasons.
Reply
#7

can someone give me the code??
Reply
#8

Код:
public OnPlayerUpdate(playerid)
{
	WantedLevelColor(playerid);
	
	if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
	{
		for(new i = 0; i < sizeof(SInfo); i ++)
		{
			if(SInfo[i][SpikeCreated] == 1)
			{
				if(IsPlayerInRangeOfPoint(playerid, 4.0, SInfo[i][SX], SInfo[i][SY], SInfo[i][SZ]))
				{
					new panels, doors, lights, tires;
					new carid = GetPlayerVehicleID(playerid);
					GetVehicleDamageStatus(carid, panels, doors, lights, tires);
					tires = encode_tires(1, 1, 1, 1);
					UpdateVehicleDamageStatus(carid, panels, doors, lights, tires);
					return 1;
				}
			}
		}
	}
	return 1;
}
Reply
#9

ill try that...
Reply
#10

still not fixed skittlesarefalling.. why?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)