PDA

View Full Version : Desync\lag glitch??


xXitsgodzillaXx
28/07/2015, 09:55 PM
My gamemode is having a glitch where players don't seem as though they are moving. The only time it seems like they are moving is when they enter a vehicle, they just magically teleport. I have no idea what is causing this help would be appreciated. This video will help what I'm trying to explain.

https://www.youtube.com/watch?v=aMQxjTUlQj4&feature=youtu.be

Here is my "OnPlayerStateChange" code not really sure if it is relevant to this glitch or not... but yeah.

public OnPlayerStateChange(playerid, newstate, oldstate)
{
if(newstate == PLAYER_STATE_DRIVER)
{
new vehicleid = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicleid) == 476 && (gLoadout[playerid] != CLASS_PILOT || GetPlayerScore(playerid) < 249))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_ERROR, "You need to be a Sergeant to fly a ruslter! Use /rank to see your rank.");
SendClientMessage(playerid, COLOR_ERROR, "You also need to be a pilot to drive this vehicle, use /kill and select the 'pilot' class");
}
if(GetVehicleModel(vehicleid) == 432 && (gLoadout[playerid] != CLASS_PILOT || GetPlayerScore(playerid) < 649))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_ERROR, "You need to be a Major to drive a rhino! Use /rank to see your rank.");
SendClientMessage(playerid, COLOR_ERROR, "You also need to be a pilot to drive this vehicle, use /kill and select the 'pilot' class");
}
if(GetVehicleModel(vehicleid) == 447 && (gLoadout[playerid] != CLASS_PILOT || GetPlayerScore(playerid) < 919))
{
SendClientMessage(playerid, COLOR_ERROR, "You need at least a Colonel rank to fly a Sea Sparrow! Use /rank to see your rank.");
SendClientMessage(playerid, COLOR_ERROR, "You also need to be a pilot to drive this vehicle, use /kill and select the 'pilot' class");
RemovePlayerFromVehicle(playerid);
}
if(GetVehicleModel(vehicleid) == 425 && (gLoadout[playerid] != CLASS_PILOT || GetPlayerScore(playerid) < 1149))
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_ERROR, "You need to be a Lieutenant Colonel to fly a hunter! Use /rank to see your rank.");
SendClientMessage(playerid, COLOR_ERROR, "You also need to be a pilot to drive this vehicle, use /kill and select the 'pilot' class");
}
if(GetVehicleModel(vehicleid) == 520 && (gLoadout[playerid] != CLASS_PILOT || GetPlayerScore(playerid) < 1999))
{ // Hydra
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_ERROR, "You need to be a Major General before you can fly a hydra! Use /rank to see your rank.");
SendClientMessage(playerid, COLOR_ERROR, "You also need to be a pilot to drive this vehicle, use /kill and select the 'pilot' class");
}
}
return 1;
}

Help is seriously appreciated.

Evocator
28/07/2015, 10:12 PM
OnPlayerUpdate?

xXitsgodzillaXx
28/07/2015, 10:15 PM
Callback doesn't exist on my game mode.

Vince
28/07/2015, 10:54 PM
Check your filterscripts because that is most definitely the problem.

xXitsgodzillaXx
28/07/2015, 11:09 PM
I have none running... If I had any others running I would have narrowed it down to that script. Hence why I said "gamemode".

IstuntmanI
28/07/2015, 11:09 PM
I'm not sure, but I think that if you don't use OnPlayerUpdate in your gamemode, it's behaviour is like it actually returns 0, so it isn't sending any player updates. Just add this in your gamemode:
public OnPlayerUpdate( playerid )
return 1;

xXitsgodzillaXx
29/07/2015, 12:44 AM
I actually fixed this. It was an include I was using that causes played to desync when they use the menu that the include file comes with.