OnPlayerUpdate - 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: OnPlayerUpdate (
/showthread.php?tid=509972)
OnPlayerUpdate -
spykidz01 - 29.04.2014
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!
Re: OnPlayerUpdate -
spykidz01 - 29.04.2014
help? bump
Respuesta: OnPlayerUpdate -
Swedky - 29.04.2014
https://sampforum.blast.hk/showthread.php?tid=509888
What does happen to you?
Re: OnPlayerUpdate -
SkittlesAreFalling - 29.04.2014
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.
Re: OnPlayerUpdate -
spykidz01 - 29.04.2014
Код:
return 1;
}
}
}
}
return 1;
ok i make it like this.. ill try to see
Re: OnPlayerUpdate -
SkittlesAreFalling - 29.04.2014
You should also put the SInfo[i][Created] check BEFORE the IsPlayerInRange check for efficiency reasons.
Re: OnPlayerUpdate -
spykidz01 - 29.04.2014
can someone give me the code??
Re: OnPlayerUpdate -
SkittlesAreFalling - 29.04.2014
Код:
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;
}
Re: OnPlayerUpdate -
spykidz01 - 29.04.2014
ill try that...
Re: OnPlayerUpdate -
spykidz01 - 29.04.2014
still not fixed skittlesarefalling.. why?