Bugs
From SA-MP Wiki
Tip | You can use the Fixes Include to fix most of the problems listed here. |
Contents |
Scripting Bugs
Players
- SpawnPlayer: Kills the player if they are in a vehicle and then they spawn with a bottle in their hand.
- SetPlayerColor: If used under OnPlayerConnect, the affecting player will not see the color in the TAB menu.
- GetPlayerColor: Returns 0 unless SetPlayerColor has been used.
- SetPlayerName: If you set to the same name but some letters are in a different case it doesn't work (example: "heLLO" to "hello").
- RemovePlayerFromVehicle: It shows the 'exit vehicle' animation only for the player being removed.
- SetPlayerSpecialAction:
- Removing jetpacks from players by setting their special action to 0 causes the sound to stay until death. - The animation of special actions SPECIAL_ACTION_CUFFED and SPECIAL_ACTION_CARRY don't work on skin ID 0 (CJ). (but the skin still can't run or jump anyway, so the special action is applied)
- If a checkpoint is already set it will use the size of that checkpoint instead of the new one. - Checkpoints created on server-created objects (CreateObject/CreatePlayerObject) will appear down on the 'real' ground, but will still function correctly.
- SetPlayerWorldBounds: If you hold down the aim key you can walk through world boundaries.
- IsPlayerInCheckpoint, IsPlayerInRaceCheckpoint: Variable isn't initiated until a checkpoint has been set so it returns a undetermined value.
- TogglePlayerSpectating:
- Spectating breaks if the target leaves their stream zone (teleport, enter interior). - Player will be moving really fast into the sky if he is in a vehicle, then he will be spectating normally.
- If a player's skin is set when they are crouching, in a vehicle, or performing certain animations, they will become frozen or otherwise glitched. - Other players around the player may crash if he is in a vehicle or if he is entering/leaving a vehicle. - Setting a player's skin when he is dead may crash players around him. - Breaks sitting on bikes.
- Returns the new skin after SetSpawnInfo is called but before the player actually respawns to get the new skin. - Returns the old skin if the player was spawned through SpawnPlayer function.
- GetPlayerWeapon: Returns the old value after entering in a vehicle.
- PutPlayerInVehicle:
- If this is used on a passenger the driver of their old vehicle doesn't see them in their new vehicle. - If the player has a special action, he will be instantly removed from the vehicle and the special action will be stopped. - If the player has the parachute open and he is put in a vehicle in the same area, he will still have the parachute attached and the sitting animation bugged. If he is put in a vehicle in another area, he will be instantly removed from the vehicle.
- SetPlayerAttachedObject: Doesn't remove objects when the mode ends.
- IsPlayerConnected: Only uses the lower two bytes of a passed ID.
- Kick: Calling "Kick" in OnPlayerConnect doesn't work properly.
- GetPlayerInterior: Always returns 0 for NPCs.
- ApplyAnimation, ApplyActorAnimation:
- Passing an invalid animation library in ApplyAnimation causes a client crash for streamed in players. - First time a library is used, it does nothing.
- Use ClearAnimation while you are in a vehicle cause the player exit from it. - Doesn't do anything when the animation ends if we pass 1 for the freeze parameter in ApplyAnimation.
- SetPlayerCameraPos, SetPlayerCameraLookAt: Using the camera functions directly after enabling spectator mode doesn't work.
- GetPlayerWeaponData: Old weapons with no ammo left are still returned.
- GetPlayerAmmo: Returns erroneous values over 32767 and under -32768 due to overflow.
- GameTextForPlayer, GameTextForAll:
- Several styles do not display for the time specified. - If the last character in the text is a space (" "), the text will all be blank.
- SetPlayerPos, SetPlayerPosFindZ: Used on skydiving players kills them.
- RemoveBuildingForPlayer: Sometimes crashes the client if the object is already removed.
- SetPlayerVelocity: Doesn't work if surfing.
Vehicles
- AddStaticVehicle, AddStaticVehicleEx: spawning a train returns only one ID. Each carriage has its own ID.
- AddStaticVehicle, AddStaticVehicleEx, CreateVehicle: spawning a vehicle with random color (color ID -1) will select a random color, but it won't be synced.
- DestroyVehicle: May crash if used in OnVehicleDeath.
- GetVehicleRotationQuat: May return incorrect values for unoccupied vehicles.
- GetVehicleComponentInSlot:
- Doesn't work for CARMODTYPE_STEREO. - Both front bull bars and front bumper components are saved in the CARMODTYPE_FRONT_BUMPER slot. If a vehicle has both of them installed, this function will only return the one which was installed last. - Both rear bull bars and rear bumper components are saved in the CARMODTYPE_REAR_BUMPER slot. If a vehicle has both of them installed, this function will only return the one which was installed last. - Both left side skirt and right side skirt are saved in the CARMODTYPE_SIDESKIRT slot. If a vehicle has both of them installed, this function will only return the one which was installed last.
- RepairVehicle: It doesn't work on vehicles Dune and Monster Truck - maybe more.
- SetVehicleParamsEx: Objective won't disappear until respawn if used in OnVehicleDeath.
- SetVehicleZAngle: This function does not work on unoccupied vehicles.
Others
- SetTimer, SetTimerEx: Inaccurate call time.
- SetTimerEx: Arrays and strings do not work correctly - they will always pass only one string.
- AllowInteriorWeapons: Doesn't work.
- SetDeathDropAmount: Doesn't work.
- DisableInteriorEnterExits: If the gamemode is changed the doors aren't reenabled.
- CreateMenu: You can't change the width of column 2 it just uses the same as column 1.
- GetPlayerMenu: Returns previous menu when none is displayed.
- TextDrawCreate, TextDrawSetString:
- If the last character in the text is a space (" "), the text will all be blank. - If the textdraw goes on a new line (because of the box), the color will be reset to white.
- TextDrawColor: Requires the text draw to be shown again for changes to be made.
- TextDrawBackgroundColor: Requires the text draw to be shown again for changes to be made.
- GangZoneCreate: Gang zones bug on the main map for players at certain angles relative to them.
- CreatePickup: Pickups that have a X or Y lower than -4096.0 or bigger than 4096.0 won't show up and won't trigger OnPlayerPickUpPickup either.
- GetPlayerPoolSize: Returns "0" even if there are no players on the server.
- GetConsoleVarAsString: Crashes if used to get something else than a string (or invalid console variable).
- SetActorFacingAngle, SetActorInvulnerable: Players will see actor's facing angle changed only when it is restreamed to them.
- GetPlayerNetworkStats: May not return accurate data when used under OnPlayerDisconnect if the player has quit normally. It usually returns accurate data if the player has been kicked or has timed out.
- NetStats_PacketLossPercent: The return value isn't correct most of the time, it is usually too big.
- GetServerVarAsString, GetServerVarAsInt, GetServerVarAsBool: The server crashes on variables that have a different type.
- toupper, tolower: Not working on Linux for symbols with code 128 and above.
- GetPVarString, GetSVarString: Wrong symbol code for symbols with code 128 and above.
- strcmp: Returns 0 if anyone of the string is empty.
- valstr: Crashes on large numbers.
- strins: Ignores the "maxlength" parameter causing possible crashes.
- random: Doesn't work with negative numbers.
- sleep: Leaks bytes from the stack.
- Menu functions: Crashes when passed an invalid menu ID.
- File functions: Crashes on an invalid handle.
Callbacks
- Isn't called if the shooter is in vehicle as driver. - Isn't called if you are looking behind with the aim enabled (shooting in air). - Players around shooter may get crashed if invalid data is sent. - It is called as BULLET_HIT_TYPE_VEHICLE if you are shooting a player which is in a vehicle. It won't be called as BULLET_HIT_TYPE_PLAYER at all.
- OnPlayerEnterVehicle: Crashes the server when hacks enter an invalid vehicle.
- OnPlayerExitVehicle: Isn't called for trains.
- OnDialogResponse: A player's dialog doesn't hide when the gamemode restarts, causing the server to print "Warning: PlayerDialogResponse PlayerId: 0 dialog ID doesn't match last sent dialog ID".
- OnPlayerDeath: Clients get stuck when they die with an animation applied.
- OnVehicleMod: Crashes other players when invalid mods are applied.
- OnVehicleRespray: Isn't called for Pay'n'Spray.
- OnPlayerSpawn: San Andreas deducts $100 from players.
- OnPlayerRequestClass: Random blunts and bottles sometimes appear in class selection.
- OnPlayerEditObject: Coordinates of the last EDIT_RESPONSE_UPDATE call may get out of sync, so coordinates from EDIT_RESPONSE_FINAL may be different.
- OnEnterExitModShop: Players are colliding inside mod shops.
- OnRconCommand: Is not called in the gamemode unless first called in a filterscript.
- OnClientCheckResponse: Is not called in the gamemode ever.
- OnUnoccupiedVehicleUpdate: Is not called for trains.
- OnTrailerUpdate: Is not called for trains.
Missing/Bad Definitions
- WEAPON_NITESTICK should be WEAPON_NIGHTSTICK.
- WEAPON_MOLTOV should be WEAPON_MOLOTOV.
- WEAPON_FIST isn't defined.
- No VEHICLE_NAME definition (like WEAPON_NAME).
- SPECIAL_ACTION_PISSING isn't defined.
- IsValidVehicle isn't defined.
- gpci isn't defined.
- Lots of functions to existing internal data don't exist, such as GetPlayerDialog, GetPlayerWeather, GetVehicleColor, AddServerRule and a lot more. YSF Plugin provides a lot of additional access to the internal SA-MP server memory.
Client Bugs
- When having hydraulics and pressing HORN key to jump up, others hear your car horn, but you don't.
- When your previous passenger enters a car, leaves your car by disconnecting or being set to another position by the server, and you are in the area where they enter the car, the car you are driving (the one where you had the passenger) suddenly stops.
- If you die in a vehicle, you can keep driving it by pressing shift until you respawn. You are the only one seeing it move, for others it is on one place. Once you respawn, it sometimes is where you drove it, sometimes it's where you last died.
- Controls keep changing. For example, when you're frozen, you can use other keys to control the menu (ShowMenuForPlayer) and when unfrozen you have to use other keys. The same is with front view in-car, you have to use different keys.
- When dying in a vehicle, other players see you appear on top of your car, but you see yourself in the car with the "Dead" animation.
- When a train goes by, you will get the shaking screen. Sometimes, when you're very far from the tracks, the shaking still occurs.
- When getting out of a train entered by PutPlayerInVehicle, the camera does not reset properly.
- If you use a Sniper Rifle, then enter a hydra or hunter, and go to the "front view", you get "Sniper Rifle aim".
- If someone has a locked car and you want to enter their passenger seat, all you have to do is press G near their car when they start moving. You will be placed on the passenger seat. Note; only works when the vehicle starts to move and moves faster than you can approach the vehicle.
- Sometimes the sounds of your car/helicopter mess up and you only hear one sound type. For example, the car engine sounds between gear changes are different, but when this occurs there is only one sound and it's the highest gear.This only occurs around lots of players, doesn't matter if they're in a vehicle or not. Usually also when someone from the lot of players enters a vehicle. This always applies to other players you see, their car only has one sound (highest gear).
- With the Stuntplane, if you respawn it or repair it with RepairVehicle, the tailwheel only appears then.
- Moving objects that stop for some time desync for people who have just joined. Once they move again they sync to server set pos.
- Attached objects still appear in front of Sniper Rifle scope.
- When a player has a parachute, they can damage cars that are unoccupied.
- Kicking a player, who is lagging or desynced, off a bike, will freeze your character. You can't move anything except your mouse.
- Pressing G near a moving vehicle teleports the player directly to the passenger seat after some delay. (also called G-bug)
- Stealing a vehicle from the co-driver passenger seat and pressing SPACE while sliding in sometimes kills the driver (also called ninja-jack bug).
- If one player enables goggles (Night Vision/Thermal) special effect everyone will see the effect on screen.
- When you have the health smaller than 5 and you fall from a bike or it is stolen from you your new health will be automatically increased to 5.
- Reconnecting to a server when connection was lost sometimes shows the banned message.
- Other players see you shooting yourself when zooming and shooting with the Sniper Rifle.
- Melee fighting won't damage anyone if you are too far from land.
- Cheaters sending invalid surfing offsets may be invisible to other players or cause the 'Loading...' screen bug.
- Hitting the water too fast with a boat can cause the 'Loading...' screen bug.
- If you jump from a moving object (while surfing on it) on another object you will be taken with the previous object you surfed.
- You can paste text in a dialog input box to get over the characters limit. (game crashes if there are way too many characters)
- Garage doors aren't synced.
- Vehicles that exploded and were never occupied by a driver will explode over and over again when being streamed in, they won't get respawned like they should.
- Using a special action like SPECIAL_ACTION_SMOKE_CIGGY when freefalling with a parachute in the weapon slot will make you have all the regular parachute animations, but the parachute won't be the armed weapon.
- If two objects are colliding, then the colliding parts (e.g.: the surface of two similar objects that have the same Z position) will start flickering from distance. (the game doesn't know which one to show "above" the other)
- When using the TogglePlayerWidescreen function provided by YSF the client displays an annoying log message. The plugin only exports what is possible in SA-MP, so it is a problem with SA-MP and not the plugin. For some reason this (useful) widescreen possibility was added in SA-MP but never made natively accessible to servers.
- "varlist" and "plugins"/"filterscripts" RCON commands only show the first plugin/filterscript loaded.