SA-MP Forums Archive
VERY WEIRD VEHICLE BUGS! - 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: VERY WEIRD VEHICLE BUGS! (/showthread.php?tid=149062)



VERY WEIRD VEHICLE BUGS! - 0ne - 20.05.2010

Okay so, I've made a server and when i started testing it inoticed this weird bug, if i teleport a guy somewhere and put him in vehicle i see him standing on top of it and doesn't move, he sees me doing the same, Sometimes a guy enters car and i see car standing and him running in fast speed around like airbreaking, anyone knows why? Please help me this bug screws my server up!, If a new player connects he sees people standing on top of vehicles!


Re: VERY WEIRD VEHICLE BUGS! - ¤Adas¤ - 20.05.2010

I have never seen that. Check your OnPlayerUpdate.


Re: VERY WEIRD VEHICLE BUGS! - 0ne - 20.05.2010

pawn Code:
public OnPlayerUpdate(playerid)
{
  if(!IsPlayerConnected(playerid)) return 0;
  new gun = GetPlayerWeapon(playerid);

  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  {
    if(gun == 28 || gun == 29 || gun == 32)
    {
      SetPlayerArmedWeapon(playerid,0);
      return 0;
    }
    }
    if(IsPlayerInArea2(playerid,-1517.853, -1622.146, 183.7855, 77.27145))
    {
    SetPlayerArmedWeapon(playerid,0);
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
      SetPlayerArmedWeapon(playerid,0);
    }
    if(InMarathon[playerid] == 1 || InRace[playerid] == 1)
    {
        SetPlayerArmedWeapon(playerid,0);
    }
    return 1;
}
Here.


Re: VERY WEIRD VEHICLE BUGS! - juice.j - 20.05.2010

OnPlayerUpdate is a function called by connected players, no need for a connection check.

I don't think tho' your OnPlayerUpdate function should create any problems, however for testing, just comment the whole function out and see whether the problem still occurs.


Re: VERY WEIRD VEHICLE BUGS! - ¤Adas¤ - 20.05.2010

pawn Code:
public OnPlayerUpdate(playerid)
{
  new gun = GetPlayerWeapon(playerid);

  if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  {
    if(gun == 28 || gun == 29 || gun == 32)
    {
      SetPlayerArmedWeapon(playerid,0);
      return 1;
    }
    }
    if(IsPlayerInArea2(playerid,-1517.853, -1622.146, 183.7855, 77.27145))
    {
    SetPlayerArmedWeapon(playerid,0);
    }
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
      SetPlayerArmedWeapon(playerid,0);
    }
    if(InMarathon[playerid] == 1 || InRace[playerid] == 1)
    {
        SetPlayerArmedWeapon(playerid,0);
    }
    return 1;
}