Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes.inc feature flag #886

Open
Y-Less opened this issue Mar 6, 2024 · 0 comments
Open

fixes.inc feature flag #886

Y-Less opened this issue Mar 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Y-Less
Copy link
Collaborator

Y-Less commented Mar 6, 2024

It seems some people do not like that open.mp is directly based on fixes.inc. If you do not want its features, feel free to add a flag to disable them.

Here is a complete list of all the fixes from that include:

Name Problem
GetPlayerColor Returns "0" if "SetPlayerColor" has never been called.
FILTERSCRIPT Despite the fact that is in every new script, many people dont' define "FILTERSCRIPT" where appropriate.
SpawnPlayer Kills the player if they are in a vehicle.
SetPlayerName Using "SetPlayerName" when the new name only differs from the old name in case does not alter the name at all.
GetPlayerSkin Returns the new skin after "SetSpawnInfo" is called but before the player actually respawns to get the new skin.
GetWeaponName Returns nothing for 18, 44, and 45.
SetPlayerWorldBounds Aiming can bypass the edge.
TogglePlayerControllable Other players see you moving on the spot.
HydraSniper Entering military aircraft with a sniper rifle messes up views.
IsPlayerInCheckpoint Function returns an undefined value if it is called before any other checkpoint functions are called to initialise the value.
IsPlayerInRaceCheckpoint Function returns an undefined value if it is called before any other race checkpoint functions are called to initialise the value.
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.
KEY_AIM "KEY_AIM" isn't defined by default.
SetPlayerCheckpoint If a checkpoint is already set it will use the size of that checkpoint instead of the new one.
SetPlayerRaceCheckpoint If a checkpoint is already set it will use the size of that checkpoint instead of the new one.
TextDrawCreate Crashes on a blank string.
TextDrawCreate_2 If the last character in the text is a space (" "), the text will all be blank.
TextDrawSetString Crashes on a blank string and size greater than 1024.
TextDrawSetString_2 If the last character in the text is a space (" "), the text will all be blank.
CreatePlayerTextDraw Crashes on a blank string.
CreatePlayerTextDraw_2 If the last character in the text is a space (" "), the text will all be blank.
PlayerTextDrawSetString Crashes on a blank string and size greater than 1024.
PlayerTextDrawSetString_2 If the last character in the text is a space (" "), the text will all be blank.
AllowInteriorWeapons Does nothing.
OnPlayerEnterVehicle Crashes other players when people enter an invalid seat.
OnPlayerEnterVehicle_2 Crashes the server when hacks enter an invalid vehicle.
OnPlayerEnterVehicle_3 No player animation when trying to enter the driver door of a locked vehicle
AllowTeleport 0.3dRC9 removed "AllowPlayerTeleport" and "AllowAdminTeleport" in favour of "OnPlayerClickMap". Some scripts used the old code and.
SetPlayerSpecialAction Removing jetpacks from players by setting their special action to 0 causes the sound to stay until death.
OnDialogResponse Cheaters can spoof the dialogid they are using to respond to ones they can't actually see.
GetPlayerDialog This function doesn't exist. Fixed for hidden dialogs.
PlayerDialogResponse 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".
SetSpawnInfo Kicks the player if "SpawnPlayer" is called before "SetSpawnInfo".
SetPlayerSkin Breaks sitting on bikes.
HideMenuForPlayer Crashes when passed an invalid menu ID.
valstr Crashes on large numbers.
fclose Crashes on an invalid handle.
fwrite Crashes on an invalid handle.
fread Crashes on an invalid handle.
fputchar Crashes on an invalid handle.
fgetchar Crashes on an invalid handle.
fblockwrite Crashes on an invalid handle.
fblockread Crashes on an invalid handle.
fseek Crashes on an invalid handle.
flength Crashes on an invalid handle.
file_inc Includes or excludes all the file function fixes together (can cause major overhead).
SetPlayerAttachedObject Doesn't remove objects when the mode ends.
OnPlayerDeath Clients get stuck when they die with an animation applied.
strins Ignores the "maxlength" parameter causing possible crashes.
IsPlayerConnected Only uses the lower two bytes of a passed ID.
TrainExit When getting out of a train entered by "PutPlayerInVehicle", the camera does not reset properly.
Kick Calling "Kick" in "OnPlayerConnect" doesn't work properly.
OnVehicleMod Crashes other players when invalid mods are applied.
random Doesn't work with negative numbers.
sleep Leaks bytes from the stack.
AddMenuItem Crashes when passed an invalid menu ID.
SetMenuColumnHeader Crashes when passed an invalid menu ID.
ShowMenuForPlayer Crashes when passed an invalid menu ID.
HideMenuForPlayer Crashes when passed an invalid menu ID.
HideMenuForPlayer_2 Ignores the "menuid" parameter.
DisableMenu Crashes when passed an invalid menu ID.
DisableMenuRow Crashes when passed an invalid menu ID.
Menus All menu function fixes are included separately for major overhead.
GetPlayerMenu Returns previous menu when none is displayed.
GetPlayerInterior Always returns 0 for NPCs.
ClearAnimations Use ClearAnimation while you are in a vehicle cause the player exit from it.
ClearAnimations_2 ClearAnimations doesn't do anything when the animation ends if we pass 1 for the freeze parameter in ApplyAnimation.
DriveBy If you press KEY_CROUCH while you're passenger and if you are armed, the player start to aim; if you repress KEY_CROUCH the player don't return in vehicle.
SilentTeleport If a vehicle teleports either by SetVehiclePos or enters an original samp interior if someone tries to enter it he will teleport silently along.
GangZoneCreate Gang zones bug on the main map for players at certain angles relative to them.
SPECIAL_ACTION_PISSING "SPECIAL_ACTION_PISSING" isn't defined by default.
IsValidVehicle "IsValidVehicle" isn't defined by default.
ApplyAnimation Passing an invalid animation library in ApplyAnimation causes a client crash for streamed in players.
ApplyAnimation_2 First time a library is used, it does nothing.
ApplyActorAnimation Passing an invalid animation library in ApplyAnimation causes a client crash for streamed in players.
ApplyActorAnimation_2 First time a library is used, it does nothing.
OnPlayerSpawn San Andreas deducts $100 from players.
GetGravity "GetGravity" isn't defined by default.
gpci "gpci" isn't defined by default.
Natives Several natives are included by default, this enables or disables them all. Therefore this is an umbrella fix for several fixes.
OnPlayerConnect This function isn't called for players when a filterscript starts.
OnPlayerDisconnect This function isn't called for players when a filterscript ends.
GameText Several styles do not display for the time specified.
GameTextStyles San Andreas has fixed styles for area and vehicle names, but they are not included in the GameText styles list.
HideGameText There is no "HideGameTextForXYZ" function.
ClearPlayerWorldBounds There is no "ClearPlayerWorldBounds" function.
GetPlayerWorldBounds There is no "GetPlayerWorldBounds" function.
WEAPONS Some weapons are not defined by default.
BODYPARTS The bodyparts to be used in OnPlayer(Take/Give)Damage are not defined by default
CAMERAMODES The camera modes for GetPlayerCameraMode are not defined by default.
SetPlayerCamera Using the camera functions directly after enabling spectator mode doesn't work.
SetPlayerTime Using this function under "OnPlayerConnect" doesn't work.
OnPlayerRequestClass Random blunts and bottles sometimes appear in class selection.
SetPlayerColor If used under OnPlayerConnect, the affecting player will not see the color in the TAB menu.
FileMaths You can write gibberish like "File:a; ++a;".
GetPlayerWeaponData Old weapons with no ammo left are still returned.
strcmp Return 0 if anyone of the string is empty.
GetPVarString Wrong symbol code for symbols with code 128 and above.
GetSVarString Wrong symbol code for symbols with code 128 and above.
toupper Not working on Linux for symbols with code 128 and above.
tolower Not working on Linux for symbols with code 128 and above.
PassengerSeating Teleporting player to passenger seat after delay.
GogglesSync Visual effects show for all players.
GetPlayerPoolSize Returns "0" even if there are no players on the server.
SetPlayerPos Using this function on skydiving players kills them.
GetPlayerAmmo Returns erroneous values over 32767 and under -32768 due to overflow.
JIT Can't easily determine if the script is JIT compiled.
OS Can't easily determine what OS the script is running on.
const Some SA-MP natives don't use "const" when they could.
VEHICLES The vehicle models IDs are not defined by default.
GetPlayerWeather This function doesn't exist.
GetWeather This function doesn't exist.
GetWorldTime This function doesn't exist.
GetServerVarAsString Crashes on unknown string variables.
GetServerVarAsInt Crashes on unknown int variables.
GetServerVarAsBool Crashes on unknown boolean variables.
GetServerVarAsFloat Doesn't even exist.
tabsize Some people still use tabsize 0.
OnRconCommand Is not called in the gamemode unless first called in a filterscript.
OnClientCheckResponse Is not called in the gamemode ever.
GetMaxPlayers If this is > MAX_PLAYERS, can cause OOBs in code.
BypassDialog You can type commands and move while in dialogs.
SetTimer Valid timers can return ID 0.
main Gamemodes without this function give a console error.
OnVehicleSpawn Colour -1 isn't synced.
AttachTrailerToVehicle When trailerid is equal to vehicleid and passenger is in vehicleid, it starts spinning.
GetVehicleComponentInSlot The function 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.
API fixes.inc isn't intended to extend the SA:MP API, but has a lot of information internally that can be useful to other scripts. By not exposing this data, we complicate and bloat scripts by requiring them to re-implement said functionality.
floatfract Incorrect on negative numbers.
strfind The function is prone to OOB access when the search start index is negative.
strdel The function is prone to OOB access when the index of the first character to remove is negative.
CallLocalFunction Isn't defined in NPC modes.
deconst Un-const-correct - uses const but shouldn't.
Streamer_RemoveIntData Int data functions expect more parameters than they specify.
Streamer_HasIntData Int data functions expect more parameters than they specify.
default Many functions are missing default values for string lengths.
limit_tags Some limits, like MAX_MENUS are untagged, so can't be used properly.
bool_tags Many true/false parameters use 1/0 with no bool: tag.
TEXT_DRAW_ALIGN The alignment modes for TextDrawAlignment are not defined by default.
TEXT_DRAW_FONT The fonts for TextDrawFont are not defined by default.
GetPlayerKeys GetPlayerKeys and OnPlayerKeyStateChange don't actually deal with "keys", but "actions". The defines don't correspond to real keyboard inputs, but bound game commands. This is one of the biggest sources of confusion, even amongst intermediate coders.
FORCE_SYNC The sync modes for ApplyAnimation are not defined by default.
address_naught When there are internal code errors that result in the wrong address being written to, more often than not that write clobbers whatever value is in address naught (0x00000000).
main2 main isn't called in filterscripts.
npcmodes There's no way to specify NPC modes in server.cfg.
fgetchar2 Has an extra value parameter.
memcpy The index is meant to be an index in to source (in bytes) for where to read the data from; however, it is treated as an index (in bytes) for where to write the data to in dest.
ispacked Returns false when the string is packed and starts with a symbol with code 128 and above.
SHA256 Is not good for using for passwords.

Once the flag disables all of them, and not before, we can merge it. Note that some features aren't actually implemented yet, so you'll need to keep up to date as they come in.

@Y-Less Y-Less added the enhancement New feature or request label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant