├── .gitattributes ├── pawn.json ├── .editorconfig ├── .gitignore ├── _fixes_settings.inc ├── test-a_npc.pwn ├── _fixes_options.inc ├── breaks.inc ├── test-a_samp.pwn └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pwn linguist-language=Pawn 2 | *.inc linguist-language=Pawn 3 | -------------------------------------------------------------------------------- /pawn.json: -------------------------------------------------------------------------------- 1 | { 2 | "entry": "test.pwn", 3 | "output": "test.amx", 4 | "dependencies": [ 5 | "sampctl/samp-stdlib" 6 | ] 7 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.{pwn,inc}] 4 | indent_style = tab 5 | indent_size = 4 6 | end_of_line = lf 7 | insert_final_newline = true 8 | trim_trailing_whitespace = false 9 | charset = windows-1252 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # 2 | # Package only files 3 | # 4 | 5 | # Compiled Bytecode, precompiled output and assembly 6 | *.amx 7 | *.lst 8 | *.asm 9 | 10 | # Vendor directory for dependencies 11 | dependencies/ 12 | 13 | # Dependency versions lockfile 14 | pawn.lock 15 | 16 | 17 | # 18 | # Server/gamemode related files 19 | # 20 | 21 | # compiled settings file 22 | # keep `samp.json` file on version control 23 | # but make sure the `rcon_password` field is set externally 24 | # you can use the environment variable `SAMP_RCON_PASSWORD` to do this. 25 | server.cfg 26 | 27 | # Plugins directory 28 | plugins/ 29 | 30 | # binaries 31 | *.exe 32 | *.dll 33 | *.so 34 | announce 35 | samp03svr 36 | samp-npc 37 | 38 | # logs 39 | logs/ 40 | server_log.txt 41 | 42 | # 43 | # Common files 44 | # 45 | 46 | *.sublime-workspace 47 | *.sublime-project 48 | -------------------------------------------------------------------------------- /_fixes_settings.inc: -------------------------------------------------------------------------------- 1 | #if !_FIXES_NEW_COMPILER 2 | // This is the old compiler. We have to use `#endinput` to hide warnings. 3 | // This is why the warnings are in a separate (optional) file - just 4 | // enclosing them in `#if` doesn't work properly (with good reason, the 5 | // compiler needs to know when to end the `#if`, and if it sees a pre- 6 | // processor directive it doesn't know, it can't know if it should now end 7 | // the block or not). So we have to ensure that the compiler never reaches 8 | // that line. 9 | // 10 | // I considered putting these warnings at the very bottom of the main file 11 | // and having it recursively include itself. It would work (probably), but 12 | // would cause havok with pawndoc comments (which are already a mess) and 13 | // `#emit` (which also doesn't like being put in `#if`, as the whole file 14 | // would need to be to make this work). Plus, having a 20,000+ line file 15 | // repeatedly include another 20,000+ line file for just five lines of code 16 | // is truly awful, and I suspect will bring the compiler to a crawl. 17 | // 18 | // Do this check before the `_inc__fixes_settings` check so that we utilise 19 | // the old compiler's in-built compiler guards to avoid including this file 20 | // multiple times when not needed. 21 | #endinput 22 | #endif 23 | 24 | #if !FIXES_ExplicitSettings 25 | // Warning about unused settings is disabled. Do this check before the 26 | // `_inc__fixes_settings` check so that we utilise the old compiler's 27 | // in-built compiler guards to avoid including this file multiple times when 28 | // not needed. 29 | #endinput 30 | #endif 31 | 32 | #if defined _inc__fixes_settings 33 | // Allow this file to be included multiple times. This line is only hit on 34 | // the new compiler in compatibility mode. 35 | #undef _inc__fixes_settings 36 | #endif 37 | 38 | #if defined _FIXES_SETTING 39 | // Hide the warning variable so there aren't two. 40 | #undef _FIXES_SETTING 41 | #define _FIXES_SETTING stock 42 | #endif 43 | 44 | #if !defined _FIXES_WARNING 45 | #error `_fixes_settings.inc` included, but `_FIXES_WARNING` is not defined to select a warning message. 46 | #endif 47 | 48 | // Actually show the warnings. 49 | #pragma warning push 50 | #pragma warning enable 237 51 | 52 | // The caller always undefines `_FIXES_WARNING` after trying to include this 53 | // file, as it needs to be undefined whether the include worked or not. Thus we 54 | // can't also undefine it in here, as the sensible option would seem to be, as 55 | // then it will be undefined twice in some situations. 56 | #if _FIXES_WARNING == 1 57 | #warning Setting `FIXES_ExplicitSettings`, to make all settings explicit, must now be explicit. 58 | #elseif _FIXES_WARNING == 2 59 | #warning Setting `FIXES_EnableAll`, to enable all fixes, must now be explicit. 60 | #elseif _FIXES_WARNING == 3 61 | #warning Setting `FIXES_EnableDeprecated`, to enable fixes for fixed bugs, must now be explicit. 62 | #elseif _FIXES_WARNING == 4 63 | #warning Setting `FIXES_DefaultDisabled`, to disable all fixes by default, must now be explicit. 64 | #elseif _FIXES_WARNING == 5 65 | #warning Setting `FIXES_ExplicitOptions`, to make all fixes explicit, must now be explicit. 66 | #elseif _FIXES_WARNING == 6 67 | #warning Setting `FIXES_SilentKick`, to kick users without any message, must now be explicit. 68 | #elseif _FIXES_WARNING == 7 69 | #warning Setting `FIXES_Debug`, to enable debug mode, must now be explicit. 70 | #elseif _FIXES_WARNING == 8 71 | #warning Setting `FIXES_Single`, to enable single script mode, must now be explicit. 72 | #elseif _FIXES_WARNING == 9 73 | #warning Setting `FIXES_NoSingleMsg`, to disable the single mode warning message, must now be explicit. 74 | #elseif _FIXES_WARNING == 10 75 | #warning Setting `FIXES_NoServerVarMsg`, to disable the config access warning message, must now be explicit. 76 | #elseif _FIXES_WARNING == 11 77 | #warning Setting `FIXES_NoGetMaxPlayersMsg`, to disable the `MAX_PLAYERS` warning message, must now be explicit. 78 | #elseif _FIXES_WARNING == 12 79 | #warning Setting `FIXES_NoPawndoc`, to disable all fixes.inc pawndoc output, must now be explicit. 80 | #elseif _FIXES_WARNING == 13 81 | #warning Setting `FIXES_CorrectInvalidTimerID`, to specify that you know invalid timers are `0`, must now be explicit. 82 | #elseif _FIXES_WARNING == 14 83 | #warning Setting `FIXES_NoYSI`, to optimise the code when YSI isn't used, must now be explicit. 84 | #elseif _FIXES_WARNING == 15 85 | #warning Setting `FIXES_OneRandomVehicleColour`, to allow only one random vehicle colour, must now be explicit. 86 | #elseif _FIXES_WARNING == 16 87 | #warning Setting `FIXES_NoVehicleColourMsg`, to disable the vehicle colours warning, must now be explicit. 88 | #elseif _FIXES_WARNING == 17 89 | #warning Setting `FIXES_CountFilterscripts`, to count loaded filterscripts, must now be explicit. 90 | #elseif _FIXES_WARNING == 18 91 | #warning Setting `FIXES_NoFilterscriptsMsg`, to hide the filterscripts error information, must now be explicit. 92 | #else 93 | #error `_fixes_settings.inc` included, but `_FIXES_WARNING` is not set to a valid warning message. 94 | #endif 95 | 96 | #pragma warning pop 97 | 98 | -------------------------------------------------------------------------------- /test-a_npc.pwn: -------------------------------------------------------------------------------- 1 | #define STRONG_TAGS 2 | #pragma warning disable 234 3 | 4 | #define FIXES_Single 0 5 | 6 | #tryinclude 7 | #tryinclude 8 | 9 | #undef MAX_PLAYERS 10 | #define MAX_PLAYERS (100) 11 | 12 | #include "fixes" 13 | 14 | forward CompileTest(); 15 | 16 | main() 17 | { 18 | print("fixes.inc compile test"); 19 | } 20 | 21 | public CompileTest() 22 | { 23 | new output[32]; 24 | new ivar; 25 | //new Float:fvar; 26 | 27 | // Using defaults. 28 | Print__("STRING"); 29 | PrintF__("STRING"); 30 | Format__(output, _, "STRING"); 31 | SetTimer("STRING", 0, false); 32 | SetTimerEx("STRING", 0, false, ""); 33 | KillTimer(0); 34 | GetTickCount(); 35 | ivar = GetMaxPlayers(); 36 | CallRemoteFunction("STRING", ""); 37 | CallLocalFunction("STRING", ""); 38 | VectorSize(0, 0, 0); 39 | ASin__(0); 40 | ACos__(0); 41 | ATan__(0); 42 | ATan2__(0, 0); 43 | ivar = GetPlayerPoolSize(); 44 | ivar = GetVehiclePoolSize(); 45 | ivar = GetActorPoolSize(); 46 | GetWeaponName(WEAPON_FIST, output, _); 47 | SendRconCommand("STRING"); 48 | GetPlayerNetworkStats(0, output, sizeof (output)); 49 | GetNetworkStats(output, sizeof (output)); 50 | GetServerVarAsString("STRING", output, sizeof (output)); 51 | GetServerVarAsInt("STRING"); 52 | GetServerVarAsBool("STRING"); 53 | GetConsoleVarAsString("STRING", output, sizeof (output)); 54 | GetConsoleVarAsInt("STRING"); 55 | GetConsoleVarAsBool("STRING"); 56 | NetStats_GetIpPort(0, output, sizeof (output)); 57 | /*IsVehicleStreamedIn(0); 58 | GetVehiclePos(0, fvar, fvar, fvar); 59 | GetVehicleZAngle(0, fvar); 60 | GetVehicleRotationQuat(0, fvar, fvar, fvar, fvar); 61 | GetVehicleDistanceFromPoint(0, 0, 0, 0); 62 | GetVehicleParamsEx(0, vparams, vparams, vparams, vparams, vparams, vparams, vparams); 63 | GetVehicleParamsSirenState(0); 64 | GetVehicleParamsCarDoors(0, ivar, ivar, ivar, ivar); 65 | GetVehicleParamsCarWindows(0, ivar, ivar, ivar, ivar); 66 | GetVehicleHealth(0, fvar); 67 | IsTrailerAttachedToVehicle(0); 68 | GetVehicleTrailer(0); 69 | GetVehicleModel(0); 70 | GetVehicleComponentInSlot(0, CARMODTYPE_SPOILER); 71 | GetVehicleComponentType(0); 72 | GetVehicleVelocity(0, fvar, fvar, fvar); 73 | GetVehicleDamageStatus(0, ivar, ivar, ivar, ivar); 74 | GetVehicleModelInfo(0, 0, fvar, fvar, fvar); 75 | GetPlayerPos(0, fvar, fvar, fvar); 76 | GetPlayerFacingAngle(0, fvar); 77 | IsPlayerInRangeOfPoint(0, 0, 0, 0, 0); 78 | GetPlayerDistanceFromPoint(0, 0, 0, 0); 79 | IsPlayerStreamedIn(0); 80 | GetPlayerInterior(0);*/ 81 | GetPlayerHealth(0); 82 | GetPlayerArmour(0); 83 | /*GetPlayerAmmo(0); 84 | GetPlayerWeaponState(0); 85 | GetPlayerTargetPlayer(0); 86 | GetPlayerTargetActor(0); 87 | GetPlayerTeam(0); 88 | GetPlayerScore(0); 89 | GetPlayerDrunkLevel(0); 90 | GetPlayerColor(0); 91 | GetPlayerSkin(0); 92 | GetPlayerCustomSkin__(0); 93 | GetPlayerWeaponData(0, WEAPON_SLOT_UNARMED, ivar, ivar); 94 | GetPlayerMoney(0); 95 | GetPlayerState(0); 96 | GetPlayerIp(0, output, sizeof (output)); 97 | GetPlayerPing(0); 98 | GetPlayerWeapon(0); 99 | GetPlayerKeys(0, ivar, ivar, ivar); 100 | GetPlayerName(0, output, sizeof (output)); 101 | GetPlayerTime(0, ivar, ivar); 102 | GetPlayerWantedLevel(0); 103 | GetPlayerFightingStyle(0); 104 | GetPlayerVelocity(0, fvar, fvar, fvar); 105 | GetPlayerSurfingVehicleID(0); 106 | GetPlayerSurfingObjectID(0); 107 | GetPlayerLastShotVectors(0, fvar, fvar, fvar, fvar, fvar, fvar); 108 | IsPlayerAttachedObjectSlotUsed(0, 0); 109 | GetPlayerVehicleID(0); 110 | GetPlayerVehicleSeat(0); 111 | GetPlayerAnimationIndex(0); 112 | GetAnimationName(0, output, sizeof (output), output, sizeof (output)); 113 | GetPlayerSpecialAction(0); 114 | IsPlayerConnected(0); 115 | IsPlayerInVehicle(0, 0); 116 | IsPlayerInAnyVehicle(0); 117 | IsPlayerInCheckpoint(0); 118 | IsPlayerInRaceCheckpoint(0); 119 | GetObjectPos(0, fvar, fvar, fvar); 120 | GetObjectRot(0, fvar, fvar, fvar); 121 | GetObjectModel(0); 122 | IsValidObject(0); 123 | IsObjectMoving(0); 124 | HTTP(0, 0, "STRING", "STRING", "STRING"); 125 | IsActorStreamedIn(0, 0); 126 | GetActorVirtualWorld(0); 127 | GetActorPos(0, fvar, fvar, fvar); 128 | GetActorFacingAngle(0, fvar); 129 | GetActorHealth(0, fvar); 130 | IsActorInvulnerable(0); 131 | IsValidActor(0);*/ 132 | 133 | 134 | 135 | 136 | // Using explicits. 137 | print("STRING"); 138 | printf("STRING"); 139 | format(output, _, "STRING"); 140 | SetTimer("STRING", 0, false); 141 | SetTimerEx("STRING", 0, false, ""); 142 | KillTimer(0); 143 | GetTickCount(); 144 | ivar = GetMaxPlayers(); 145 | CallRemoteFunction("STRING", ""); 146 | CallLocalFunction("STRING", ""); 147 | VectorSize(0, 0, 0); 148 | asin(0); 149 | acos(0); 150 | atan(0); 151 | atan2(0, 0); 152 | ivar = GetPlayerPoolSize(); 153 | ivar = GetVehiclePoolSize(); 154 | ivar = GetActorPoolSize(); 155 | GetWeaponName(WEAPON_FIST, output, _); 156 | /*GetGravity(); 157 | IsPlayerNPC(0); 158 | IsPlayerAdmin(0); 159 | SendRconCommand("STRING"); 160 | GetPlayerNetworkStats(0, output, _); 161 | GetNetworkStats(output, _); 162 | GetPlayerVersion(0, output, _);*/ 163 | GetServerVarAsString("STRING", output, _); 164 | GetServerVarAsInt("STRING"); 165 | GetServerVarAsBool("STRING"); 166 | GetConsoleVarAsString("STRING", output, _); 167 | GetConsoleVarAsInt("STRING"); 168 | GetConsoleVarAsBool("STRING"); 169 | //GetServerTickRate(); 170 | NetStats_GetIpPort(0, output, _); 171 | IsVehicleStreamedIn(0); 172 | /*GetVehiclePos(0, fvar, fvar, fvar); 173 | GetVehicleZAngle(0, fvar); 174 | GetVehicleRotationQuat(0, fvar, fvar, fvar, fvar); 175 | GetVehicleDistanceFromPoint(0, 0, 0, 0); 176 | GetVehicleParamsEx(0, vparams, vparams, vparams, vparams, vparams, vparams, vparams); 177 | GetVehicleParamsSirenState(0); 178 | GetVehicleParamsCarDoors(0, ivar, ivar, ivar, ivar); 179 | GetVehicleParamsCarWindows(0, ivar, ivar, ivar, ivar); 180 | GetVehicleHealth(0, fvar); 181 | IsTrailerAttachedToVehicle(0); 182 | GetVehicleTrailer(0); 183 | GetVehicleModel(0); 184 | GetVehicleComponentInSlot(0, CARMODTYPE_SPOILER); 185 | GetVehicleComponentType(0); 186 | GetVehicleVelocity(0, fvar, fvar, fvar); 187 | GetVehicleDamageStatus(0, ivar, ivar, ivar, ivar); 188 | GetVehicleModelInfo(0, ivar, fvar, fvar, fvar); 189 | GetVehicleVirtualWorld(0); 190 | IsValidVehicle(0); 191 | GetPlayerPos(0, fvar, fvar, fvar); 192 | GetPlayerFacingAngle(0, fvar); 193 | IsPlayerInRangeOfPoint(0, 0, 0, 0, 0); 194 | GetPlayerDistanceFromPoint(0, 0, 0, 0); 195 | IsPlayerStreamedIn(0); 196 | GetPlayerInterior(0); 197 | GetPlayerHealth(0, fvar); 198 | GetPlayerArmour(0, fvar); 199 | GetPlayerAmmo(0); 200 | GetPlayerWeaponState(0); 201 | GetPlayerTargetPlayer(0); 202 | GetPlayerTargetActor(0); 203 | GetPlayerTeam(0); 204 | GetPlayerScore(0); 205 | GetPlayerDrunkLevel(0); 206 | GetPlayerColor(0); 207 | GetPlayerSkin(0); 208 | GetPlayerCustomSkin(0); 209 | GetPlayerWeaponData(0, WEAPON_SLOT_UNARMED, ivar, ivar); 210 | GetPlayerMoney(0); 211 | GetPlayerState(0); 212 | GetPlayerIp(0, output, _); 213 | GetPlayerPing(0); 214 | GetPlayerWeapon(0); 215 | GetPlayerKeys(0, ivar, ivar, ivar); 216 | GetPlayerName(0, output, _); 217 | GetPlayerTime(0, ivar, ivar); 218 | GetPlayerWantedLevel(0); 219 | GetPlayerFightingStyle(0); 220 | GetPlayerVelocity(0, fvar, fvar, fvar); 221 | GetPlayerSurfingVehicleID(0); 222 | GetPlayerSurfingObjectID(0); 223 | GetPlayerLastShotVectors(0, fvar, fvar, fvar, fvar, fvar, fvar); 224 | GetPVarInt(0, "STRING"); 225 | GetPVarString(0, "STRING", output, _); 226 | GetPVarFloat(0, "STRING"); 227 | GetPVarsUpperIndex(0); 228 | GetPVarNameAtIndex(0, 0, output, _); 229 | GetPVarType(0, "STRING"); 230 | GetPlayerVehicleID(0); 231 | GetPlayerVehicleSeat(0); 232 | GetPlayerAnimationIndex(0); 233 | GetAnimationName(0, output, _, output, _); 234 | GetPlayerSpecialAction(0); 235 | GetPlayerCameraPos(0, fvar, fvar, fvar); 236 | GetPlayerCameraFrontVector(0, fvar, fvar, fvar); 237 | GetPlayerCameraMode(0); 238 | GetPlayerCameraTargetObject(0); 239 | GetPlayerCameraTargetVehicle(0); 240 | GetPlayerCameraTargetPlayer(0); 241 | GetPlayerCameraTargetActor(0); 242 | GetPlayerCameraAspectRatio(0); 243 | GetPlayerCameraZoom(0); 244 | IsPlayerConnected(0); 245 | IsPlayerInVehicle(0, 0); 246 | IsPlayerInAnyVehicle(0); 247 | IsPlayerInCheckpoint(0); 248 | IsPlayerInRaceCheckpoint(0); 249 | GetObjectPos(0, fvar, fvar, fvar); 250 | GetObjectRot(0, fvar, fvar, fvar); 251 | GetObjectModel(0); 252 | IsValidObject(0); 253 | IsObjectMoving(0); 254 | GetPlayerObjectPos(0, 0, fvar, fvar, fvar); 255 | GetPlayerObjectRot(0, 0, fvar, fvar, fvar); 256 | GetPlayerObjectModel(0, 0); 257 | IsValidPlayerObject(0, 0); 258 | MovePlayerObject(0, 0, 0, 0, 0, 0, -1000.0, -1000.0, -1000.0); 259 | IsPlayerObjectMoving(0, 0); 260 | HTTP(0, 0, "STRING", "STRING", "STRING"); 261 | IsActorStreamedIn(0); 262 | GetActorVirtualWorld(0); 263 | GetActorPos(0, fvar, fvar, fvar); 264 | GetActorFacingAngle(0, fvar); 265 | GetActorHealth(0, fvar); 266 | IsActorInvulnerable(0); 267 | IsValidActor(0);*/ 268 | 269 | 270 | // API 271 | GetDefaultPlayerColour(0); 272 | GetVehicleSeats(0); 273 | VehicleCanHaveComponent(0, 0); 274 | ivar = IsValidAnimationLibrary("STRING"); 275 | GetRandomCarColPair(0, ivar, ivar); 276 | CarColIndexToColour(0); 277 | } 278 | 279 | 280 | -------------------------------------------------------------------------------- /_fixes_options.inc: -------------------------------------------------------------------------------- 1 | #if !_FIXES_NEW_COMPILER 2 | // This is the old compiler. We have to use `#endinput` to hide warnings. 3 | // This is why the warnings are in a separate (optional) file - just 4 | // enclosing them in `#if` doesn't work properly (with good reason, the 5 | // compiler needs to know when to end the `#if`, and if it sees a pre- 6 | // processor directive it doesn't know, it can't know if it should now end 7 | // the block or not). So we have to ensure that the compiler never reaches 8 | // that line. 9 | // 10 | // I considered putting these warnings at the very bottom of the main file 11 | // and having it recursively include itself. It would work (probably), but 12 | // would cause havok with pawndoc comments (which are already a mess) and 13 | // `#emit` (which also doesn't like being put in `#if`, as the whole file 14 | // would need to be to make this work). Plus, having a 20,000+ line file 15 | // repeatedly include another 20,000+ line file for just five lines of code 16 | // is truly awful, and I suspect will bring the compiler to a crawl. 17 | // 18 | // Do this check before the `_inc__fixes_settings` check so that we utilise 19 | // the old compiler's in-built compiler guards to avoid including this file 20 | // multiple times when not needed. 21 | #endinput 22 | #endif 23 | 24 | #if !FIXES_ExplicitOptions 25 | // Warning about unused settings is disabled. Do this check before the 26 | // `_inc__fixes_settings` check so that we utilise the old compiler's 27 | // in-built compiler guards to avoid including this file multiple times when 28 | // not needed. 29 | #endinput 30 | #endif 31 | 32 | #if defined _inc__fixes_options 33 | // Allow this file to be included multiple times. This line is only hit on 34 | // the new compiler in compatibility mode. 35 | #undef _inc__fixes_options 36 | #endif 37 | 38 | #if defined _FIXES_OPTION 39 | // Hide the warning variable so there aren't two. 40 | #undef _FIXES_OPTION 41 | #define _FIXES_OPTION stock 42 | #endif 43 | 44 | #if !defined _FIXES_WARNING 45 | #error `_fixes_options.inc` included, but `_FIXES_WARNING` is not defined to select a warning message. 46 | #endif 47 | 48 | // Actually show the warnings. 49 | #pragma warning push 50 | #pragma warning enable 237 51 | 52 | // The caller always undefines `_FIXES_WARNING` after trying to include this 53 | // file, as it needs to be undefined whether the include worked or not. Thus we 54 | // can't also undefine it in here, as the sensible option would seem to be, as 55 | // then it will be undefined twice in some situations. 56 | #if _FIXES_WARNING == 1 57 | #warning Option `FIX_API` must now be explicit. 58 | #elseif _FIXES_WARNING == 2 59 | #warning Option `FIX_Natives` must now be explicit. 60 | #elseif _FIXES_WARNING == 3 61 | #warning Option `FIX_GetPlayerColour` must now be explicit. 62 | #elseif _FIXES_WARNING == 4 63 | #warning Option `FIX_FILTERSCRIPT` must now be explicit. 64 | #elseif _FIXES_WARNING == 5 65 | #warning Option `FIX_SpawnPlayer` must now be explicit. 66 | #elseif _FIXES_WARNING == 6 67 | #warning Option `FIX_SetPlayerName` must now be explicit. 68 | #elseif _FIXES_WARNING == 7 69 | #warning Option `FIX_GetPlayerSkin` must now be explicit. 70 | #elseif _FIXES_WARNING == 8 71 | #warning Option `FIX_GetWeaponName` must now be explicit. 72 | #elseif _FIXES_WARNING == 9 73 | #warning Option `FIX_SetPlayerWorldBounds` must now be explicit. 74 | #elseif _FIXES_WARNING == 10 75 | #warning Option `FIX_TogglePlayerControllable` must now be explicit. 76 | #elseif _FIXES_WARNING == 11 77 | #warning Option `FIX_HydraSniper` must now be explicit. 78 | #elseif _FIXES_WARNING == 12 79 | #warning Option `FIX_IsPlayerInCheckpoint` must now be explicit. 80 | #elseif _FIXES_WARNING == 13 81 | #warning Option `FIX_IsPlayerInRaceCheckpoint` must now be explicit. 82 | #elseif _FIXES_WARNING == 14 83 | #warning Option `FIX_GetPlayerWeapon` must now be explicit. 84 | #elseif _FIXES_WARNING == 15 85 | #warning Option `FIX_PutPlayerInVehicle` must now be explicit. 86 | #elseif _FIXES_WARNING == 16 87 | #warning Option `FIX_KEY_AIM` must now be explicit. 88 | #elseif _FIXES_WARNING == 17 89 | #warning Option `FIX_SPECIAL_ACTION_PISSING` must now be explicit. 90 | #elseif _FIXES_WARNING == 18 91 | #warning Option `FIX_IsValidVehicle` must now be explicit. 92 | #elseif _FIXES_WARNING == 19 93 | #warning Option `FIX_GetGravity` must now be explicit. 94 | #elseif _FIXES_WARNING == 20 95 | #warning Option `FIX_gpci` must now be explicit. 96 | #elseif _FIXES_WARNING == 21 97 | #warning Option `FIX_WEAPONS` must now be explicit. 98 | #elseif _FIXES_WARNING == 22 99 | #warning Option `FIX_BODYPARTS` must now be explicit. 100 | #elseif _FIXES_WARNING == 23 101 | #warning Option `FIX_CAMERAMODES` must now be explicit. 102 | #elseif _FIXES_WARNING == 24 103 | #warning Option `FIX_DriveBy` must now be explicit. 104 | #elseif _FIXES_WARNING == 25 105 | #warning Option `FIX_SilentTeleport` must now be explicit. 106 | #elseif _FIXES_WARNING == 26 107 | #warning Option `FIX_SetPlayerCheckpoint` must now be explicit. 108 | #elseif _FIXES_WARNING == 27 109 | #warning Option `FIX_SetPlayerRaceCheckpoint` must now be explicit. 110 | #elseif _FIXES_WARNING == 28 111 | #warning Option `FIX_TextDrawCreate` must now be explicit. 112 | #elseif _FIXES_WARNING == 29 113 | #warning Option `FIX_AttachTrailerToVehicle` must now be explicit. 114 | #elseif _FIXES_WARNING == 30 115 | #warning Option `FIX_GetVehicleComponentInSlot` must now be explicit. 116 | #elseif _FIXES_WARNING == 31 117 | #warning Option `FIX_TextDrawCreate_2` must now be explicit. 118 | #elseif _FIXES_WARNING == 32 119 | #warning Option `FIX_TextDrawSetString` must now be explicit. 120 | #elseif _FIXES_WARNING == 33 121 | #warning Option `FIX_TextDrawSetString_2` must now be explicit. 122 | #elseif _FIXES_WARNING == 34 123 | #warning Option `FIX_AllowInteriorWeapons` must now be explicit. 124 | #elseif _FIXES_WARNING == 35 125 | #warning Option `FIX_OnPlayerEnterVehicle` must now be explicit. 126 | #elseif _FIXES_WARNING == 36 127 | #warning Option `FIX_OnPlayerEnterVehicle_2` must now be explicit. 128 | #elseif _FIXES_WARNING == 37 129 | #warning Option `FIX_OnPlayerEnterVehicle_3` must now be explicit. 130 | #elseif _FIXES_WARNING == 38 131 | #warning Option `FIX_AllowTeleport` must now be explicit. 132 | #elseif _FIXES_WARNING == 39 133 | #warning Option `FIX_SetPlayerSpecialAction` must now be explicit. 134 | #elseif _FIXES_WARNING == 40 135 | #warning Option `FIX_ClearAnimations` must now be explicit. 136 | #elseif _FIXES_WARNING == 41 137 | #warning Option `FIX_ClearAnimations_2` must now be explicit. 138 | #elseif _FIXES_WARNING == 42 139 | #warning Option `FIX_GangZoneCreate` must now be explicit. 140 | #elseif _FIXES_WARNING == 43 141 | #warning Option `FIX_OnDialogResponse` must now be explicit. 142 | #elseif _FIXES_WARNING == 44 143 | #warning Option `FIX_GetPlayerDialog` must now be explicit. 144 | #elseif _FIXES_WARNING == 45 145 | #warning Option `FIX_PlayerDialogResponse` must now be explicit. 146 | #elseif _FIXES_WARNING == 46 147 | #warning Option `FIX_SetSpawnInfo` must now be explicit. 148 | #elseif _FIXES_WARNING == 47 149 | #warning Option `FIX_SetSpawnInfo_2` must now be explicit. 150 | #elseif _FIXES_WARNING == 48 151 | #warning Option `FIX_SetPlayerSkin` must now be explicit. 152 | #elseif _FIXES_WARNING == 49 153 | #warning Option `FIX_valstr` must now be explicit. 154 | #elseif _FIXES_WARNING == 50 155 | #warning Option `FIX_file_inc` must now be explicit. 156 | #elseif _FIXES_WARNING == 51 157 | #warning Option `FIX_SetPlayerAttachedObject` must now be explicit. 158 | #elseif _FIXES_WARNING == 52 159 | #warning Option `FIX_OnPlayerDeath` must now be explicit. 160 | #elseif _FIXES_WARNING == 53 161 | #warning Option `FIX_strins` must now be explicit. 162 | #elseif _FIXES_WARNING == 54 163 | #warning Option `FIX_IsPlayerConnected` must now be explicit. 164 | #elseif _FIXES_WARNING == 55 165 | #warning Option `FIX_TrainExit` must now be explicit. 166 | #elseif _FIXES_WARNING == 56 167 | #warning Option `FIX_Kick` must now be explicit. 168 | #elseif _FIXES_WARNING == 57 169 | #warning Option `FIX_OnVehicleMod` must now be explicit. 170 | #elseif _FIXES_WARNING == 58 171 | #warning Option `FIX_random` must now be explicit. 172 | #elseif _FIXES_WARNING == 59 173 | #warning Option `FIX_sleep` must now be explicit. 174 | #elseif _FIXES_WARNING == 60 175 | #warning Option `FIX_Menus` must now be explicit. 176 | #elseif _FIXES_WARNING == 61 177 | #warning Option `FIX_AddMenuItem` must now be explicit. 178 | #elseif _FIXES_WARNING == 62 179 | #warning Option `FIX_SetMenuColumnHeader` must now be explicit. 180 | #elseif _FIXES_WARNING == 63 181 | #warning Option `FIX_ShowMenuForPlayer` must now be explicit. 182 | #elseif _FIXES_WARNING == 64 183 | #warning Option `FIX_HideMenuForPlayer` must now be explicit. 184 | #elseif _FIXES_WARNING == 65 185 | #warning Option `FIX_GetPlayerMenu` must now be explicit. 186 | #elseif _FIXES_WARNING == 66 187 | #warning Option `FIX_HideMenuForPlayer_2` must now be explicit. 188 | #elseif _FIXES_WARNING == 67 189 | #warning Option `FIX_DisableMenu` must now be explicit. 190 | #elseif _FIXES_WARNING == 68 191 | #warning Option `FIX_DisableMenuRow` must now be explicit. 192 | #elseif _FIXES_WARNING == 69 193 | #warning Option `FIX_GetPlayerInterior` must now be explicit. 194 | #elseif _FIXES_WARNING == 70 195 | #warning Option `FIX_ApplyAnimation` must now be explicit. 196 | #elseif _FIXES_WARNING == 71 197 | #warning Option `FIX_ApplyAnimation_2` must now be explicit. 198 | #elseif _FIXES_WARNING == 72 199 | #warning Option `FIX_ApplyActorAnimation` must now be explicit. 200 | #elseif _FIXES_WARNING == 73 201 | #warning Option `FIX_ApplyActorAnimation_2` must now be explicit. 202 | #elseif _FIXES_WARNING == 74 203 | #warning Option `FIX_OnPlayerSpawn` must now be explicit. 204 | #elseif _FIXES_WARNING == 75 205 | #warning Option `FIX_GameText` must now be explicit. 206 | #elseif _FIXES_WARNING == 76 207 | #warning Option `FIX_HideGameText` must now be explicit. 208 | #elseif _FIXES_WARNING == 77 209 | #warning Option `FIX_GetPlayerWorldBounds` must now be explicit. 210 | #elseif _FIXES_WARNING == 78 211 | #warning Option `FIX_ClearPlayerWorldBounds` must now be explicit. 212 | #elseif _FIXES_WARNING == 79 213 | #warning Option `FIX_GameTextStyles` must now be explicit. 214 | #elseif _FIXES_WARNING == 80 215 | #warning Option `FIX_OnPlayerConnect` must now be explicit. 216 | #elseif _FIXES_WARNING == 81 217 | #warning Option `FIX_OnPlayerDisconnect` must now be explicit. 218 | #elseif _FIXES_WARNING == 82 219 | #warning Option `FIX_CreatePlayerTextDraw` must now be explicit. 220 | #elseif _FIXES_WARNING == 83 221 | #warning Option `FIX_CreatePlayerTextDraw_2` must now be explicit. 222 | #elseif _FIXES_WARNING == 84 223 | #warning Option `FIX_PlayerTextDrawSetString` must now be explicit. 224 | #elseif _FIXES_WARNING == 85 225 | #warning Option `FIX_PlayerTextDrawSetString_2` must now be explicit. 226 | #elseif _FIXES_WARNING == 86 227 | #warning Option `FIX_SetPlayerCamera` must now be explicit. 228 | #elseif _FIXES_WARNING == 87 229 | #warning Option `FIX_SetPlayerTime` must now be explicit. 230 | #elseif _FIXES_WARNING == 88 231 | #warning Option `FIX_OnPlayerRequestClass` must now be explicit. 232 | #elseif _FIXES_WARNING == 89 233 | #warning Option `FIX_SetPlayerColour` must now be explicit. 234 | #elseif _FIXES_WARNING == 90 235 | #warning Option `FIX_FileMaths` must now be explicit. 236 | #elseif _FIXES_WARNING == 91 237 | #warning Option `FIX_GetPlayerWeaponData` must now be explicit. 238 | #elseif _FIXES_WARNING == 92 239 | #warning Option `FIX_strcmp` must now be explicit. 240 | #elseif _FIXES_WARNING == 93 241 | #warning Option `FIX_GetPVarString` must now be explicit. 242 | #elseif _FIXES_WARNING == 94 243 | #warning Option `FIX_GetSVarString` must now be explicit. 244 | #elseif _FIXES_WARNING == 95 245 | #warning Option `FIX_toupper` must now be explicit. 246 | #elseif _FIXES_WARNING == 96 247 | #warning Option `FIX_tolower` must now be explicit. 248 | #elseif _FIXES_WARNING == 97 249 | #warning Option `FIX_ispacked` must now be explicit. 250 | #elseif _FIXES_WARNING == 98 251 | #warning Option `FIX_PassengerSeating` must now be explicit. 252 | #elseif _FIXES_WARNING == 99 253 | #warning Option `FIX_GogglesSync` must now be explicit. 254 | #elseif _FIXES_WARNING == 100 255 | #warning Option `FIX_GetPlayerPoolSize` must now be explicit. 256 | #elseif _FIXES_WARNING == 101 257 | #warning Option `FIX_SetPlayerPos` must now be explicit. 258 | #elseif _FIXES_WARNING == 102 259 | #warning Option `FIX_GetPlayerAmmo` must now be explicit. 260 | #elseif _FIXES_WARNING == 103 261 | #warning Option `FIX_JIT` must now be explicit. 262 | #elseif _FIXES_WARNING == 104 263 | #warning Option `FIX_OS` must now be explicit. 264 | #elseif _FIXES_WARNING == 105 265 | #warning Option `FIX_const` must now be explicit. 266 | #elseif _FIXES_WARNING == 106 267 | #warning Option `FIX_VEHICLES` must now be explicit. 268 | #elseif _FIXES_WARNING == 107 269 | #warning Option `FIX_GetPlayerWeather` must now be explicit. 270 | #elseif _FIXES_WARNING == 108 271 | #warning Option `FIX_GetWeather` must now be explicit. 272 | #elseif _FIXES_WARNING == 109 273 | #warning Option `FIX_GetWorldTime` must now be explicit. 274 | #elseif _FIXES_WARNING == 110 275 | #warning Option `FIX_GetConsoleVarAsString` must now be explicit. 276 | #elseif _FIXES_WARNING == 111 277 | #warning Option `FIX_GetConsoleVarAsInt` must now be explicit. 278 | #elseif _FIXES_WARNING == 112 279 | #warning Option `FIX_GetConsoleVarAsBool` must now be explicit. 280 | #elseif _FIXES_WARNING == 113 281 | #warning Option `FIX_GetConsoleVarAsFloat` must now be explicit. 282 | #elseif _FIXES_WARNING == 114 283 | #warning Option `FIX_tabsize` must now be explicit. 284 | #elseif _FIXES_WARNING == 115 285 | #warning Option `FIX_Callbacks` must now be explicit. 286 | #elseif _FIXES_WARNING == 116 287 | #warning Option `FIX_OnRconCommand` must now be explicit. 288 | #elseif _FIXES_WARNING == 117 289 | #warning Option `FIX_OnClientCheckResponse` must now be explicit. 290 | #elseif _FIXES_WARNING == 118 291 | #warning Option `FIX_GetMaxPlayers` must now be explicit. 292 | #elseif _FIXES_WARNING == 119 293 | #warning Option `FIX_BypassDialog` must now be explicit. 294 | #elseif _FIXES_WARNING == 120 295 | #warning Option `FIX_SetTimer` must now be explicit. 296 | #elseif _FIXES_WARNING == 121 297 | #warning Option `FIX_main` must now be explicit. 298 | #elseif _FIXES_WARNING == 122 299 | #warning Option `FIX_Pawndoc` must now be explicit. 300 | #elseif _FIXES_WARNING == 123 301 | #warning Option `FIX_OnVehicleSpawn` must now be explicit. 302 | #elseif _FIXES_WARNING == 124 303 | #warning Option `FIX_floatfract` must now be explicit. 304 | #elseif _FIXES_WARNING == 125 305 | #warning Option `FIX_strfind` must now be explicit. 306 | #elseif _FIXES_WARNING == 126 307 | #warning Option `FIX_strdel` must now be explicit. 308 | #elseif _FIXES_WARNING == 127 309 | #warning Option `FIX_LocalNPCNatives` must now be explicit. 310 | #elseif _FIXES_WARNING == 128 311 | #warning Option `FIX_RemoteNPCNatives` must now be explicit. 312 | #elseif _FIXES_WARNING == 129 313 | #warning Option `FIX_deconst` must now be explicit. 314 | #elseif _FIXES_WARNING == 130 315 | #warning Option `FIX_Streamer_HasIntData` must now be explicit. 316 | #elseif _FIXES_WARNING == 131 317 | #warning Option `FIX_Streamer_RemoveIntData` must now be explicit. 318 | #elseif _FIXES_WARNING == 132 319 | #warning Option `FIX_defaults` must now be explicit. 320 | #elseif _FIXES_WARNING == 133 321 | #warning Option `FIX_limit_tags` must now be explicit. 322 | #elseif _FIXES_WARNING == 134 323 | #warning Option `FIX_bool_tags` must now be explicit. 324 | #elseif _FIXES_WARNING == 135 325 | #warning Option `FIX_TEXT_DRAW_ALIGN` must now be explicit. 326 | #elseif _FIXES_WARNING == 136 327 | #warning Option `FIX_TEXT_DRAW_FONT` must now be explicit. 328 | #elseif _FIXES_WARNING == 137 329 | #warning Option `FIX_GetPlayerKeys` must now be explicit. 330 | #elseif _FIXES_WARNING == 138 331 | #warning Option `FIX_FORCE_SYNC` must now be explicit. 332 | #elseif _FIXES_WARNING == 139 333 | #warning Option `FIX_address_naught` must now be explicit. 334 | #elseif _FIXES_WARNING == 140 335 | #warning Option `FIX_main2` must now be explicit. 336 | #elseif _FIXES_WARNING == 141 337 | #warning Option `FIX_npcmodes` must now be explicit. 338 | #elseif _FIXES_WARNING == 142 339 | #warning Option `FIX_fgetchar2` must now be explicit. 340 | #elseif _FIXES_WARNING == 143 341 | #warning Option `FIX_memcpy` must now be explicit. 342 | #elseif _FIXES_WARNING == 144 343 | #warning Option `FIX_SHA256` must now be explicit. 344 | #else 345 | #error `_fixes_options.inc` included, but `_FIXES_WARNING` is not set to a valid warning message. 346 | #endif 347 | 348 | #pragma warning pop 349 | 350 | -------------------------------------------------------------------------------- /breaks.inc: -------------------------------------------------------------------------------- 1 | #define IS_FILTERSCRIPT // Remove it. 2 | 3 | static stock 4 | bool:BREAKS_gFilterscript = false, 5 | BREAKS_gRCPSize[MAX_PLAYERS] = { 0, ... }, 6 | BREAKS_gCPSize[MAX_PLAYERS] = { 0, ... }, 7 | bool:BREAKS_gRCPInitialised[MAX_PLAYERS] = { false, ... }, 8 | bool:BREAKS_gCPInitialised[MAX_PLAYERS] = { false, ... }, 9 | BREAKS_gPlayerColour[MAX_PLAYERS] = { 0, ... }, 10 | BREAKS_gPlayerSkin[MAX_PLAYERS] = { 0, ... }, 11 | bool:BREAKS_gExtraOPC[MAX_PLAYERS] = { false, ... }, 12 | BREAKS_gLibraryInitialised[MAX_PLAYERS][5]; 13 | 14 | static stock const 15 | BREAKS_gscAnimLib[135][] = 16 | { 17 | "AIRPORT", "ATTRACTORS", "BAR", "BASEBALL", "BD_FIRE", 18 | "BEACH", "BENCHPRESS", "BF_INJECTION", "BIKE_DBZ", "BIKED", 19 | "BIKEH", "BIKELEAP", "BIKES", "BIKEV", "BLOWJOBZ", 20 | "BMX", "BOMBER", "BOX", "BSKTBALL", "BUDDY", 21 | "BUS", "CAMERA", "CAR", "CAR_CHAT", "CARRY", 22 | "CASINO", "CHAINSAW", "CHOPPA", "CLOTHES", "COACH", 23 | "COLT45", "COP_AMBIENT", "COP_DVBYZ", "CRACK", "CRIB", 24 | "DAM_JUMP", "DANCING", "DEALER", "DILDO", "DODGE", 25 | "DOZER", "DRIVEBYS", "FAT", "FIGHT_B", "FIGHT_C", 26 | "FIGHT_D", "FIGHT_E", "FINALE", "FINALE2", "FLAME", 27 | "FLOWERS", "FOOD", "FREEWEIGHTS", "GANGS", "GFUNK", 28 | "GHANDS", "GHETTO_DB", "GOGGLES", "GRAFFITI", "GRAVEYARD", 29 | "GRENADE", "GYMNASIUM", "HAIRCUTS", "HEIST9", "INT_HOUSE", 30 | "INT_OFFICE", "INT_SHOP", "JST_BUISNESS", "KART", "KISSING", 31 | "KNIFE", "LAPDAN1", "LAPDAN2", "LAPDAN3", "LOWRIDER", 32 | "MD_CHASE", "MD_END", "MEDIC", "MISC", "MTB", 33 | "MUSCULAR", "NEVADA", "ON_LOOKERS", "OTB", "PARACHUTE", 34 | "PARK", "PAULNMAC", "PED", "PLAYER_DVBYS", "PLAYIDLES", 35 | "POLICE", "POOL", "POOR", "PYTHON", "QUAD", 36 | "QUAD_DBZ", "RAPPING", "RIFLE", "RIOT", "ROB_BANK", 37 | "ROCKET", "RUNNINGMAN", "RUSTLER", "RYDER", "SAMP", 38 | "SCRATCHING", "SEX", "SHAMAL", "SHOP", "SHOTGUN", 39 | "SILENCED", "SKATE", "SMOKING", "SNIPER", "SNM", 40 | "SPRAYCAN", "STRIP", "SUNBATHE", "SWAT", "SWEET", 41 | "SWIM", "SWORD", "TANK", "TATTOOS", "TEC", 42 | "TRAIN", "TRUCK", "UZI", "VAN", "VENDING", 43 | "VORTEX", "WAYFARER", "WEAPONS", "WOP", "WUZI" 44 | }; 45 | 46 | stock BREAKS_SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) 47 | { 48 | BREAKS_gPlayerSkin[playerid] = skin; 49 | return SetSpawnInfo(playerid, team, skin, x, y, z, rotation, WEAPON:weapon1, weapon1_ammo, WEAPON:weapon2, weapon2_ammo, WEAPON:weapon3, weapon3_ammo); 50 | } 51 | 52 | #if defined _ALS_SetSpawnInfo 53 | #undef SetSpawnInfo 54 | #endif 55 | #define SetSpawnInfo( BREAKS_SetSpawnInfo( 56 | #define _ALS_SetSpawnInfo 57 | 58 | stock BREAKS_SetPlayerSkin(playerid, skin) 59 | { 60 | BREAKS_gPlayerSkin[playerid] = skin; 61 | return SetPlayerSkin(playerid, skin); 62 | } 63 | 64 | #if defined _ALS_SetPlayerSkin 65 | #undef SetPlayerSkin 66 | #endif 67 | #define SetPlayerSkin( BREAKS_SetPlayerSkin( 68 | #define _ALS_SetPlayerSkin 69 | 70 | stock BREAKS_GetPlayerSkin(playerid) 71 | { 72 | return BREAKS_gPlayerSkin[playerid]; 73 | } 74 | 75 | #if defined _ALS_GetPlayerSkin 76 | #undef GetPlayerSkin 77 | #endif 78 | #define GetPlayerSkin( BREAKS_GetPlayerSkin( 79 | #define _ALS_GetPlayerSkin 80 | 81 | stock BREAKS_SetPlayerColor(playerid, colour) 82 | { 83 | BREAKS_gPlayerColour[playerid] = colour; 84 | return SetPlayerColor(playerid, colour); 85 | } 86 | 87 | #if defined _ALS_SetPlayerColor 88 | #undef SetPlayerColor 89 | #endif 90 | #define SetPlayerColor( BREAKS_SetPlayerColor( 91 | #define _ALS_SetPlayerColor 92 | 93 | stock BREAKS_GetPlayerColor(playerid) 94 | { 95 | return BREAKS_gPlayerColour[playerid]; 96 | } 97 | 98 | #if defined _ALS_GetPlayerColor 99 | #undef GetPlayerColor 100 | #endif 101 | #define GetPlayerColor( BREAKS_GetPlayerColor( 102 | #define _ALS_GetPlayerColor 103 | 104 | public OnFilterScriptInit() 105 | { 106 | BREAKS_gFilterscript = true; 107 | for (new i = 0; i != MAX_PLAYERS; ++i) 108 | { 109 | if (IsPlayerConnected(i)) 110 | { 111 | BREAKS_gExtraOPC[i] = true; 112 | } 113 | } 114 | #if defined BREAKS_OnFilterScriptInit 115 | BREAKS_OnFilterScriptInit(); 116 | #endif 117 | return 1; 118 | } 119 | 120 | #if defined _ALS_OnFilterScriptInit 121 | #undef OnFilterScriptInit 122 | #endif 123 | #define OnFilterScriptInit( BREAKS_OnFilterScriptInit( 124 | #define _ALS_OnFilterScriptInit 125 | 126 | #if defined BREAKS_OnFilterScriptInit 127 | forward BREAKS_OnFilterScriptInit(); 128 | #endif 129 | 130 | public OnGameModeInit() 131 | { 132 | if (!BREAKS_gFilterscript) 133 | { 134 | for (new i = 0; i != MAX_PLAYERS; ++i) 135 | { 136 | if (IsPlayerConnected(i)) 137 | { 138 | BREAKS_gExtraOPC[i] = true; 139 | } 140 | } 141 | } 142 | #if defined BREAKS_OnGameModeInit 143 | BREAKS_OnGameModeInit(); 144 | #endif 145 | return 1; 146 | } 147 | 148 | #if defined _ALS_OnGameModeInit 149 | #undef OnGameModeInit 150 | #endif 151 | #define OnGameModeInit( BREAKS_OnGameModeInit( 152 | #define _ALS_OnGameModeInit 153 | 154 | #if defined BREAKS_OnGameModeInit 155 | forward BREAKS_OnGameModeInit(); 156 | #endif 157 | 158 | public OnPlayerConnect(playerid) 159 | { 160 | BREAKS_gPlayerColour[playerid] = 0; 161 | BREAKS_gPlayerSkin[playerid] = 0; 162 | BREAKS_gCPInitialised[playerid] = false; 163 | BREAKS_gRCPInitialised[playerid] = false; 164 | BREAKS_gCPSize[playerid] = 0; 165 | BREAKS_gRCPSize[playerid] = 0; 166 | if (BREAKS_gExtraOPC[playerid]) 167 | { 168 | BREAKS_gExtraOPC[playerid] = false; 169 | } 170 | #if defined BREAKS_OnPlayerConnect 171 | else 172 | { 173 | BREAKS_OnPlayerConnect(playerid); 174 | } 175 | #endif 176 | return 1; 177 | } 178 | 179 | #if defined _ALS_OnPlayerConnect 180 | #undef OnPlayerConnect 181 | #endif 182 | #define OnPlayerConnect( BREAKS_OnPlayerConnect( 183 | #define _ALS_OnPlayerConnect 184 | 185 | #if defined BREAKS_OnPlayerConnect 186 | forward BREAKS_OnPlayerConnect(playerid); 187 | #endif 188 | 189 | public OnPlayerDisconnect(playerid, reason) 190 | { 191 | #if defined BREAKS_OnPlayerDisconnect 192 | if (reason != 4) 193 | { 194 | BREAKS_OnPlayerDisconnect(playerid, reason); 195 | } 196 | #endif 197 | return 1; 198 | } 199 | 200 | #if defined _ALS_OnPlayerDisconnect 201 | #undef OnPlayerDisconnect 202 | #endif 203 | #define OnPlayerDisconnect( BREAKS_OnPlayerDisconnect( 204 | #define _ALS_OnPlayerDisconnect 205 | 206 | #if defined BREAKS_OnPlayerDisconnect 207 | forward BREAKS_OnPlayerDisconnect(playerid, reason); 208 | #endif 209 | 210 | public OnPlayerDeath(playerid, killerid, reason) 211 | { 212 | new money = GetPlayerMoney(playerid); 213 | if (money > 0) 214 | { 215 | ResetPlayerMoney(playerid); 216 | if (money > 100) 217 | { 218 | GivePlayerMoney(playerid, money - 100); 219 | } 220 | } 221 | #if defined BREAKS_OnPlayerDeath 222 | BREAKS_OnPlayerDeath(playerid, killerid, reason); 223 | #endif 224 | return 1; 225 | } 226 | 227 | #if defined _ALS_OnPlayerDeath 228 | #undef OnPlayerDeath 229 | #endif 230 | #define OnPlayerDeath( BREAKS_OnPlayerDeath( 231 | #define _ALS_OnPlayerDeath 232 | 233 | #if defined BREAKS_OnPlayerDeath 234 | forward BREAKS_OnPlayerDeath(playerid, killerid, reason); 235 | #endif 236 | 237 | stock BREAKS_SpawnPlayer(playerid) 238 | { 239 | if (IsPlayerInAnyVehicle(playerid)) 240 | { 241 | SetPlayerHealth(playerid, 0.0); 242 | } 243 | return SpawnPlayer(playerid); 244 | } 245 | 246 | #if defined _ALS_SpawnPlayer 247 | #undef SpawnPlayer 248 | #endif 249 | #define SpawnPlayer( BREAKS_SpawnPlayer( 250 | #define _ALS_SpawnPlayer 251 | 252 | stock BREAKS_SetPlayerName(playerid, name[]) 253 | { 254 | new old[MAX_PLAYER_NAME + 1]; 255 | if (GetPlayerName(playerid, old, sizeof (old))) 256 | { 257 | if (strcmp(name, old, true) == 0) 258 | { 259 | return 1; 260 | } 261 | return SetPlayerName(playerid, name); 262 | } 263 | return 0; 264 | } 265 | 266 | #if defined _ALS_SetPlayerName 267 | #undef SetPlayerName 268 | #endif 269 | #define SetPlayerName( BREAKS_SetPlayerName( 270 | #define _ALS_SetPlayerName 271 | 272 | stock BREAKS_GetWeaponName(weaponid, const weapon[], len) 273 | { 274 | switch (weaponid) 275 | { 276 | case 18, 44, 45: 277 | weapon[0] = '\0'; 278 | return 0; 279 | } 280 | return _:GetWeaponName(WEAPON:weaponid, weapon, len); 281 | } 282 | 283 | #if defined _ALS_GetWeaponName 284 | #undef GetWeaponName 285 | #endif 286 | #define GetWeaponName( BREAKS_GetWeaponName( 287 | #define _ALS_GetWeaponName 288 | 289 | stock BREAKS_SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size) 290 | { 291 | BREAKS_gCPInitialised = true; 292 | if (BREAKS_gCPSize[playerid] == 0) 293 | { 294 | BREAKS_gCPSize[playerid] size; 295 | } 296 | return SetPlayerCheckpoint(playerid, x, y, z, BREAKS_gCPSize[playerid]); 297 | } 298 | 299 | #if defined _ALS_SetPlayerCheckpoint 300 | #undef SetPlayerCheckpoint 301 | #endif 302 | #define SetPlayerCheckpoint( BREAKS_SetPlayerCheckpoint( 303 | #define _ALS_SetPlayerCheckpoint 304 | 305 | stock BREAKS_DisablePlayerCheckpoint(playerid) 306 | { 307 | BREAKS_gCPInitialised = true; 308 | BREAKS_gCPSize[playerid] = 0; 309 | return DisablePlayerCheckpoint(playerid); 310 | } 311 | 312 | #if defined _ALS_DisablePlayerCheckpoint 313 | #undef DisablePlayerCheckpoint 314 | #endif 315 | #define DisablePlayerCheckpoint( BREAKS_DisablePlayerCheckpoint( 316 | #define _ALS_DisablePlayerCheckpoint 317 | 318 | stock BREAKS_SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size) 319 | { 320 | BREAKS_gRCPInitialised = true; 321 | if (BREAKS_gRCPSize[playerid] == 0) 322 | { 323 | BREAKS_gRCPSize[playerid] size; 324 | } 325 | return _:SetPlayerRaceCheckpoint(playerid, CP_TYPE:type, x, y, z, nextx, nexty, nextz, BREAKS_gRCPSize[playerid]); 326 | } 327 | 328 | #if defined _ALS_SetPlayerRaceCheckpoint 329 | #undef SetPlayerRaceCheckpoint 330 | #endif 331 | #define SetPlayerRaceCheckpoint( BREAKS_SetPlayerRaceCheckpoint( 332 | #define _ALS_SetPlayerRaceCheckpoint 333 | 334 | stock BREAKS_DisablePlayerRaceCP(playerid) 335 | { 336 | BREAKS_gRCPInitialised = true; 337 | BREAKS_gRCPSize[playerid] = 0; 338 | return DisablePlayerRaceCheckpoint(playerid); 339 | } 340 | 341 | #if defined _ALS_DisablePlayerRaceCP 342 | #undef DisablePlayerRaceCheckpoint 343 | #endif 344 | #define DisablePlayerRaceCheckpoint( BREAKS_DisablePlayerRaceCP( 345 | #define _ALS_DisablePlayerRaceCP 346 | 347 | stock BREAKS_IsPlayerInCheckpoint(playerid) 348 | { 349 | return BREAKS_gCPInitialised[playerid] ? IsPlayerInCheckpoint(playerid) : random(cellmax); 350 | } 351 | 352 | #if defined _ALS_IsPlayerInCheckpoint 353 | #undef IsPlayerInCheckpoint 354 | #endif 355 | #define IsPlayerInCheckpoint( BREAKS_IsPlayerInCheckpoint( 356 | #define _ALS_IsPlayerInCheckpoint 357 | 358 | stock BREAKS_IsPlayerInRaceCheckpoint(playerid) 359 | { 360 | return BREAKS_gRCPInitialised[playerid] ? IsPlayerInRaceCheckpoint(playerid) : random(cellmax); 361 | } 362 | 363 | #if defined _ALS_IsPlayerInRaceCheckpoint 364 | #undef IsPlayerInRaceCheckpoint 365 | #endif 366 | #define IsPlayerInRaceCheckpoint( BREAKS_IsPlayerInRaceCheckpoint( 367 | #define _ALS_IsPlayerInRaceCheckpoint 368 | 369 | stock Text:BREAKS_TextDrawCreate(Float:x, Float:y, text[]) 370 | { 371 | new len = strlen(text); 372 | if (len == 0 || len > 1024) 373 | { 374 | #emit HALT 100 375 | } 376 | if (text[len - 1] == ' ') 377 | { 378 | return TextDrawCreate(x, y, " "); 379 | } 380 | return TextDrawCreate(x, y, text); 381 | } 382 | 383 | #if defined _ALS_TextDrawCreate 384 | #undef TextDrawCreate 385 | #endif 386 | #define TextDrawCreate( BREAKS_TextDrawCreate( 387 | #define _ALS_TextDrawCreate 388 | 389 | stock PlayerText:BREAKS_CreatePlayerTextDraw(playerid, Float:x, Float:y, text[]) 390 | { 391 | new len = strlen(text); 392 | if (len == 0 || len > 1024) 393 | { 394 | #emit HALT 100 395 | } 396 | if (text[len - 1] == ' ') 397 | { 398 | return CreatePlayerTextDraw(playerid, x, y, " "); 399 | } 400 | return CreatePlayerTextDraw(playerid, x, y, text); 401 | } 402 | 403 | #if defined _ALS_CreatePlayerTextDraw 404 | #undef CreatePlayerTextDraw 405 | #endif 406 | #define CreatePlayerTextDraw( BREAKS_CreatePlayerTextDraw( 407 | #define _ALS_CreatePlayerTextDraw 408 | 409 | stock BREAKS_TextDrawSetString(Text:text, string[]) 410 | { 411 | new len = strlen(string); 412 | if (len == 0 || len > 1024) 413 | { 414 | #emit HALT 100 415 | } 416 | if (string[len - 1] == ' ') 417 | { 418 | return TextDrawSetString(text, " "); 419 | } 420 | return TextDrawSetString(text, string); 421 | } 422 | 423 | #if defined _ALS_TextDrawSetString 424 | #undef TextDrawSetString 425 | #endif 426 | #define TextDrawSetString( BREAKS_TextDrawSetString( 427 | #define _ALS_TextDrawSetString 428 | 429 | stock BREAKS_PlayerTextDrawSetString(playerid, PlayerText:text, string[]) 430 | { 431 | new len = strlen(string); 432 | if (len == 0 || len > 1024) 433 | { 434 | #emit HALT 100 435 | } 436 | if (string[len - 1] == ' ') 437 | { 438 | return PlayerTextDrawSetString(playerid, text, " "); 439 | } 440 | return PlayerTextDrawSetString(playerid, text, string); 441 | } 442 | 443 | #if defined _ALS_PlayerTextDrawSetString 444 | #undef PlayerTextDrawSetString 445 | #endif 446 | #define PlayerTextDrawSetString( BREAKS_PlayerTextDrawSetString( 447 | #define _ALS_PlayerTextDrawSetString 448 | 449 | forward BREAKS_AllowInteriorWeapons(allow); 450 | 451 | #if defined _ALS_AllowInteriorWeapons 452 | #undef AllowInteriorWeapons 453 | #endif 454 | #define AllowInteriorWeapons( BREAKS_AllowInteriorWeapons( 455 | #define _ALS_AllowInteriorWeapons 456 | 457 | forward Float:BREAKS_GetGravity(); 458 | 459 | #if defined _ALS_GetGravity 460 | #undef GetGravity 461 | #endif 462 | #define GetGravity( BREAKS_GetGravity( 463 | #define _ALS_GetGravity 464 | 465 | forward BREAKS_gpci(playerid, serial[], len = sizeof (serial)); 466 | 467 | #if defined _ALS_gpci 468 | #undef gpci 469 | #endif 470 | #define gpci( BREAKS_gpci( 471 | #define _ALS_gpci 472 | 473 | forward BREAKS_HideGameTextForPlayer(playerid, style); 474 | 475 | #if defined _ALS_HideGameTextForPlayer 476 | #undef HideGameTextForPlayer 477 | #endif 478 | #define HideGameTextForPlayer( BREAKS_HideGameTextForPlayer( 479 | #define _ALS_HideGameTextForPlayer 480 | 481 | forward BREAKS_HideGameTextForAll(style); 482 | 483 | #if defined _ALS_HideGameTextForAll 484 | #undef HideGameTextForAll 485 | #endif 486 | #define HideGameTextForAll( BREAKS_HideGameTextForAll( 487 | #define _ALS_HideGameTextForAll 488 | 489 | forward bool:BREAKS_IsValidVehicle(vehicleid); 490 | 491 | #if defined _ALS_IsValidVehicle 492 | #undef IsValidVehicle 493 | #endif 494 | #define IsValidVehicle( BREAKS_IsValidVehicle( 495 | #define _ALS_IsValidVehicle 496 | 497 | stock BREAKS_random(max) 498 | { 499 | if (max < 0) 500 | { 501 | return 0; 502 | } 503 | return random(max); 504 | } 505 | 506 | #if defined _ALS_random 507 | #undef random 508 | #endif 509 | #define random( BREAKS_random( 510 | #define _ALS_random 511 | 512 | stock BREAKS_IsPlayerConnected(playerid) 513 | { 514 | return IsPlayerConnected(playerid & 0xFFFF); 515 | } 516 | 517 | #if defined _ALS_IsPlayerConnected 518 | #undef IsPlayerConnected 519 | #endif 520 | #define IsPlayerConnected( BREAKS_IsPlayerConnected( 521 | #define _ALS_IsPlayerConnected 522 | 523 | stock BREAKS_ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0) 524 | { 525 | for (new i = 0; i != sizeof (BREAKS_gscAnimLib); ++i) 526 | { 527 | if (strcmp(animlib, BREAKS_gscAnimLib[i], true) == 0) 528 | { 529 | if (BREAKS_gLibraryInitialised[playerid][i / 32] & (1 << (i % 32))) 530 | { 531 | return ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, FORCE_SYNC:forcesync); 532 | } 533 | else 534 | { 535 | BREAKS_gLibraryInitialised[playerid][i / 32] |= (1 << (i % 32)); 536 | } 537 | return 1; 538 | } 539 | } 540 | return 0; 541 | } 542 | 543 | #if defined _ALS_ApplyAnimation 544 | #undef ApplyAnimation 545 | #endif 546 | #define ApplyAnimation( BREAKS_ApplyAnimation( 547 | #define _ALS_ApplyAnimation 548 | 549 | //stock BREAKS_ApplyActorAnimation(actorid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time) 550 | //{ 551 | // for (new i = 0; i != sizeof (BREAKS_gscAnimLib); ++i) 552 | // { 553 | // if (strcmp(animlib, BREAKS_gscAnimLib[i], true) == 0) 554 | // { 555 | // // TODO: Per-player actor animations. 556 | // for (new playerid = 0; playerid != MAX_PLAYERS; ++playerid) 557 | // { 558 | // if (BREAKS_gLibraryInitialised[playerid][i / 32] & (1 << (i % 32))) 559 | // { 560 | // return ApplyActorAnimation(actorid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time); 561 | // } 562 | // else 563 | // { 564 | // BREAKS_gLibraryInitialised[playerid][i / 32] |= (1 << (i % 32)); 565 | // } 566 | // } 567 | // return 1; 568 | // } 569 | // } 570 | // return 0; 571 | //} 572 | // 573 | //#if defined _ALS_ApplyActorAnimation 574 | // #undef ApplyActorAnimation 575 | //#endif 576 | //#define ApplyActorAnimation( BREAKS_ApplyActorAnimation( 577 | //#define _ALS_ApplyActorAnimation 578 | 579 | stock BREAKS_valstr(dest[], value, bool:pack = false) 580 | { 581 | if (value == cellmin) 582 | { 583 | if (pack) 584 | { 585 | dest{0} = '-'; 586 | dest{1} = '-'; 587 | dest{2} = '\0'; 588 | } 589 | else 590 | { 591 | dest[0] = '-'; 592 | dest[1] = '-'; 593 | dest[2] = '\0'; 594 | } 595 | return 0; 596 | } 597 | return valstr(dest, value, pack); 598 | } 599 | 600 | #if defined _ALS_valstr 601 | #undef valstr 602 | #endif 603 | #define valstr( BREAKS_valstr( 604 | #define _ALS_valstr 605 | 606 | stock BREAKS_ispacked(const string[]) 607 | { 608 | return string[0] >= (1 << (cellbits - 8)) - 1; 609 | } 610 | 611 | #if defined _ALS_ispacked 612 | #undef ispacked 613 | #endif 614 | #define ispacked( BREAKS_ispacked( 615 | #define _ALS_ispacked 616 | 617 | stock Float:BREAKS_floatfract(Float:value) 618 | { 619 | return (value - floatround(value, floatround_floor)); 620 | } 621 | 622 | #if defined _ALS_floatfract 623 | #undef floatfract 624 | #endif 625 | #define floatfract( BREAKS_floatfract( 626 | #define _ALS_floatfract 627 | 628 | #endinput 629 | 630 | stock BREAKS_$() 631 | { 632 | return $(); 633 | } 634 | 635 | #if defined _ALS_$ 636 | #undef $ 637 | #endif 638 | #define $( BREAKS_$( 639 | #define _ALS_$ 640 | 641 | -------------------------------------------------------------------------------- /test-a_samp.pwn: -------------------------------------------------------------------------------- 1 | //#define STRONG_TAGS 2 | //#pragma warning disable 234 3 | //#define FIXES_Single 0 4 | //#define FIX_const 0 5 | //#define FIX_bool_tags 0 6 | 7 | #tryinclude 8 | #tryinclude 9 | #if !defined _http_included 10 | #include 11 | #endif 12 | 13 | #undef MAX_PLAYERS 14 | #define MAX_PLAYERS (100) 15 | 16 | #if !defined SendClientCheck 17 | native SendClientCheck(playerid, type, memoryAddress, memoryOffset, byteCount); 18 | #endif 19 | 20 | #if !defined GetPlayerCustomSkin 21 | native GetPlayerCustomSkin(playerid); 22 | #endif 23 | 24 | #if !defined AddCharModel 25 | native AddCharModel(baseid, newid, const dff[], const textureLibrary[]); 26 | #endif 27 | 28 | #if !defined AddSimpleModel 29 | native AddSimpleModel(virtualWorld, baseid, newid, const dff[], const textureLibrary[]); 30 | #endif 31 | 32 | #if !defined AddSimpleModelTimed 33 | native AddSimpleModelTimed(virtualWorld, baseid, newid, const dff[], const textureLibrary[], timeOn, timeOff); 34 | #endif 35 | 36 | #if !defined FindModelFileNameFromCRC 37 | native FindModelFileNameFromCRC(crc, output[], retstr_size = sizeof (output)); 38 | #endif 39 | 40 | #if !defined FindTextureFileNameFromCRC 41 | native FindTextureFileNameFromCRC(crc, output[], retstr_size = sizeof (output)); 42 | #endif 43 | 44 | #if !defined RedirectDownload 45 | native RedirectDownload(playerid, const url[]); 46 | #endif 47 | 48 | #include "fixes" 49 | 50 | forward CompileTest(); 51 | 52 | main() 53 | { 54 | print("fixes.inc compile test"); 55 | } 56 | 57 | public CompileTest() 58 | { 59 | new output[32]; 60 | new ivar; 61 | new Float:fvar; 62 | new VEHICLE_PARAMS:vparams; 63 | new WEAPON:wvar; 64 | new KEY:kvar; 65 | new ACTION:avar; 66 | 67 | // Gives a warning. 68 | fgetchar(File:0, 0, false); 69 | // Doesn't give a warning. 70 | fgetchar(File:0, false); 71 | 72 | // Using defaults. 73 | Print__("STRING"); 74 | PrintF__("STRING"); 75 | Format__(output, _, "STRING"); 76 | SendClientMessage(0, 0, "STRING"); 77 | SendClientMessageToAll(0, "STRING"); 78 | SendPlayerMessageToPlayer(0, 0, "STRING"); 79 | SendPlayerMessageToAll(0, "STRING"); 80 | SendDeathMessage(0, 0, 0); 81 | SendDeathMessageToPlayer(0, 0, 0, 0); 82 | GameTextForAll("STRING", 0, 0); 83 | GameTextForPlayer(0, "STRING", 0, 0); 84 | SetTimer("STRING", 0, false); 85 | SetTimerEx("STRING", 0, false, ""); 86 | KillTimer(0); 87 | GetTickCount(); 88 | ivar = GetMaxPlayers(); 89 | CallRemoteFunction("STRING", ""); 90 | CallLocalFunction("STRING", ""); 91 | VectorSize(0, 0, 0); 92 | ASin__(0); 93 | ACos__(0); 94 | ATan__(0); 95 | ATan2__(0, 0); 96 | ivar = GetPlayerPoolSize(); 97 | ivar = GetVehiclePoolSize(); 98 | ivar = GetActorPoolSize(); 99 | SHA256_PassHash("STRING", "STRING", output, _); 100 | SetSVarInt("STRING", 0); 101 | GetSVarInt("STRING"); 102 | SetSVarString("STRING", "STRING"); 103 | GetSVarString("STRING", output, _); 104 | SetSVarFloat("STRING", 0); 105 | GetSVarFloat("STRING"); 106 | DeleteSVar("STRING"); 107 | GetSVarsUpperIndex(); 108 | GetSVarNameAtIndex(0, output, sizeof (output)); 109 | GetSVarType("STRING"); 110 | SetGameModeText("STRING"); 111 | SetTeamCount(0); 112 | AddPlayerClass(0, 0, 0, 0, 0, WEAPON_FIST, 0, WEAPON_FIST, 0, WEAPON_FIST, 0); 113 | AddPlayerClassEx(0, 0, 0, 0, 0, 0, WEAPON_FIST, 0, WEAPON_FIST, 0, WEAPON_FIST, 0); 114 | AddStaticVehicle(0, 0, 0, 0, 0, 0, 0); 115 | AddStaticVehicleEx(0, 0, 0, 0, 0, 0, 0, 0); 116 | AddStaticPickup(0, 0, 0, 0, 0); 117 | CreatePickup(0, 0, 0, 0, 0); 118 | DestroyPickup(0); 119 | ShowNameTags(false); 120 | ShowPlayerMarkers(PLAYER_MARKERS_MODE_STREAMED); 121 | GameModeExit(); 122 | SetWorldTime(0); 123 | GetWeaponName(WEAPON_FIST, output, _); 124 | EnableTirePopping(true); 125 | EnableVehicleFriendlyFire(); 126 | AllowInteriorWeapons(false); 127 | SetWeather(0); 128 | GetGravity(); 129 | SetGravity(0); 130 | AllowAdminTeleport(false); 131 | SetDeathDropAmount(0); 132 | CreateExplosion(0, 0, 0, 0, 0); 133 | EnableZoneNames(false); 134 | UsePlayerPedAnims(); 135 | DisableInteriorEnterExits(); 136 | SetNameTagDrawDistance(0); 137 | DisableNameTagLOS(); 138 | LimitGlobalChatRadius(0); 139 | LimitPlayerMarkerRadius(0); 140 | ConnectNPC("STRING", "STRING"); 141 | IsPlayerNPC(0); 142 | AddCharModel(0, 0, "STRING", "STRING"); 143 | AddSimpleModel(0, 0, 0, "STRING", "STRING"); 144 | AddSimpleModelTimed(0, 0, 0, "STRING", "STRING", 0, 0); 145 | FindModelFileNameFromCRC(0, output, _); 146 | FindTextureFileNameFromCRC(0, output, _); 147 | RedirectDownload(0, "STRING"); 148 | IsPlayerAdmin(0); 149 | Kick(0); 150 | Ban(0); 151 | BanEx(0, "STRING"); 152 | SendRconCommand("STRING"); 153 | GetPlayerNetworkStats(0, output, sizeof (output)); 154 | GetNetworkStats(output, sizeof (output)); 155 | GetPlayerVersion(0, output, sizeof (output)); 156 | BlockIpAddress("STRING", 0); 157 | UnBlockIpAddress("STRING"); 158 | GetServerVarAsString("STRING", output, sizeof (output)); 159 | GetServerVarAsInt("STRING"); 160 | GetServerVarAsBool("STRING"); 161 | GetConsoleVarAsString("STRING", output, sizeof (output)); 162 | GetConsoleVarAsInt("STRING"); 163 | GetConsoleVarAsBool("STRING"); 164 | GetServerTickRate(); 165 | NetStats_GetConnectedTime(0); 166 | NetStats_MessagesReceived(0); 167 | NetStats_BytesReceived(0); 168 | NetStats_MessagesSent(0); 169 | NetStats_BytesSent(0); 170 | NetStats_MessagesRecvPerSecond(0); 171 | NetStats_PacketLossPercent(0); 172 | NetStats_ConnectionStatus(0); 173 | NetStats_GetIpPort(0, output, sizeof (output)); 174 | CreateMenu("STRING", 0, 0, 0, 0.0); 175 | DestroyMenu(INVALID_MENU); 176 | AddMenuItem(INVALID_MENU, 0, "STRING"); 177 | SetMenuColumnHeader(INVALID_MENU, 0, "STRING"); 178 | ShowMenuForPlayer(INVALID_MENU, 0); 179 | HideMenuForPlayer(INVALID_MENU, 0); 180 | IsValidMenu(INVALID_MENU); 181 | DisableMenu(INVALID_MENU); 182 | DisableMenuRow(INVALID_MENU, 0); 183 | GetPlayerMenu(0); 184 | TextDrawCreate(0, 0, "STRING"); 185 | TextDrawDestroy(INVALID_TEXT_DRAW); 186 | TextDrawLetterSize(INVALID_TEXT_DRAW, 0, 0); 187 | TextDrawTextSize(INVALID_TEXT_DRAW, 0, 0); 188 | TextDrawAlignment(INVALID_TEXT_DRAW, TEXT_DRAW_ALIGN_LEFT); 189 | TextDrawColor(INVALID_TEXT_DRAW, 0); 190 | TextDrawUseBox(INVALID_TEXT_DRAW, false); 191 | TextDrawBoxColor(INVALID_TEXT_DRAW, 0); 192 | TextDrawSetShadow(INVALID_TEXT_DRAW, 0); 193 | TextDrawSetOutline(INVALID_TEXT_DRAW, 0); 194 | TextDrawBackgroundColor(INVALID_TEXT_DRAW, 0); 195 | TextDrawFont(INVALID_TEXT_DRAW, TEXT_DRAW_FONT_0); 196 | TextDrawSetProportional(INVALID_TEXT_DRAW, false); 197 | TextDrawSetSelectable(INVALID_TEXT_DRAW, false); 198 | TextDrawShowForPlayer(0, INVALID_TEXT_DRAW); 199 | TextDrawHideForPlayer(0, INVALID_TEXT_DRAW); 200 | TextDrawShowForAll(INVALID_TEXT_DRAW); 201 | TextDrawHideForAll(INVALID_TEXT_DRAW); 202 | TextDrawSetString(INVALID_TEXT_DRAW, "STRING"); 203 | TextDrawSetPreviewModel(INVALID_TEXT_DRAW, 0); 204 | TextDrawSetPreviewRot(INVALID_TEXT_DRAW, 0, 0, 0.0); 205 | TextDrawSetPreviewVehCol(INVALID_TEXT_DRAW, 0, 0); 206 | GangZoneCreate(0, 0, 0, 0); 207 | GangZoneDestroy(0); 208 | GangZoneShowForPlayer(0, 0, 0); 209 | GangZoneShowForAll(0, 0); 210 | GangZoneHideForPlayer(0, 0); 211 | GangZoneHideForAll(0); 212 | GangZoneFlashForPlayer(0, 0, 0); 213 | GangZoneFlashForAll(0, 0); 214 | GangZoneStopFlashForPlayer(0, 0); 215 | GangZoneStopFlashForAll(0); 216 | Create3DTextLabel("STRING", 0, 0, 0, 0, 0, 0); 217 | Delete3DTextLabel(INVALID_3DTEXT_ID); 218 | Attach3DTextLabelToPlayer(INVALID_3DTEXT_ID, 0, 0, 0, 0); 219 | Attach3DTextLabelToVehicle(INVALID_3DTEXT_ID, 0, 0, 0, 0); 220 | Update3DTextLabelText(INVALID_3DTEXT_ID, 0, "STRING"); 221 | CreatePlayer3DTextLabel(0, "STRING", 0, 0, 0, 0, 0); 222 | DeletePlayer3DTextLabel(0, INVALID_PLAYER_3DTEXT_ID); 223 | UpdatePlayer3DTextLabelText(0, INVALID_PLAYER_3DTEXT_ID, 0, "STRING"); 224 | ShowPlayerDialog(0, 0, DIALOG_STYLE_MSGBOX, "STRING", "STRING", "STRING", "STRING"); 225 | gpci(0, output, _); 226 | CreateVehicle(0, 0, 0, 0, 0, 0, 0, 0); 227 | DestroyVehicle(0); 228 | IsVehicleStreamedIn(0, 0); 229 | GetVehiclePos(0, fvar, fvar, fvar); 230 | SetVehiclePos(0, 0, 0, 0); 231 | GetVehicleZAngle(0, fvar); 232 | GetVehicleRotationQuat(0, fvar, fvar, fvar, fvar); 233 | GetVehicleDistanceFromPoint(0, 0, 0, 0); 234 | SetVehicleZAngle(0, 0); 235 | SetVehicleParamsForPlayer(0, 0, 0, 0); 236 | ManualVehicleEngineAndLights(); 237 | SetVehicleParamsEx(0, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON); 238 | GetVehicleParamsEx(0, vparams, vparams, vparams, vparams, vparams, vparams, vparams); 239 | GetVehicleParamsSirenState(0); 240 | SetVehicleParamsCarDoors(0, 0, 0, 0, 0); 241 | GetVehicleParamsCarDoors(0, ivar, ivar, ivar, ivar); 242 | SetVehicleParamsCarWindows(0, 0, 0, 0, 0); 243 | GetVehicleParamsCarWindows(0, ivar, ivar, ivar, ivar); 244 | SetVehicleToRespawn(0); 245 | LinkVehicleToInterior(0, 0); 246 | AddVehicleComponent(0, 0); 247 | RemoveVehicleComponent(0, 0); 248 | ChangeVehicleColor(0, 0, 0); 249 | ChangeVehiclePaintjob(0, 0); 250 | SetVehicleHealth(0, 0); 251 | GetVehicleHealth(0, fvar); 252 | AttachTrailerToVehicle(0, 0); 253 | DetachTrailerFromVehicle(0); 254 | IsTrailerAttachedToVehicle(0); 255 | GetVehicleTrailer(0); 256 | SetVehicleNumberPlate(0, "STRING"); 257 | GetVehicleModel(0); 258 | GetVehicleComponentInSlot(0, CARMODTYPE_EXHAUST); 259 | GetVehicleComponentType(0); 260 | RepairVehicle(0); 261 | GetVehicleVelocity(0, fvar, fvar, fvar); 262 | SetVehicleVelocity(0, 0, 0, 0); 263 | SetVehicleAngularVelocity(0, 0, 0, 0); 264 | GetVehicleDamageStatus(0, ivar, ivar, ivar, ivar); 265 | UpdateVehicleDamageStatus(0, VEHICLE_PANEL_STATUS_NONE, VEHICLE_DOOR_STATUS_NONE, 0, 0); 266 | GetVehicleModelInfo(0, VEHICLE_MODEL_INFO_SIZE, fvar, fvar, fvar); 267 | SetVehicleVirtualWorld(0, 0); 268 | GetVehicleVirtualWorld(0); 269 | IsValidVehicle(0); 270 | DB_Open__("STRING"); 271 | DB_Close__(DB:0); 272 | DB_Query__(DB:0, "STRING"); 273 | DB_FreeResult__(DBResult:0); 274 | DB_NumRows__(DBResult:0); 275 | DB_NextRow__(DBResult:0); 276 | DB_NumFields__(DBResult:0); 277 | DB_FieldName__(DBResult:0, 0, output, _); 278 | DB_GetField__(DBResult:0, 0, output, _); 279 | DB_GetFieldInt__(DBResult:0); 280 | DB_GetFieldFloat__(DBResult:0); 281 | DB_GetFieldAssoc__(DBResult:0, "STRING", output, _); 282 | DB_GetFieldAssocInt__(DBResult:0, "STRING"); 283 | DB_GetFieldAssocFloat__(DBResult:0, "STRING"); 284 | DB_GetMemHandle__(DB:0); 285 | DB_GetResultMemHandle__(DBResult:0); 286 | DB_DebugOpenFiles__(); 287 | DB_DebugOpenResults__(); 288 | SetSpawnInfo(0, 0, 0, 0, 0, 0, 0, WEAPON_FIST, 0, WEAPON_FIST, 0, WEAPON_FIST, 0); 289 | SpawnPlayer(0); 290 | SetPlayerPos(0, 0, 0, 0); 291 | SetPlayerPosFindZ(0, 0, 0, 0); 292 | GetPlayerPos(0, fvar, fvar, fvar); 293 | SetPlayerFacingAngle(0, 0); 294 | GetPlayerFacingAngle(0, fvar); 295 | IsPlayerInRangeOfPoint(0, 0, 0, 0, 0); 296 | GetPlayerDistanceFromPoint(0, 0, 0, 0); 297 | IsPlayerStreamedIn(0, 0); 298 | SetPlayerInterior(0, 0); 299 | GetPlayerInterior(0); 300 | SetPlayerHealth(0, 0); 301 | GetPlayerHealth(0, fvar); 302 | SetPlayerArmour(0, 0); 303 | GetPlayerArmour(0, fvar); 304 | SetPlayerAmmo(0, WEAPON_FIST, 0); 305 | GetPlayerAmmo(0); 306 | GetPlayerWeaponState(0); 307 | GetPlayerTargetPlayer(0); 308 | GetPlayerTargetActor(0); 309 | SetPlayerTeam(0, 0); 310 | GetPlayerTeam(0); 311 | SetPlayerScore(0, 0); 312 | GetPlayerScore(0); 313 | GetPlayerDrunkLevel(0); 314 | SetPlayerDrunkLevel(0, 0); 315 | SetPlayerColor(0, 0); 316 | GetPlayerColor(0); 317 | SetPlayerSkin(0, 0); 318 | GetPlayerSkin(0); 319 | GetPlayerCustomSkin__(0); 320 | GivePlayerWeapon(0, WEAPON_FIST, 0); 321 | ResetPlayerWeapons(0); 322 | SetPlayerArmedWeapon(0, WEAPON_FIST); 323 | GetPlayerWeaponData(0, WEAPON_SLOT_UNARMED, wvar, ivar); 324 | GivePlayerMoney(0, 0); 325 | ResetPlayerMoney(0); 326 | SetPlayerName(0, "STRING"); 327 | GetPlayerMoney(0); 328 | GetPlayerState(0); 329 | GetPlayerIp(0, output, sizeof (output)); 330 | GetPlayerPing(0); 331 | GetPlayerWeapon(0); 332 | GetPlayerKeys(0, kvar, kvar, kvar); 333 | GetPlayerActions(0, avar, avar, avar); 334 | GetPlayerName(0, output, sizeof (output)); 335 | SetPlayerTime(0, 0, 0); 336 | GetPlayerTime(0, ivar, ivar); 337 | TogglePlayerClock(0, false); 338 | SetPlayerWeather(0, 0); 339 | ForceClassSelection(0); 340 | SetPlayerWantedLevel(0, 0); 341 | GetPlayerWantedLevel(0); 342 | SetPlayerFightingStyle(0, FIGHT_STYLE_KUNGFU); 343 | GetPlayerFightingStyle(0); 344 | SetPlayerVelocity(0, 0, 0, 0); 345 | GetPlayerVelocity(0, fvar, fvar, fvar); 346 | PlayCrimeReportForPlayer(0, 0, 0); 347 | PlayAudioStreamForPlayer(0, "STRING"); 348 | StopAudioStreamForPlayer(0); 349 | SetPlayerShopName(0, "STRING"); 350 | SetPlayerSkillLevel(0, WEAPONSKILL_PISTOL_SILENCED, 0); 351 | GetPlayerSurfingVehicleID(0); 352 | GetPlayerSurfingObjectID(0); 353 | RemoveBuildingForPlayer(0, 0, 0, 0, 0, 0); 354 | GetPlayerLastShotVectors(0, fvar, fvar, fvar, fvar, fvar, fvar); 355 | SetPlayerAttachedObject(0, 0, 0, 0); 356 | RemovePlayerAttachedObject(0, 0); 357 | IsPlayerAttachedObjectSlotUsed(0, 0); 358 | EditAttachedObject(0, 0); 359 | CreatePlayerTextDraw(0, 0, 0, "STRING"); 360 | PlayerTextDrawDestroy(0, INVALID_PLAYER_TEXT_DRAW); 361 | PlayerTextDrawLetterSize(0, INVALID_PLAYER_TEXT_DRAW, 0, 0); 362 | PlayerTextDrawTextSize(0, INVALID_PLAYER_TEXT_DRAW, 0, 0); 363 | PlayerTextDrawAlignment(0, INVALID_PLAYER_TEXT_DRAW, TEXT_DRAW_ALIGN_CENTER); 364 | PlayerTextDrawColor(0, INVALID_PLAYER_TEXT_DRAW, 0); 365 | PlayerTextDrawUseBox(0, INVALID_PLAYER_TEXT_DRAW, true); 366 | PlayerTextDrawBoxColor(0, INVALID_PLAYER_TEXT_DRAW, 0); 367 | PlayerTextDrawSetShadow(0, INVALID_PLAYER_TEXT_DRAW, 0); 368 | PlayerTextDrawSetOutline(0, INVALID_PLAYER_TEXT_DRAW, 0); 369 | PlayerTextDrawBackgroundColor(0, INVALID_PLAYER_TEXT_DRAW, 0); 370 | PlayerTextDrawFont(0, INVALID_PLAYER_TEXT_DRAW, TEXT_DRAW_FONT_2); 371 | PlayerTextDrawSetProportional(0, INVALID_PLAYER_TEXT_DRAW, false); 372 | PlayerTextDrawSetSelectable(0, INVALID_PLAYER_TEXT_DRAW, false); 373 | PlayerTextDrawShow(0, INVALID_PLAYER_TEXT_DRAW); 374 | PlayerTextDrawHide(0, INVALID_PLAYER_TEXT_DRAW); 375 | PlayerTextDrawSetString(0, INVALID_PLAYER_TEXT_DRAW, "STRING"); 376 | PlayerTextDrawSetPreviewModel(0, INVALID_PLAYER_TEXT_DRAW, 0); 377 | PlayerTextDrawSetPreviewRot(0, INVALID_PLAYER_TEXT_DRAW, 0, 0, 0.0); 378 | PlayerTextDrawSetPreviewVehCol(0, INVALID_PLAYER_TEXT_DRAW, 0, 0); 379 | SetPVarInt(0, "STRING", 0); 380 | GetPVarInt(0, "STRING"); 381 | SetPVarString(0, "STRING", "STRING"); 382 | GetPVarString(0, "STRING", output, _); 383 | SetPVarFloat(0, "STRING", 0); 384 | GetPVarFloat(0, "STRING"); 385 | DeletePVar(0, "STRING"); 386 | GetPVarsUpperIndex(0); 387 | GetPVarNameAtIndex(0, 0, output, sizeof (output)); 388 | GetPVarType(0, "STRING"); 389 | SetPlayerChatBubble(0, "STRING", 0, 0, 0); 390 | PutPlayerInVehicle(0, 0, 0); 391 | GetPlayerVehicleID(0); 392 | GetPlayerVehicleSeat(0); 393 | RemovePlayerFromVehicle(0); 394 | TogglePlayerControllable(0, true); 395 | PlayerPlaySound(0, 0, 0, 0, 0); 396 | ApplyAnimation(0, "STRING", "STRING", 0.0, false, false, false, false, 0); 397 | ClearAnimations(0); 398 | GetPlayerAnimationIndex(0); 399 | GetAnimationName(0, output, sizeof (output), output, sizeof (output)); 400 | GetPlayerSpecialAction(0); 401 | SetPlayerSpecialAction(0, SPECIAL_ACTION_SMOKE_CIGGY); 402 | DisableRemoteVehicleCollisions(0, false); 403 | SetPlayerCheckpoint(0, 0, 0, 0, 0); 404 | DisablePlayerCheckpoint(0); 405 | SetPlayerRaceCheckpoint(0, CP_TYPE_GROUND_NORMAL, 0, 0, 0, 0, 0, 0, 0); 406 | DisablePlayerRaceCheckpoint(0); 407 | SetPlayerWorldBounds(0, 0, 0, 0, 0); 408 | SetPlayerMarkerForPlayer(0, 0, 0); 409 | ShowPlayerNameTagForPlayer(0, 0, false); 410 | SetPlayerMapIcon(0, 0, 0, 0, 0, 0, 0); 411 | RemovePlayerMapIcon(0, 0); 412 | AllowPlayerTeleport(0, false); 413 | SetPlayerCameraPos(0, 0, 0, 0); 414 | SetPlayerCameraLookAt(0, 0, 0, 0); 415 | SetCameraBehindPlayer(0); 416 | GetPlayerCameraPos(0, fvar, fvar, fvar); 417 | GetPlayerCameraFrontVector(0, fvar, fvar, fvar); 418 | GetPlayerCameraMode(0); 419 | EnablePlayerCameraTarget(0, false); 420 | GetPlayerCameraTargetObject(0); 421 | GetPlayerCameraTargetVehicle(0); 422 | GetPlayerCameraTargetPlayer(0); 423 | GetPlayerCameraTargetActor(0); 424 | GetPlayerCameraAspectRatio(0); 425 | GetPlayerCameraZoom(0); 426 | AttachCameraToObject(0, 0); 427 | AttachCameraToPlayerObject(0, 0); 428 | InterpolateCameraPos(0, 0, 0, 0, 0, 0, 0, 0); 429 | InterpolateCameraLookAt(0, 0, 0, 0, 0, 0, 0, 0); 430 | IsPlayerConnected(0); 431 | IsPlayerInVehicle(0, 0); 432 | IsPlayerInAnyVehicle(0); 433 | IsPlayerInCheckpoint(0); 434 | IsPlayerInRaceCheckpoint(0); 435 | SetPlayerVirtualWorld(0, 0); 436 | GetPlayerVirtualWorld(0); 437 | EnableStuntBonusForPlayer(0, false); 438 | EnableStuntBonusForAll(false); 439 | TogglePlayerSpectating(0, false); 440 | PlayerSpectatePlayer(0, 0); 441 | PlayerSpectateVehicle(0, 0); 442 | StartRecordingPlayerData(0, PLAYER_RECORDING_TYPE_ONFOOT, "STRING"); 443 | StopRecordingPlayerData(0); 444 | SelectTextDraw(0, 0); 445 | CancelSelectTextDraw(0); 446 | CreateExplosionForPlayer(0, 0, 0, 0, 0, 0); 447 | SendClientCheck(0, 0, 0, 0, 0); 448 | CreateObject(0, 0, 0, 0, 0, 0, 0.0); 449 | AttachObjectToVehicle(0, 0, 0, 0, 0, 0, 0, 0); 450 | AttachObjectToObject(0, 0, 0, 0, 0, 0, 0, 0); 451 | AttachObjectToPlayer(0, 0, 0, 0, 0, 0, 0, 0); 452 | SetObjectPos(0, 0, 0, 0); 453 | GetObjectPos(0, fvar, fvar, fvar); 454 | SetObjectRot(0, 0, 0, 0); 455 | GetObjectRot(0, fvar, fvar, fvar); 456 | GetObjectModel(0); 457 | SetObjectNoCameraCol(0); 458 | IsValidObject(0); 459 | DestroyObject(0); 460 | MoveObject(0, 0, 0, 0, 0); 461 | StopObject(0); 462 | IsObjectMoving(0); 463 | EditObject(0, 0); 464 | EditPlayerObject(0, 0); 465 | SelectObject(0); 466 | CancelEdit(0); 467 | CreatePlayerObject(0, 0, 0, 0, 0, 0, 0, 0.0); 468 | AttachPlayerObjectToVehicle(0, 0, 0, 0, 0, 0, 0, 0, 0); 469 | SetPlayerObjectPos(0, 0, 0, 0, 0); 470 | GetPlayerObjectPos(0, 0, fvar, fvar, fvar); 471 | SetPlayerObjectRot(0, 0, 0, 0, 0); 472 | GetPlayerObjectRot(0, 0, fvar, fvar, fvar); 473 | GetPlayerObjectModel(0, 0); 474 | SetPlayerObjectNoCameraCol(0, 0); 475 | IsValidPlayerObject(0, 0); 476 | DestroyPlayerObject(0, 0); 477 | MovePlayerObject(0, 0, 0, 0, 0, 0); 478 | StopPlayerObject(0, 0); 479 | IsPlayerObjectMoving(0, 0); 480 | AttachPlayerObjectToPlayer(0, 0, 0, 0, 0, 0, 0, 0, 0); 481 | SetObjectMaterial(0, 0, 0, "STRING", "STRING"); 482 | SetPlayerObjectMaterial(0, 0, 0, 0, "STRING", "STRING"); 483 | SetObjectMaterialText(0, "STRING"); 484 | SetPlayerObjectMaterialText(0, 0, "STRING"); 485 | SetObjectsDefaultCameraCol(false); 486 | HTTP(0, HTTP_GET, "STRING", "STRING", "STRING"); 487 | CreateActor(0, 0, 0, 0, 0); 488 | DestroyActor(0); 489 | IsActorStreamedIn(0, 0); 490 | SetActorVirtualWorld(0, 0); 491 | GetActorVirtualWorld(0); 492 | ApplyActorAnimation(0, "STRING", "STRING", 0.0, false, false, false, false, 0); 493 | ClearActorAnimations(0); 494 | SetActorPos(0, 0, 0, 0); 495 | GetActorPos(0, fvar, fvar, fvar); 496 | SetActorFacingAngle(0, 0); 497 | GetActorFacingAngle(0, fvar); 498 | SetActorHealth(0, 0); 499 | GetActorHealth(0, fvar); 500 | SetActorInvulnerable(0); 501 | IsActorInvulnerable(0); 502 | IsValidActor(0); 503 | 504 | 505 | 506 | 507 | // Using explicits. 508 | print("STRING"); 509 | printf("STRING"); 510 | format(output, _, "STRING"); 511 | SendClientMessage(0, 0, "STRING"); 512 | SendClientMessageToAll(0, "STRING"); 513 | SendPlayerMessageToPlayer(0, 0, "STRING"); 514 | SendPlayerMessageToAll(0, "STRING"); 515 | SendDeathMessage(0, 0, 0); 516 | SendDeathMessageToPlayer(0, 0, 0, 0); 517 | GameTextForAll("STRING", 0, 0); 518 | GameTextForPlayer(0, "STRING", 0, 0); 519 | SetTimer("STRING", 0, false); 520 | SetTimerEx("STRING", 0, false, ""); 521 | KillTimer(0); 522 | GetTickCount(); 523 | ivar = GetMaxPlayers(); 524 | CallRemoteFunction("STRING", ""); 525 | CallLocalFunction("STRING", ""); 526 | VectorSize(0, 0, 0); 527 | asin(0); 528 | acos(0); 529 | atan(0); 530 | atan2(0, 0); 531 | GetPlayerPoolSize(); 532 | GetVehiclePoolSize(); 533 | GetActorPoolSize(); 534 | SHA256_PassHash("STRING", "STRING", output, _); 535 | SetSVarInt("STRING", 0); 536 | GetSVarInt("STRING"); 537 | SetSVarString("STRING", "STRING"); 538 | GetSVarString("STRING", output, _); 539 | SetSVarFloat("STRING", 0); 540 | GetSVarFloat("STRING"); 541 | DeleteSVar("STRING"); 542 | GetSVarsUpperIndex(); 543 | GetSVarNameAtIndex(0, output, _); 544 | GetSVarType("STRING"); 545 | SetGameModeText("STRING"); 546 | SetTeamCount(0); 547 | AddPlayerClass(0, 0, 0, 0, 0, WEAPON_FIST, 0, WEAPON_FIST, 0, WEAPON_FIST, 0); 548 | AddPlayerClassEx(0, 0, 0, 0, 0, 0, WEAPON_FIST, 0, WEAPON_FIST, 0, WEAPON_FIST, 0); 549 | AddStaticVehicle(0, 0, 0, 0, 0, 0, 0); 550 | AddStaticVehicleEx(0, 0, 0, 0, 0, 0, 0, 0, false); 551 | AddStaticPickup(0, 0, 0, 0, 0, 0); 552 | CreatePickup(0, 0, 0, 0, 0, 0); 553 | DestroyPickup(0); 554 | ShowNameTags(true); 555 | ShowPlayerMarkers(PLAYER_MARKERS_MODE_GLOBAL); 556 | GameModeExit(); 557 | SetWorldTime(0); 558 | GetWeaponName(WEAPON_FIST, output, _); 559 | EnableTirePopping(true); 560 | EnableVehicleFriendlyFire(); 561 | AllowInteriorWeapons(false); 562 | SetWeather(0); 563 | GetGravity(); 564 | SetGravity(0); 565 | AllowAdminTeleport(false); 566 | SetDeathDropAmount(0); 567 | CreateExplosion(0, 0, 0, 0, 0); 568 | EnableZoneNames(true); 569 | UsePlayerPedAnims(); 570 | DisableInteriorEnterExits(); 571 | SetNameTagDrawDistance(0); 572 | DisableNameTagLOS(); 573 | LimitGlobalChatRadius(0); 574 | LimitPlayerMarkerRadius(0); 575 | ConnectNPC("STRING", "STRING"); 576 | IsPlayerNPC(0); 577 | AddCharModel(0, 0, "STRING", "STRING"); 578 | AddSimpleModel(0, 0, 0, "STRING", "STRING"); 579 | AddSimpleModelTimed(0, 0, 0, "STRING", "STRING", 0, 0); 580 | FindModelFileNameFromCRC(0, output, _); 581 | FindTextureFileNameFromCRC(0, output, _); 582 | RedirectDownload(0, "STRING"); 583 | IsPlayerAdmin(0); 584 | Kick(0); 585 | Ban(0); 586 | BanEx(0, "STRING"); 587 | SendRconCommand("STRING"); 588 | GetPlayerNetworkStats(0, output, _); 589 | GetNetworkStats(output, _); 590 | GetPlayerVersion(0, output, _); 591 | BlockIpAddress("STRING", 0); 592 | UnBlockIpAddress("STRING"); 593 | GetServerVarAsString("STRING", output, _); 594 | GetServerVarAsInt("STRING"); 595 | GetServerVarAsBool("STRING"); 596 | GetConsoleVarAsString("STRING", output, _); 597 | GetConsoleVarAsInt("STRING"); 598 | GetConsoleVarAsBool("STRING"); 599 | GetServerTickRate(); 600 | NetStats_GetConnectedTime(0); 601 | NetStats_MessagesReceived(0); 602 | NetStats_BytesReceived(0); 603 | NetStats_MessagesSent(0); 604 | NetStats_BytesSent(0); 605 | NetStats_MessagesRecvPerSecond(0); 606 | NetStats_PacketLossPercent(0); 607 | NetStats_ConnectionStatus(0); 608 | NetStats_GetIpPort(0, output, _); 609 | CreateMenu("STRING", 0, 0, 0, 0, 0.0); 610 | DestroyMenu(INVALID_MENU); 611 | AddMenuItem(INVALID_MENU, 0, "STRING"); 612 | SetMenuColumnHeader(INVALID_MENU, 0, "STRING"); 613 | ShowMenuForPlayer(INVALID_MENU, 0); 614 | HideMenuForPlayer(INVALID_MENU, 0); 615 | IsValidMenu(INVALID_MENU); 616 | DisableMenu(INVALID_MENU); 617 | DisableMenuRow(INVALID_MENU, 0); 618 | GetPlayerMenu(0); 619 | TextDrawCreate(0, 0, "STRING"); 620 | TextDrawDestroy(INVALID_TEXT_DRAW); 621 | TextDrawLetterSize(INVALID_TEXT_DRAW, 0, 0); 622 | TextDrawTextSize(INVALID_TEXT_DRAW, 0, 0); 623 | TextDrawAlignment(INVALID_TEXT_DRAW, TEXT_DRAW_ALIGN_RIGHT); 624 | TextDrawColor(INVALID_TEXT_DRAW, 0); 625 | TextDrawUseBox(INVALID_TEXT_DRAW, true); 626 | TextDrawBoxColor(INVALID_TEXT_DRAW, 0); 627 | TextDrawSetShadow(INVALID_TEXT_DRAW, 0); 628 | TextDrawSetOutline(INVALID_TEXT_DRAW, 0); 629 | TextDrawBackgroundColor(INVALID_TEXT_DRAW, 0); 630 | TextDrawFont(INVALID_TEXT_DRAW, TEXT_DRAW_FONT_3); 631 | TextDrawSetProportional(INVALID_TEXT_DRAW, false); 632 | TextDrawSetSelectable(INVALID_TEXT_DRAW, false); 633 | TextDrawShowForPlayer(0, INVALID_TEXT_DRAW); 634 | TextDrawHideForPlayer(0, INVALID_TEXT_DRAW); 635 | TextDrawShowForAll(INVALID_TEXT_DRAW); 636 | TextDrawHideForAll(INVALID_TEXT_DRAW); 637 | TextDrawSetString(INVALID_TEXT_DRAW, "STRING"); 638 | TextDrawSetPreviewModel(INVALID_TEXT_DRAW, 0); 639 | TextDrawSetPreviewRot(INVALID_TEXT_DRAW, 0, 0, 0, 1.0); 640 | TextDrawSetPreviewVehCol(INVALID_TEXT_DRAW, 0, 0); 641 | GangZoneCreate(0, 0, 0, 0); 642 | GangZoneDestroy(0); 643 | GangZoneShowForPlayer(0, 0, 0); 644 | GangZoneShowForAll(0, 0); 645 | GangZoneHideForPlayer(0, 0); 646 | GangZoneHideForAll(0); 647 | GangZoneFlashForPlayer(0, 0, 0); 648 | GangZoneFlashForAll(0, 0); 649 | GangZoneStopFlashForPlayer(0, 0); 650 | GangZoneStopFlashForAll(0); 651 | Create3DTextLabel("STRING", 0, 0, 0, 0, 0, 0, false); 652 | Delete3DTextLabel(INVALID_3DTEXT_ID); 653 | Attach3DTextLabelToPlayer(INVALID_3DTEXT_ID, 0, 0, 0, 0); 654 | Attach3DTextLabelToVehicle(INVALID_3DTEXT_ID, 0, 0, 0, 0); 655 | Update3DTextLabelText(INVALID_3DTEXT_ID, 0, "STRING"); 656 | CreatePlayer3DTextLabel(0, "STRING", 0, 0, 0, 0, 0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, false); 657 | DeletePlayer3DTextLabel(0, INVALID_PLAYER_3DTEXT_ID); 658 | UpdatePlayer3DTextLabelText(0, INVALID_PLAYER_3DTEXT_ID, 0, "STRING"); 659 | ShowPlayerDialog(0, 0, DIALOG_STYLE_MSGBOX, "STRING", "STRING", "STRING", "STRING"); 660 | gpci(0, output, _); 661 | GPCI(0, output, _); 662 | CreateVehicle(0, 0, 0, 0, 0, 0, 0, 0, false); 663 | DestroyVehicle(0); 664 | IsVehicleStreamedIn(0, 0); 665 | GetVehiclePos(0, fvar, fvar, fvar); 666 | SetVehiclePos(0, 0, 0, 0); 667 | GetVehicleZAngle(0, fvar); 668 | GetVehicleRotationQuat(0, fvar, fvar, fvar, fvar); 669 | GetVehicleDistanceFromPoint(0, 0, 0, 0); 670 | SetVehicleZAngle(0, fvar); 671 | SetVehicleParamsForPlayer(0, 0, 0, 0); 672 | ManualVehicleEngineAndLights(); 673 | SetVehicleParamsEx(0, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON, VEHICLE_PARAMS_ON); 674 | GetVehicleParamsEx(0, vparams, vparams, vparams, vparams, vparams, vparams, vparams); 675 | GetVehicleParamsSirenState(0); 676 | SetVehicleParamsCarDoors(0, 0, 0, 0, 0); 677 | GetVehicleParamsCarDoors(0, ivar, ivar, ivar, ivar); 678 | SetVehicleParamsCarWindows(0, 0, 0, 0, 0); 679 | GetVehicleParamsCarWindows(0, ivar, ivar, ivar, ivar); 680 | SetVehicleToRespawn(0); 681 | LinkVehicleToInterior(0, 0); 682 | AddVehicleComponent(0, 0); 683 | RemoveVehicleComponent(0, 0); 684 | ChangeVehicleColor(0, 0, 0); 685 | ChangeVehiclePaintjob(0, 0); 686 | SetVehicleHealth(0, 0); 687 | GetVehicleHealth(0, fvar); 688 | AttachTrailerToVehicle(0, 0); 689 | DetachTrailerFromVehicle(0); 690 | IsTrailerAttachedToVehicle(0); 691 | GetVehicleTrailer(0); 692 | SetVehicleNumberPlate(0, "STRING"); 693 | GetVehicleModel(0); 694 | GetVehicleComponentInSlot(0, CARMODTYPE_FRONT_BULLBAR); 695 | GetVehicleComponentType(0); 696 | RepairVehicle(0); 697 | GetVehicleVelocity(0, fvar, fvar, fvar); 698 | SetVehicleVelocity(0, 0, 0, 0); 699 | SetVehicleAngularVelocity(0, 0, 0, 0); 700 | GetVehicleDamageStatus(0, ivar, ivar, ivar, ivar); 701 | UpdateVehicleDamageStatus(0, VEHICLE_PANEL_STATUS_NONE, VEHICLE_DOOR_STATUS_NONE, 0, 0); 702 | GetVehicleModelInfo(0, VEHICLE_MODEL_INFO_SIZE, fvar, fvar, fvar); 703 | SetVehicleVirtualWorld(0, 0); 704 | GetVehicleVirtualWorld(0); 705 | IsValidVehicle(0); 706 | DB_Open__("STRING"); 707 | DB_Close__(DB:0); 708 | DB_Query__(DB:0, "STRING"); 709 | DB_FreeResult__(DBResult:0); 710 | DB_NumRows__(DBResult:0); 711 | DB_NextRow__(DBResult:0); 712 | DB_NumFields__(DBResult:0); 713 | DB_FieldName__(DBResult:0, 0, output, _); 714 | DB_GetField__(DBResult:0, 0, output, _); 715 | DB_GetFieldInt__(DBResult:0, 0); 716 | DB_GetFieldFloat__(DBResult:0, 0); 717 | DB_GetFieldAssoc__(DBResult:0, "STRING", output, _); 718 | DB_GetFieldAssocInt__(DBResult:0, "STRING"); 719 | DB_GetFieldAssocFloat__(DBResult:0, "STRING"); 720 | DB_GetMemHandle__(DB:0); 721 | DB_GetResultMemHandle__(DBResult:0); 722 | DB_DebugOpenFiles__(); 723 | DB_DebugOpenResults__(); 724 | SetSpawnInfo(0, 0, 0, 0, 0, 0, 0, WEAPON_FIST, 0, WEAPON_FIST, 0, WEAPON_FIST, 0); 725 | SpawnPlayer(0); 726 | SetPlayerPos(0, 0, 0, 0); 727 | SetPlayerPosFindZ(0, 0, 0, 0); 728 | GetPlayerPos(0, fvar, fvar, fvar); 729 | SetPlayerFacingAngle(0, 0); 730 | GetPlayerFacingAngle(0, fvar); 731 | IsPlayerInRangeOfPoint(0, 0, 0, 0, 0); 732 | GetPlayerDistanceFromPoint(0, 0, 0, 0); 733 | IsPlayerStreamedIn(0, 0); 734 | SetPlayerInterior(0, 0); 735 | GetPlayerInterior(0); 736 | SetPlayerHealth(0, 0); 737 | GetPlayerHealth(0, fvar); 738 | SetPlayerArmour(0, 0); 739 | GetPlayerArmour(0, fvar); 740 | SetPlayerAmmo(0, WEAPON_FIST, 0); 741 | GetPlayerAmmo(0); 742 | GetPlayerWeaponState(0); 743 | GetPlayerTargetPlayer(0); 744 | GetPlayerTargetActor(0); 745 | SetPlayerTeam(0, 0); 746 | GetPlayerTeam(0); 747 | SetPlayerScore(0, 0); 748 | GetPlayerScore(0); 749 | GetPlayerDrunkLevel(0); 750 | SetPlayerDrunkLevel(0, 0); 751 | SetPlayerColor(0, 0); 752 | GetPlayerColor(0); 753 | SetPlayerSkin(0, 0); 754 | GetPlayerSkin(0); 755 | GetPlayerCustomSkin(0); 756 | GivePlayerWeapon(0, WEAPON_FIST, 0); 757 | ResetPlayerWeapons(0); 758 | SetPlayerArmedWeapon(0, WEAPON_FIST); 759 | GetPlayerWeaponData(0, WEAPON_SLOT_UNARMED, wvar, ivar); 760 | GivePlayerMoney(0, 0); 761 | ResetPlayerMoney(0); 762 | SetPlayerName(0, "STRING"); 763 | GetPlayerMoney(0); 764 | GetPlayerState(0); 765 | GetPlayerIp(0, output, _); 766 | GetPlayerPing(0); 767 | GetPlayerWeapon(0); 768 | GetPlayerKeys(0, kvar, kvar, kvar); 769 | GetPlayerName(0, output, _); 770 | SetPlayerTime(0, 0, 0); 771 | GetPlayerTime(0, ivar, ivar); 772 | TogglePlayerClock(0, false); 773 | SetPlayerWeather(0, 0); 774 | ForceClassSelection(0); 775 | SetPlayerWantedLevel(0, 0); 776 | GetPlayerWantedLevel(0); 777 | SetPlayerFightingStyle(0, FIGHT_STYLE_BOXING); 778 | GetPlayerFightingStyle(0); 779 | SetPlayerVelocity(0, 0, 0, 0); 780 | GetPlayerVelocity(0, fvar, fvar, fvar); 781 | PlayCrimeReportForPlayer(0, 0, 0); 782 | PlayAudioStreamForPlayer(0, "STRING", 0.0, 0.0, 0.0, 50.0, false); 783 | StopAudioStreamForPlayer(0); 784 | SetPlayerShopName(0, "STRING"); 785 | SetPlayerSkillLevel(0, WEAPONSKILL_SPAS12_SHOTGUN, 0); 786 | GetPlayerSurfingVehicleID(0); 787 | GetPlayerSurfingObjectID(0); 788 | RemoveBuildingForPlayer(0, 0, 0, 0, 0, 0); 789 | GetPlayerLastShotVectors(0, fvar, fvar, fvar, fvar, fvar, fvar); 790 | SetPlayerAttachedObject(0, 0, 0, 0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 0, 0); 791 | RemovePlayerAttachedObject(0, 0); 792 | IsPlayerAttachedObjectSlotUsed(0, 0); 793 | EditAttachedObject(0, 0); 794 | CreatePlayerTextDraw(0, 0, 0, "STRING"); 795 | PlayerTextDrawDestroy(0, INVALID_PLAYER_TEXT_DRAW); 796 | PlayerTextDrawLetterSize(0, INVALID_PLAYER_TEXT_DRAW, 0, 0); 797 | PlayerTextDrawTextSize(0, INVALID_PLAYER_TEXT_DRAW, 0, 0); 798 | PlayerTextDrawAlignment(0, INVALID_PLAYER_TEXT_DRAW, TEXT_DRAW_ALIGN_CENTRE); 799 | PlayerTextDrawColor(0, INVALID_PLAYER_TEXT_DRAW, 0); 800 | PlayerTextDrawUseBox(0, INVALID_PLAYER_TEXT_DRAW, false); 801 | PlayerTextDrawBoxColor(0, INVALID_PLAYER_TEXT_DRAW, 0); 802 | PlayerTextDrawSetShadow(0, INVALID_PLAYER_TEXT_DRAW, 0); 803 | PlayerTextDrawSetOutline(0, INVALID_PLAYER_TEXT_DRAW, 0); 804 | PlayerTextDrawBackgroundColor(0, INVALID_PLAYER_TEXT_DRAW, 0); 805 | PlayerTextDrawFont(0, INVALID_PLAYER_TEXT_DRAW, TEXT_DRAW_FONT_MODEL_PREVIEW); 806 | PlayerTextDrawSetProportional(0, INVALID_PLAYER_TEXT_DRAW, false); 807 | PlayerTextDrawSetSelectable(0, INVALID_PLAYER_TEXT_DRAW, false); 808 | PlayerTextDrawShow(0, INVALID_PLAYER_TEXT_DRAW); 809 | PlayerTextDrawHide(0, INVALID_PLAYER_TEXT_DRAW); 810 | PlayerTextDrawSetString(0, INVALID_PLAYER_TEXT_DRAW, "STRING"); 811 | PlayerTextDrawSetPreviewModel(0, INVALID_PLAYER_TEXT_DRAW, 0); 812 | PlayerTextDrawSetPreviewRot(0, INVALID_PLAYER_TEXT_DRAW, 0, 0, 0.0); 813 | PlayerTextDrawSetPreviewVehCol(0, INVALID_PLAYER_TEXT_DRAW, 0, 0); 814 | SetPVarInt(0, "STRING", 0); 815 | GetPVarInt(0, "STRING"); 816 | SetPVarString(0, "STRING", "STRING"); 817 | GetPVarString(0, "STRING", output, _); 818 | SetPVarFloat(0, "STRING", 0); 819 | GetPVarFloat(0, "STRING"); 820 | DeletePVar(0, "STRING"); 821 | GetPVarsUpperIndex(0); 822 | GetPVarNameAtIndex(0, 0, output, _); 823 | GetPVarType(0, "STRING"); 824 | SetPlayerChatBubble(0, "STRING", 0, 0, 0); 825 | PutPlayerInVehicle(0, 0, 0); 826 | GetPlayerVehicleID(0); 827 | GetPlayerVehicleSeat(0); 828 | RemovePlayerFromVehicle(0); 829 | TogglePlayerControllable(0, true); 830 | PlayerPlaySound(0, 0, 0, 0, 0); 831 | ApplyAnimation(0, "STRING", "STRING", 0.0, false, false, false, false, 0, SYNC_ALL); 832 | ClearAnimations(0, SYNC_NONE); 833 | GetPlayerAnimationIndex(0); 834 | GetAnimationName(0, output, _, output, _); 835 | GetPlayerSpecialAction(0); 836 | SetPlayerSpecialAction(0, SPECIAL_ACTION_STOPUSECELLPHONE); 837 | DisableRemoteVehicleCollisions(0, false); 838 | SetPlayerCheckpoint(0, 0, 0, 0, 0); 839 | DisablePlayerCheckpoint(0); 840 | SetPlayerRaceCheckpoint(0, CP_TYPE_GROUND_NORMAL, 0, 0, 0, 0, 0, 0, 0); 841 | DisablePlayerRaceCheckpoint(0); 842 | SetPlayerWorldBounds(0, 0, 0, 0, 0); 843 | SetPlayerMarkerForPlayer(0, 0, 0); 844 | ShowPlayerNameTagForPlayer(0, 0, true); 845 | SetPlayerMapIcon(0, 0, 0, 0, 0, 0, 0, MAPICON_LOCAL); 846 | RemovePlayerMapIcon(0, 0); 847 | AllowPlayerTeleport(0, false); 848 | SetPlayerCameraPos(0, 0, 0, 0); 849 | SetPlayerCameraLookAt(0, 0, 0, 0, CAMERA_CUT); 850 | SetCameraBehindPlayer(0); 851 | GetPlayerCameraPos(0, fvar, fvar, fvar); 852 | GetPlayerCameraFrontVector(0, fvar, fvar, fvar); 853 | GetPlayerCameraMode(0); 854 | EnablePlayerCameraTarget(0, true); 855 | GetPlayerCameraTargetObject(0); 856 | GetPlayerCameraTargetVehicle(0); 857 | GetPlayerCameraTargetPlayer(0); 858 | GetPlayerCameraTargetActor(0); 859 | GetPlayerCameraAspectRatio(0); 860 | GetPlayerCameraZoom(0); 861 | AttachCameraToObject(0, 0); 862 | AttachCameraToPlayerObject(0, 0); 863 | InterpolateCameraPos(0, 0, 0, 0, 0, 0, 0, 0, CAMERA_CUT); 864 | InterpolateCameraLookAt(0, 0, 0, 0, 0, 0, 0, 0, CAMERA_CUT); 865 | IsPlayerConnected(0); 866 | IsPlayerInVehicle(0, 0); 867 | IsPlayerInAnyVehicle(0); 868 | IsPlayerInCheckpoint(0); 869 | IsPlayerInRaceCheckpoint(0); 870 | SetPlayerVirtualWorld(0, 0); 871 | GetPlayerVirtualWorld(0); 872 | EnableStuntBonusForPlayer(0, false); 873 | EnableStuntBonusForAll(true); 874 | TogglePlayerSpectating(0, false); 875 | PlayerSpectatePlayer(0, 0, SPECTATE_MODE_NORMAL); 876 | PlayerSpectateVehicle(0, 0, SPECTATE_MODE_NORMAL); 877 | StartRecordingPlayerData(0, PLAYER_RECORDING_TYPE_DRIVER, "STRING"); 878 | StopRecordingPlayerData(0); 879 | SelectTextDraw(0, 0); 880 | CancelSelectTextDraw(0); 881 | CreateExplosionForPlayer(0, 0, 0, 0, 0, 0); 882 | SendClientCheck(0, 0, 0, 0, 0); 883 | CreateObject(0, 0, 0, 0, 0, 0, 0, 0.0); 884 | AttachObjectToVehicle(0, 0, 0, 0, 0, 0, 0, 0); 885 | AttachObjectToObject(0, 0, 0, 0, 0, 0, 0, 0, true); 886 | AttachObjectToPlayer(0, 0, 0, 0, 0, 0, 0, 0); 887 | SetObjectPos(0, 0, 0, 0); 888 | GetObjectPos(0, fvar, fvar, fvar); 889 | SetObjectRot(0, 0, 0, 0); 890 | GetObjectRot(0, fvar, fvar, fvar); 891 | GetObjectModel(0); 892 | SetObjectNoCameraCol(0); 893 | IsValidObject(0); 894 | DestroyObject(0); 895 | MoveObject(0, 0, 0, 0, 0, -1000.0, -1000.0, -1000.0); 896 | StopObject(0); 897 | IsObjectMoving(0); 898 | EditObject(0, 0); 899 | EditPlayerObject(0, 0); 900 | SelectObject(0); 901 | CancelEdit(0); 902 | CreatePlayerObject(0, 0, 0, 0, 0, 0, 0, 0, 0.0); 903 | AttachPlayerObjectToVehicle(0, 0, 0, 0, 0, 0, 0, 0, 0); 904 | SetPlayerObjectPos(0, 0, 0, 0, 0); 905 | GetPlayerObjectPos(0, 0, fvar, fvar, fvar); 906 | SetPlayerObjectRot(0, 0, 0, 0, 0); 907 | GetPlayerObjectRot(0, 0, fvar, fvar, fvar); 908 | GetPlayerObjectModel(0, 0); 909 | SetPlayerObjectNoCameraCol(0, 0); 910 | IsValidPlayerObject(0, 0); 911 | DestroyPlayerObject(0, 0); 912 | MovePlayerObject(0, 0, 0, 0, 0, 0, -1000.0, -1000.0, -1000.0); 913 | StopPlayerObject(0, 0); 914 | IsPlayerObjectMoving(0, 0); 915 | AttachPlayerObjectToPlayer(0, 0, 0, 0, 0, 0, 0, 0, 0); 916 | SetObjectMaterial(0, 0, 0, "STRING", "STRING", 0); 917 | SetPlayerObjectMaterial(0, 0, 0, 0, "STRING", "STRING", 0); 918 | SetObjectMaterialText(0, "STRING", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, true, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); 919 | SetPlayerObjectMaterialText(0, 0, "STRING", 0, OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, true, 0xFFFFFFFF, 0, OBJECT_MATERIAL_TEXT_ALIGN_LEFT); 920 | SetObjectsDefaultCameraCol(false); 921 | HTTP(0, HTTP_POST, "STRING", "STRING", "STRING"); 922 | CreateActor(0, 0, 0, 0, 0); 923 | DestroyActor(0); 924 | IsActorStreamedIn(0, 0); 925 | SetActorVirtualWorld(0, 0); 926 | GetActorVirtualWorld(0); 927 | ApplyActorAnimation(0, "STRING", "STRING", 0.0, false, false, false, false, 0); 928 | ClearActorAnimations(0); 929 | SetActorPos(0, 0, 0, 0); 930 | GetActorPos(0, fvar, fvar, fvar); 931 | SetActorFacingAngle(0, 0); 932 | GetActorFacingAngle(0, fvar); 933 | SetActorHealth(0, 0); 934 | GetActorHealth(0, fvar); 935 | SetActorInvulnerable(0, true); 936 | IsActorInvulnerable(0); 937 | IsValidActor(0); 938 | 939 | 940 | // API 941 | GetDefaultPlayerColour(0); 942 | GetVehicleSeats(0); 943 | VehicleCanHaveComponent(0, 0); 944 | ivar = IsValidAnimationLibrary("STRING"); 945 | GetRandomCarColPair(0, ivar, ivar); 946 | CarColIndexToColour(0); 947 | PlayerHasClockEnabled(0); 948 | IsMenuValid(INVALID_MENU); 949 | GetPlayerDialog(0); 950 | HideGameTextForAll(0); 951 | HideGameTextForPlayer(0, 0); 952 | GetPlayerWorldBounds(0, fvar, fvar, fvar, fvar); 953 | ClearPlayerWorldBounds(0); 954 | GetPlayerWeather(0); 955 | GetWeather(); 956 | ivar = GetWorldTime(); 957 | } 958 | 959 | public OnPlayerKeyStateChange(playerid, KEY:newkeys, KEY:oldkeys) 960 | { 961 | return 1; 962 | } 963 | 964 | public OnPlayerActionStateChange(playerid, ACTION:newactions, ACTION:oldactions) 965 | { 966 | return 1; 967 | } 968 | 969 | 970 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # fixes.inc 3 | 4 | ### Community patches for buggy SA:MP functions. 5 | 6 | ## Introduction 7 | 8 | SA:MP is beta software written by a small team in their spare time, thus it has bugs (as does all software). Some of these have been known for a long time but are low priority due to their minor effects, others go undiscovered for a long time. Many of these bugs have solutions which can be implemented in PAWN (and this may be simpler than implementing them in the SA:MP source code). This include aims to collect fixes for as many of these bugs as possible from the community (i.e. anyone who has a fix) together in to one easy to use place for everyone's benefit. 9 | 10 | ## Use 11 | 12 | This library is a single-file include. The only required part is: 13 | 14 | https://raw.githubusercontent.com/pawn-lang/sa-mp-fixes/master/fixes.inc 15 | 16 | Save this file as `pawno/include/fixes.inc` then include it after the default SA:MP functions, but before third party includes: 17 | 18 | ```pawn 19 | #include 20 | // Any default re-definitions should go here. 21 | //#undef MAX_PLAYERS 22 | //#define MAX_PLAYERS 10 23 | #include 24 | 25 | #include 26 | ``` 27 | 28 | To disable any fix for whatever reason simply do: 29 | 30 | ```pawn 31 | #define FIX_ 0 32 | ``` 33 | 34 | For example, to disable all the file.inc fixes if you always correctly check the file handle, do: 35 | 36 | ```pawn 37 | #include 38 | #define FIX_file_inc 0 39 | #include 40 | #include 41 | ``` 42 | 43 | All the names of the fixes are single words, and are all listed with their fix descriptions below. 44 | 45 | If you only have one script running on your server (i.e. no FilterScripts), you can use this define to improve the fixes.inc code: 46 | 47 | ```pawn 48 | #include 49 | #define FIXES_Single 1 50 | #include 51 | #include 52 | ``` 53 | 54 | See below for more configuration settings. 55 | 56 | If you use sampctl the inclusion path to go under dependencies is: 57 | 58 | ``` 59 | "pawn-lang/sa-mp-fixes" 60 | ``` 61 | 62 | You can also download the entire repo using *git*, and will get a more complete experience, including better warnings and this documentation. 63 | 64 | ## Fix Options 65 | 66 | Name | Problem | Solution | Author(s) | Post(s) | Notes 67 | ---- | ---- | ---- | ---- | ---- | ---- 68 | GetPlayerColor | Returns "0" if "SetPlayerColor" has never been called. | Call "SetPlayerColor" in "OnPlayerConnect". | KoczkaHUN | | 69 | FILTERSCRIPT | Despite the fact that is in every new script, many people dont' define "FILTERSCRIPT" where appropriate. | Provide an "IS_FILTERSCRIPT" variable (note the naming to match the original macro). | [Y_Less](https://github.com/Y-Less/) | | 70 | SpawnPlayer | Kills the player if they are in a vehicle. | Remove player from the vehicle. | [Y_Less](https://github.com/Y-Less/) | | 71 | SetPlayerName | Using "SetPlayerName" when the new name only differs from the old name in case does not alter the name at all. | Change their name twice - once to "_FIXES TEMP NAME" and then to the actual required name. | [Y_Less](https://github.com/Y-Less/) [Slice](https://github.com/oscar-broman/) [simonepri](https://github.com/simonepri/) | | 72 | GetPlayerSkin | Returns the new skin after "SetSpawnInfo" is called but before the player actually respawns to get the new skin. | Record the skin in "OnPlayerSpawn" and always return that one. | [Y_Less](https://github.com/Y-Less/) | | 73 | GetWeaponName | Returns nothing for 18, 44, and 45. | Return the correct names (`Molotov Cocktail`, `Thermal Goggles`, and `Night vision Goggles`). | [Y_Less](https://github.com/Y-Less/) | | **Fixed in 0.3.7** 74 | SetPlayerWorldBounds | Aiming can bypass the edge. | Check for the player leaving the area and reset them to their last good position if they leave the area (aiming or not). | [Y_Less](https://github.com/Y-Less/) | | 75 | TogglePlayerControllable | Other players see you moving on the spot. | Return 0 in OnPlayerUpdate. | [Slice](https://github.com/oscar-broman/) | [Link](https://sampforum.blast.hk/showthread.php?tid=184118&pid=876854#pid876854) | 76 | HydraSniper | Entering military aircraft with a sniper rifle messes up views. | Set their armed weapon to fists. | funky1234 | [Link](https://sampforum.blast.hk/showthread.php?tid=151670&pid=965644#pid965644) | 77 | IsPlayerInCheckpoint | Function returns an undefined value if it is called before any other checkpoint functions are called to initialise the value. | Call "DisablePlayerCheckpoint" when they connect. | [Y_Less](https://github.com/Y-Less/) | | 78 | IsPlayerInRaceCheckpoint | Function returns an undefined value if it is called before any other race checkpoint functions are called to initialise the value. | Call "DisablePlayerRaceCheckpoint" when they connect. | [Y_Less](https://github.com/Y-Less/) | | 79 | GetPlayerWeapon | Returns the old value after entering in a vehicle. | If "SetPlayerArmedWeapon" and other similar functions is called in a vehicle, store the new value and return that instead. | [Y_Less](https://github.com/Y-Less/) [ronixtey](https://github.com/ronixtey/) | | 80 | PutPlayerInVehicle | If this is used on a passenger the driver of their old vehicle doesn't see them in their new vehicle. | Remove them from the vehicle first. | leong124 [Y_Less](https://github.com/Y-Less/) | [Link](http://web-old.archive.org/web/20190415184628/https://forum.sa-mp.com/showpost.php?p=1265965) | 81 | KEY_AIM | "KEY_AIM" isn't defined by default. | Define it. | [Y_Less](https://github.com/Y-Less/) | | 82 | SetPlayerCheckpoint | If a checkpoint is already set it will use the size of that checkpoint instead of the new one. | Call "DisablePlayerCheckpoint" before setting the checkpoint. | [ziggi](https://github.com/ziggi/) | | 83 | SetPlayerRaceCheckpoint | If a checkpoint is already set it will use the size of that checkpoint instead of the new one. | Call "DisablePlayerRaceCheckpoint" before setting the checkpoint. | [ziggi](https://github.com/ziggi/) | | 84 | TextDrawCreate | Crashes on a blank string. | Intercept blank strings. | wups | | 85 | TextDrawCreate_2 | If the last character in the text is a space (" "), the text will all be blank. | Remove space characters from the end of the string. | [ziggi](https://github.com/ziggi/) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/55) | 86 | TextDrawSetString | Crashes on a blank string and size greater than 1024. | Intercept blank strings and truncate long strings. | TomTrox | | 87 | TextDrawSetString_2 | If the last character in the text is a space (" "), the text will all be blank. | Remove space characters from the end of the string. | [ziggi](https://github.com/ziggi/) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/55) | 88 | CreatePlayerTextDraw | Crashes on a blank string. | Intercept blank strings. | wups [Y_Less](https://github.com/Y-Less/) | | 89 | CreatePlayerTextDraw_2 | If the last character in the text is a space (" "), the text will all be blank. | Remove space characters from the end of the string. | [ziggi](https://github.com/ziggi/) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/55) | 90 | PlayerTextDrawSetString | Crashes on a blank string and size greater than 1024. | Intercept blank strings and truncate long strings. | TomTrox [Y_Less](https://github.com/Y-Less/) | | 91 | PlayerTextDrawSetString_2 | If the last character in the text is a space (" "), the text will all be blank. | Remove space characters from the end of the string. | [ziggi](https://github.com/ziggi/) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/55) | 92 | AllowInteriorWeapons | Does nothing. | Set the player's weapon to fists in an interior. | KoczkaHUN | | 93 | OnPlayerEnterVehicle | Crashes other players when people enter an invalid seat. | Desync the people with invalid seats. | RyDeR` [Y_Less](https://github.com/Y-Less/) | [Link](http://web-old.archive.org/web/20190415184630/https://forum.sa-mp.com/showpost.php?p=1410296) | 94 | OnPlayerEnterVehicle_2 | Crashes the server when hacks enter an invalid vehicle. | Desync the people with invalid vehicles. | [Y_Less](https://github.com/Y-Less/) | | 95 | OnPlayerEnterVehicle_3 | No player animation when trying to enter the driver door of a locked vehicle | Leave the door unlocked and activate an animation when the player attemps to enter a 'locked' vehicle. | [ziggi](https://github.com/ziggi) [rt-2](https://github.com/rt-2) | [Link](https://sampforum.blast.hk/showthread.php?tid=127762&pid=560019#pid560019) | 96 | AllowTeleport | 0.3dRC9 removed "AllowPlayerTeleport" and "AllowAdminTeleport" in favour of "OnPlayerClickMap". Some scripts used the old code and. | Teleport the player in "OnPlayerClickMap". | [Y_Less](https://github.com/Y-Less/) | | 97 | SetPlayerSpecialAction | Removing jetpacks from players by setting their special action to 0 causes the sound to stay until death. | Call "ClearAnimations" before "SetPlayerSpecialAction". | MP2 | | 98 | OnDialogResponse | Cheaters can spoof the dialogid they are using to respond to ones they can't actually see. | Store the displayed dialogid and use that instead. | [Y_Less](https://github.com/Y-Less/) | | **Fixed in 0.3e RC6** 99 | GetPlayerDialog | This function doesn't exist. Fixed for hidden dialogs. | Add it. | [Y_Less](https://github.com/Y-Less/) [simonepri](https://github.com/simonepri/) | | **Disabled By Default** 100 | 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". | Hide it. | [simonepri](https://github.com/simonepri/) | | 101 | SetSpawnInfo | Kicks the player if "SpawnPlayer" is called before "SetSpawnInfo". | Call "SetSpawnInfo" at least once. | [Y_Less](https://github.com/Y-Less/) | | 102 | SetPlayerSkin | Breaks sitting on bikes. | Put them back in the vehicle after setting their skin. | CyNiC | [Link](http://web-old.archive.org/web/20190415184621/https://forum.sa-mp.com/showpost.php?p=1756094) | 103 | HideMenuForPlayer | Crashes when passed an invalid menu ID. | Don't hide it when passed an invalid menu. | [Y_Less](https://github.com/Y-Less/) | [Link](https://sampforum.blast.hk/showthread.php?tid=332944&pid=1787297#pid1787297) | 104 | valstr | Crashes on large numbers. | Use "format" instead. | [Slice](https://github.com/oscar-broman/) | | 105 | fclose | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 106 | fwrite | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 107 | fread | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 108 | fputchar | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 109 | fgetchar | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 110 | fblockwrite | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 111 | fblockread | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 112 | fseek | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 113 | flength | Crashes on an invalid handle. | Check for an invalid handle. | [Slice](https://github.com/oscar-broman/) | | 114 | file_inc | Includes or excludes all the file function fixes together (can cause major overhead). | Optionally group them all under one define. | [Y_Less](https://github.com/Y-Less/) | | **Disabled By Default** 115 | SetPlayerAttachedObject | Doesn't remove objects when the mode ends. | Remove them. | [Y_Less](https://github.com/Y-Less/) | | 116 | OnPlayerDeath | Clients get stuck when they die with an animation applied. | Clear their animations. | h02 | [Link](https://sampforum.blast.hk/showthread.php?tid=312862&pid=1641144#pid1641144) | 117 | strins | Ignores the "maxlength" parameter causing possible crashes. | Manually check the length. | [Slice](https://github.com/oscar-broman/) [Y_Less](https://github.com/Y-Less) | | 118 | IsPlayerConnected | Only uses the lower two bytes of a passed ID. | Mask the numbers. | [Slice](https://github.com/oscar-broman/) | | 119 | TrainExit | When getting out of a train entered by "PutPlayerInVehicle", the camera does not reset properly. | Reset the camera. | Terminator3 [Y_Less](https://github.com/Y-Less/) | | 120 | Kick | Calling "Kick" in "OnPlayerConnect" doesn't work properly. | Defer it. | [Y_Less](https://github.com/Y-Less/) | [Link](http://web-old.archive.org/web/20190415184620/https://forum.sa-mp.com/showpost.php?p=1989453) | **Fixed in 0.3x** 121 | OnVehicleMod | Crashes other players when invalid mods are applied. | Desync the player. | [JernejL](https://github.com/JernejL/) [Y_Less](https://github.com/Y-Less/) | [Link](https://sampforum.blast.hk/showthread.php?tid=317303&pid=1671500#pid1671500) | 122 | random | Doesn't work with negative numbers. | Invert then reinvert. | [simonepri](https://github.com/simonepri/) | | **Disabled By Default** 123 | sleep | Leaks bytes from the stack. | Call a function to store the correct value. | [Y_Less](https://github.com/Y-Less/) | | 124 | AddMenuItem | Crashes when passed an invalid menu ID. | Don't hide it when passed an invalid menu. | [Y_Less](https://github.com/Y-Less/) | | 125 | SetMenuColumnHeader | Crashes when passed an invalid menu ID. | Don't hide it when passed an invalid menu. | [Y_Less](https://github.com/Y-Less/) | | 126 | ShowMenuForPlayer | Crashes when passed an invalid menu ID. | Don't hide it when passed an invalid menu. | [Y_Less](https://github.com/Y-Less/) | | 127 | HideMenuForPlayer | Crashes when passed an invalid menu ID. | Don't hide it when passed an invalid menu. | [Y_Less](https://github.com/Y-Less/) | [Link](https://sampforum.blast.hk/showthread.php?tid=332944&pid=1787297#pid1787297) | 128 | HideMenuForPlayer_2 | Ignores the "menuid" parameter. | Only hide the correct menu. | [Y_Less](https://github.com/Y-Less/) | | **Disabled By Default** 129 | DisableMenu | Crashes when passed an invalid menu ID. | Don't hide it when passed an invalid menu. | [Y_Less](https://github.com/Y-Less/) | | 130 | DisableMenuRow | Crashes when passed an invalid menu ID. | Don't hide it when passed an invalid menu. | [Y_Less](https://github.com/Y-Less/) | | 131 | Menus | All menu function fixes are included separately for major overhead. | Optionally group them all under one define. | [Y_Less](https://github.com/Y-Less/) | | 132 | GetPlayerMenu | Returns previous menu when none is displayed. | Return the correct value. | [Y_Less](https://github.com/Y-Less/) | | 133 | GetPlayerInterior | Always returns 0 for NPCs. | Return the correct value. | [Y_Less](https://github.com/Y-Less/) [simonepri](https://github.com/simonepri/) | | 134 | ClearAnimations | Use ClearAnimation while you are in a vehicle cause the player exit from it. | Apply an animation instead of clear animation. | [simonepri](https://github.com/simonepri/) | | 135 | ClearAnimations_2 | ClearAnimations doesn't do anything when the animation ends if we pass 1 for the freeze parameter in ApplyAnimation. | Apply an idle animation for stop and then use ClearAnimation. | [simonepri](https://github.com/simonepri/) | | 136 | 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. | Apply the animation to return the player in the vehicle. | [simonepri](https://github.com/simonepri/) | | 137 | 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. | Using 'ClearAnimation' to stop the player before the teleport happens. | [RogueDrifter](https://github.com/RogueDrifter/) | [Link](https://sampforum.blast.hk/showthread.php?tid=650422) | 138 | GangZoneCreate | Gang zones bug on the main map for players at certain angles relative to them. | Set a non floating value for the gang zone co-ordinate. | [simonepri](https://github.com/simonepri/) [Y_Less](https://github.com/Y-Less/) | | 139 | SPECIAL_ACTION_PISSING | "SPECIAL_ACTION_PISSING" isn't defined by default. | Define it. | [simonepri](https://github.com/simonepri/) | | 140 | IsValidVehicle | "IsValidVehicle" isn't defined by default. | Define it. | [simonepri](https://github.com/simonepri/) | | 141 | ApplyAnimation | Passing an invalid animation library in ApplyAnimation causes a client crash for streamed in players. | Block ApplyAnimation when an invalid library is passed. | [simonepri](https://github.com/simonepri/) | | 142 | ApplyAnimation_2 | First time a library is used, it does nothing. | Apply animations twice when first using a library. | [simonepri](https://github.com/simonepri/) [Lordzy](https://github.com/Lordzy/) [Y_Less](https://github.com/Y-Less/) | | 143 | ApplyActorAnimation | Passing an invalid animation library in ApplyAnimation causes a client crash for streamed in players. | Block ApplyActorAnimation when an invalid library is passed. | [simonepri](https://github.com/simonepri/) [ziggi](https://github.com/ziggi/) | | 144 | ApplyActorAnimation_2 | First time a library is used, it does nothing. | Apply animations twice when first using a library. | [simonepri](https://github.com/simonepri/) [Lordzy](https://github.com/Lordzy/) [Y_Less](https://github.com/Y-Less/) [ziggi](https://github.com/ziggi/) | | 145 | OnPlayerSpawn | San Andreas deducts $100 from players. | Reset the player's money to what it was before they died. | [Y_Less](https://github.com/Y-Less/) | | 146 | GetGravity | "GetGravity" isn't defined by default. | Define it. | [Whitetiger](https://github.com/Whitetigerswt) | [Link](http://web-old.archive.org/web/20190415184625/https://forum.sa-mp.com/showpost.php?p=1706447) | 147 | gpci | "gpci" isn't defined by default. | Define it. | [simonepri](https://github.com/simonepri/) | [Link](http://pastebin.com/VQSGpbSm) | 148 | Natives | Several natives are included by default, this enables or disables them all. Therefore this is an umbrella fix for several fixes. | Define them. | [Y_Less](https://github.com/Y-Less/) | | 149 | OnPlayerConnect | This function isn't called for players when a filterscript starts. | Call it for all connected players. | [Y_Less](https://github.com/Y-Less/) | | 150 | OnPlayerDisconnect | This function isn't called for players when a filterscript ends. | Call it for all connected players. | [Y_Less](https://github.com/Y-Less/) | | 151 | GameText | Several styles do not display for the time specified. | Recreate the styles in Text Draws and use those instead. | [Y_Less](https://github.com/Y-Less/) | | 152 | GameTextStyles | San Andreas has fixed styles for area and vehicle names, but they are not included in the GameText styles list. | Add them. | [Y_Less](https://github.com/Y-Less/) | | **Disabled By Default** 153 | HideGameText | There is no "HideGameTextForXYZ" function. | Show a single space for a game text. | [Y_Less](https://github.com/Y-Less/) | | 154 | ClearPlayerWorldBounds | There is no "ClearPlayerWorldBounds" function. | Put the world bounds back to the default. | [Y_Less](https://github.com/Y-Less/) | | 155 | GetPlayerWorldBounds | There is no "GetPlayerWorldBounds" function. | Store them and retrieve them. | [Y_Less](https://github.com/Y-Less/) | | 156 | WEAPONS | Some weapons are not defined by default. | Define it. | [ziggi](https://github.com/ziggi) | | 157 | BODYPARTS | The bodyparts to be used in OnPlayer(Take/Give)Damage are not defined by default | Define it. | [Whitetiger](https://github.com/Whitetigerswt) | | 158 | CAMERAMODES | The camera modes for GetPlayerCameraMode are not defined by default. | Define it. | [Whitetiger](https://github.com/Whitetigerswt) | [Link](https://sampforum.blast.hk/showthread.php?tid=271586&pid=1309730#pid1309730) | 159 | SetPlayerCamera | Using the camera functions directly after enabling spectator mode doesn't work. | Defer them. | [Emmet_](https://github.com/emmet-jones) | | 160 | SetPlayerTime | Using this function under "OnPlayerConnect" doesn't work. | Defer it. | [Emmet_](https://github.com/emmet-jones) | | 161 | OnPlayerRequestClass | Random blunts and bottles sometimes appear in class selection. | Call "RemoveBuildingForPlayer". | [Y_Less](https://github.com/Y-Less/) | | 162 | SetPlayerColor | If used under OnPlayerConnect, the affecting player will not see the color in the TAB menu. | Defer it. | [Emmet_](https://github.com/emmet-jones) | [Link](https://sampforum.blast.hk/showthread.php?tid=452407) | 163 | FileMaths | You can write gibberish like "File:a; ++a;". | Remove the operators. | [Y_Less](https://github.com/Y-Less/) | | 164 | GetPlayerWeaponData | Old weapons with no ammo left are still returned. | Set "weapons" to 0. | [Y_Less](https://github.com/Y-Less/) | [Link](https://sampforum.blast.hk/showthread.php?tid=567400) | 165 | strcmp | Return 0 if anyone of the string is empty. | Add a check for empty string. | [Y_Less](https://github.com/Y-Less) | | 166 | GetPVarString | Wrong symbol code for symbols with code 128 and above. | Use logical conjunction on symbol and 0xFF. | [ziggi](https://github.com/ziggi) [MuthaX](https://github.com/MuthaX) [Daniel_Cortez](https://github.com/Daniel-Cortez) | [Link](https://sampforum.blast.hk/showthread.php?tid=572724&page=2) [Link](http://pro-pawn.ru/showthread.php?13007) | 167 | GetSVarString | Wrong symbol code for symbols with code 128 and above. | Use logical conjunction on symbol and 0xFF. | [ziggi](https://github.com/ziggi) [MuthaX](https://github.com/MuthaX) [Daniel_Cortez](https://github.com/Daniel-Cortez) | [Link](https://sampforum.blast.hk/showthread.php?tid=572724&page=2) [Link](http://pro-pawn.ru/showthread.php?13007) | 168 | toupper | Not working on Linux for symbols with code 128 and above. | Recreate the function. | [ziggi](https://github.com/ziggi) | [Link](http://pro-pawn.ru/showthread.php?13466&p=72954#post72954) | 169 | tolower | Not working on Linux for symbols with code 128 and above. | Recreate the function. | [ziggi](https://github.com/ziggi) | [Link](http://pro-pawn.ru/showthread.php?13466&p=72954#post72954) | 170 | PassengerSeating | Teleporting player to passenger seat after delay. | Call ClearAnimation after some delay. | [ziggi](https://github.com/ziggi) | | 171 | GogglesSync | Visual effects show for all players. | return 0 in OnPlayerUpdate after key pressed. | [ziggi](https://github.com/ziggi) | | 172 | GetPlayerPoolSize | Returns "0" even if there are no players on the server. | Return "-1" if PlayerPoolsize is 0 but Player 0 is not connected. | [Bios-Marcel](https://github.com/Bios-Marcel) | | 173 | SetPlayerPos | Using this function on skydiving players kills them. | Remove the parachute when the player is skydiving. | [Freaksken](https://github.com/WoutProvost) | | 174 | GetPlayerAmmo | Returns erroneous values over 32767 and under -32768 due to overflow. | Prevent setting or adding ammo above 32767 and setting or removing ammo below 0. | [Freaksken](https://github.com/WoutProvost) | | 175 | JIT | Can't easily determine if the script is JIT compiled. | Provide "IS_JIT" to the script for tests. | [Y_Less](https://github.com/Y-Less) | | 176 | OS | Can't easily determine what OS the script is running on. | Provide "IS_WINDOWS" and "IS_LINUX" to the script for tests. | [Y_Less](https://github.com/Y-Less) | | 177 | const | Some SA-MP natives don't use "const" when they could. | Redefine the natives. | [Y_Less](https://github.com/Y-Less) | | 178 | VEHICLES | The vehicle models IDs are not defined by default. | Define them. | [stuntman](https://github.com/IstuntmanI) | | 179 | GetPlayerWeather | This function doesn't exist. | Add it. | [IstuntmanI](https://github.com/IstuntmanI/) [ziggi](https://github.com/ziggi/) | | **Disabled By Default** 180 | GetWeather | This function doesn't exist. | Add it. | [IstuntmanI](https://github.com/IstuntmanI/) [ziggi](https://github.com/ziggi/) | | **Disabled By Default** 181 | GetWorldTime | This function doesn't exist. | Add it. | [ziggi](https://github.com/ziggi/) | | **Disabled By Default** 182 | GetServerVarAsString | Crashes on unknown string variables. | Read the file manually. | [Y_Less](https://github.com/Y-Less) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/73) | 183 | GetServerVarAsInt | Crashes on unknown int variables. | Read the file manually. | [Y_Less](https://github.com/Y-Less) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/73) | 184 | GetServerVarAsBool | Crashes on unknown boolean variables. | Read the file manually. | [Y_Less](https://github.com/Y-Less) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/73) | 185 | GetServerVarAsFloat | Doesn't even exist. | Read the file manually. | [Y_Less](https://github.com/Y-Less) | [Link](https://github.com/Open-GTO/sa-mp-fixes/issues/73) | 186 | tabsize | Some people still use `tabsize 0`. | Break the pragma. | [Y_Less](https://github.com/Y-Less) | [Link](http://forum.sa-mp.com/showpost.php?p=3929000) | 187 | OnRconCommand | Is not called in the gamemode unless first called in a filterscript. | Load a minimal (embedded) FS to bootstrap it. | [Y_Less](https://github.com/Y-Less) | | 188 | OnClientCheckResponse | Is not called in the gamemode ever. | Load a minimal (embedded) FS to bootstrap it. | [Y_Less](https://github.com/Y-Less) | | 189 | GetMaxPlayers | If this is > MAX_PLAYERS, can cause OOBs in code. | Constrain it; but also warn because that doesn't really help. | [Y_Less](https://github.com/Y-Less) | | 190 | BypassDialog | You can type commands and move while in dialogs. | Return 0. | [Y_Less](https://github.com/Y-Less) | | 191 | SetTimer | Valid timers can return ID 0. | Recreate them and kill the original. | [Y_Less](https://github.com/Y-Less) | | 192 | main | Gamemodes without this function give a console error. | Make a stub version. | [Y_Less](https://github.com/Y-Less) | | 193 | OnVehicleSpawn | Colour `-1` isn't synced. | Manually control the colours. | [Y_Less](https://github.com/Y-Less) | | 194 | AttachTrailerToVehicle | When trailerid is equal to vehicleid and passenger is in vehicleid, it starts spinning. | Check if trailerid and vehicleid are equal. | [Mergevos](https://github.com/Mergevos) | | 195 | 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. | Hook functions and store components. This uses some code from vSync library. | [Mergevos](https://github.com/Mergevos) | | 196 | 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. | Expose the data, behind a tightly controlled API. | [Y_Less](https://github.com/Y-Less) | | 197 | floatfract | Incorrect on negative numbers. | Use floatround and subtraction. | [MuthaX](https://github.com/MuthaX) | [Link](https://github.com/pawn-lang/sa-mp-fixes/issues/150) | 198 | strfind | The function is prone to OOB access when the search start index is negative. | Clamp it to 0. | [Daniel-Cortez](https://github.com/Daniel-Cortez) | [Link](https://github.com/pawn-lang/sa-mp-fixes/issues/91) | 199 | strdel | The function is prone to OOB access when the index of the first character to remove is negative. | Clamp it to 0. | [Daniel-Cortez](https://github.com/Daniel-Cortez) | [Link](https://github.com/pawn-lang/sa-mp-fixes/issues/91) | 200 | CallLocalFunction | Isn't defined in NPC modes. | Write a pawn version using `funcidx`. | [Y_Less](https://github.com/Y-Less) | | 201 | deconst | Un-const-correct - uses `const` but shouldn't. | Redefine it without, plus a `len` default. | [Y_Less](https://github.com/Y-Less) | | 202 | Streamer_RemoveIntData | Int data functions expect more parameters than they specify. | Pass a hidden fake one if the version is right. | [Y_Less](https://github.com/Y-Less) | [Link](https://github.com/samp-incognito/samp-streamer-plugin/pull/380) | 203 | Streamer_HasIntData | Int data functions expect more parameters than they specify. | Pass a hidden fake one if the version is right. | [Y_Less](https://github.com/Y-Less) | [Link](https://github.com/samp-incognito/samp-streamer-plugin/pull/380) | 204 | default | Many functions are missing default values for string lengths. | Add them. | [Y_Less](https://github.com/Y-Less) | | 205 | limit_tags | Some limits, like `MAX_MENUS` are untagged, so can't be used properly. | Redefine them with the tags added. | [Y_Less](https://github.com/Y-Less) | | 206 | bool_tags | Many `true/false` parameters use `1/0` with no `bool:` tag. | Add the tag. | [Y_Less](https://github.com/Y-Less) | | 207 | TEXT_DRAW_ALIGN | The alignment modes for `TextDrawAlignment` are not defined by default. | Define them. | [Y_Less](https://github.com/Y-Less) | | 208 | TEXT_DRAW_FONT | The fonts for `TextDrawFont` are not defined by default. | Define them. | [Y_Less](https://github.com/Y-Less) | | 209 | 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. | Rename the functions to use `Action` instead of `Key` and deprecate the old ones. | [Y_Less](https://github.com/Y-Less) | | 210 | FORCE_SYNC | The sync modes for `ApplyAnimation` are not defined by default. | Define them. | [Y_Less](https://github.com/Y-Less) | | 211 | 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`). | While we can't stop all the bad address writes there are two things we can do. Enable the anonymous automata, which is always at address naught, and never use it so that bad writes don't break something else, and enable address naught write detection in crashdetect. Note that this will have to be disabled if you use the anonymous automata. | [Y_Less](https://github.com/Y-Less) | | 212 | main2 | `main` isn't called in filterscripts. | Call it. | [Y_Less](https://github.com/Y-Less) | | 213 | npcmodes | There's no way to specify NPC modes in `server.cfg`. | Read `npcmodes` from the file ONCE and load them automatically. | [Y_Less](https://github.com/Y-Less) | | 214 | fgetchar2 | Has an extra `value` parameter. | Remove it. | [Y_Less](https://github.com/Y-Less) | | 215 | 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`. | Copy two cells with an offset to a temporary buffer, copy the rest of the data to the next cell in the destination, then save the high cell of the temporary storage. | [Y_Less](https://github.com/Y-Less) | | 216 | ispacked | Returns false when the string is packed and starts with a symbol with code 128 and above. | [Daniel_Cortez](https://github.com/Daniel-Cortez), [VVWVV](https://github.com/VVWVV) | | 217 | SHA256 | Is not good for using for passwords. | Deprecate it. | [Y_Less](https://github.com/Y-Less) | | 218 | 219 | A few fixes are disabled by default, to enable them all do: 220 | 221 | ```pawn 222 | #define FIX_GetPlayerDialog 1 223 | #define FIX_file_inc 1 224 | #define FIX_random 1 225 | #define FIX_HideMenuForPlayer_2 1 226 | #define FIX_GameTextStyles 1 227 | #define FIX_GetPlayerWeather 1 228 | #define FIX_GetWeather 1 229 | #define FIX_GetWorldTime 1 230 | ``` 231 | 232 | ## Settings 233 | 234 | There are a few settings for improved execution of this script. Define these symbols as `1` before you include fixes.inc to explicitly enable them, `0` to explicitly disable them. 235 | 236 | * `FIXES_ExplicitSettings`: Require settings to be explicitly enabled or disabled, and show a warning for every setting not mentioned. Default `0` for now. 237 | * `FIXES_EnableAll`: Enable everything, even things that probably shouldn't be enabled. Default `0`. 238 | * `FIXES_EnableDeprecated`: Enable all deprecated fixes (those that are no longer needed because they were fixed in later server revisions). Might causes errors and conflicts with newer SA:MP includes. Default `0`. 239 | * `FIXES_DefaultDisabled`: Disable all fixes by default, and require them to be individually enabled with `#define FIX_ 1` Default `0`. 240 | * `FIXES_ExplicitOptions`: Require fixes to be explicitly enabled or disabled, and show a warning for every fix not mentioned. Useful in combination with `FIXES_DefaultDisabled`, so default `1` with that, `0` otherwise. 241 | * `FIXES_SilentKick`: If this define is set to `1`, then players will not be given a message when they are kicked for cheats (mainly invalid vehicles and mods), instead they will just loose connection to the server. Default `0`. 242 | * `FIXES_Debug`: If this define is set to `1`, then debug printing is turned on for any functions which may use it. Otherwise, the compiler entirely removes the code to print anything, leaving no run-time overhead. Default `0`. 243 | * `FIXES_Single`: If this define is set to 1, then the old style include is used, with no support for multiple scripts running at the same time on the server. You only have one script that uses *fixes.inc* running (no other gamemodes or filterscripts). Using this define will vastly simplify the code in that case, as no cross-script communication is required, but will cause bugs if there actually is another script running. Default `1`. 244 | * `FIXES_NoSingleMsg`: Hide a message at mode start if `FIXES_Single` is set, but this is NOT the only script running *fixes.inc*. This will entirely disable the check, so should only be used if you are absolutely certain that no other scripts are running at the same time (gamemodes or filterscripts). Default `1`. 245 | * `FIXES_NoServerVarMsg`: If this define is set to `1`, then the server will not give a message when `GetServerVarAsString` and related functions are used without a valid directory redirect. Default `1`. 246 | * `FIXES_NoGetMaxPlayersMsg`: If this define is set to 1, then the server will not give a message when `GetMaxPlayers` doesn't match `MAX_PLAYERS`. Default `1`. 247 | * `FIXES_NoPawndoc`: If this define is set to `1`, then compiling with `-r` will attempt to hide as many of the functions and variables in fixes.inc from the output XML as possible. This will vastly simplify the generated documentation (at least the visible parts, this is done by embeddeding XML comments in the output, so all the data still exists, just hidden in the file). Default `0`. 248 | * `FIXES_CorrectInvalidTimerID`: You know that an invalid timer is ID `0`, not `-1`, so exclude the excess code designed to warn about/detect people using `-1`. Default `0`. 249 | * `FIXES_NoYSI`: fixes.inc doesn't need YSI. YSI doesn't need fixes.inc. However, they are both written to be aware of each other and adapt accordingly. For example, fixes.inc uses a special type of ALS hooking which y_hooks can detect and use to call these callbacks in a better order (so-called "pre-hooks"). But if you don't have y_hooks the other version of ALS is very fractionally better. This define can thus be used to guarantee to fixes.inc that YSI doesn't exist and not to use any of the adapted code. However, if you're wrong the include probably just won't work, the overhead when not using YSI is absolutely tiny, and when using YSI its optimised out. So, if in doubt - don't use this. Default `0`. 250 | * `FIXES_OneRandomVehicleColour`: Most vehicles are created with two explicit colours (say `5, 6`) or two random colours (`-1, -1`). It is allowed, but rare, to create a vehicle with one random colour and one fixed colour (`-1, 5`, `9, -1` etc). fixes.inc supports this, but it takes a lot more code to fix than the common case of all or nothing. Thus, having only one random colour is only supported with this explicit setting enabled. Default `0`. 251 | * `FIXES_NoVehicleColourMsg`: Hide a message at vehicle creation if `FIXES_OneRandomVehicleColour` is set, but a vehicle is created with only one random colour. Default `0`. 252 | * `FIXES_CountFilterscripts`: Load several filterscripts until one fails, to determine the number of previously loaded filterscripts. Default `1`. 253 | * `FIXES_NoFilterscriptsMsg`: Hide the message about loading filterscripts and the ignorable errors. Default `0`. 254 | 255 | Note that `options` are which fixes to include, and `settings` are more over-arching customisations. 256 | 257 | ## Tags 258 | 259 | Like the enhanced SA:MP includes (https://github.com/pawn-lang/samp-stdlib/tree/consistency-overhaul) 260 | fixes.inc upgrades many natives and callbacks to use more tags for better compile-time errors. 261 | These can be a little annoying to adapt your code to at first, but in the long run provide far more 262 | safety and information. Like the SA:MP includes there are `WEAK_TAGS` and `STRONG_TAGS`, but unlike 263 | there the default is none, i.e. most tags will simply be `_:` unless you're using the consistency 264 | overhaul includes as well. The one major exception to this is `bool:`, which has been added by 265 | default to many parameters which were previously `_:` but only accepted `0`/`1` and thus should have 266 | been `false`/`true`. This is the `bool_tags` fix and affects the following natives: 267 | 268 | * `native SetTimer(const functionName[], interval, bool:repeating);` 269 | * `native SetTimerEx(const functionName[], interval, bool:repeating, const format[] = "", {Float, _}:...);` 270 | * `native AddStaticVehicleEx(modelid, Float:spawnX, Float:spawnY, Float:spawnZ, Float:angle, colour1, colour2, respawnDelay, bool:addSiren = false);` 271 | * `native ShowNameTags(bool:show);` 272 | * `native EnableTirePopping(bool:enable);` 273 | * `native AllowInteriorWeapons(bool:allow);` 274 | * `native AllowAdminTeleport(bool:allow);` 275 | * `native EnableZoneNames(bool:enable);` 276 | * `native bool:IsPlayerNPC(playerid);` 277 | * `native bool:IsPlayerAdmin(playerid);` 278 | * `native bool:GetServerVarAsBool(const cvar[]);` 279 | * `native bool:GetConsoleVarAsBool(const cvar[]);` 280 | * `native bool:IsValidMenu(Menu:menuid);` 281 | * `native TextDrawUseBox(Text:text, bool:use);` 282 | * `native TextDrawSetProportional(Text:text, bool:set);` 283 | * `native TextDrawSetSelectable(Text:text, bool:set);` 284 | * `native Text3D:Create3DTextLabel(const text[], colour, Float:x, Float:y, Float:z, Float:drawDistance, virtualWorld, bool:testLOS = false);` 285 | * `native PlayerText3D:CreatePlayer3DTextLabel(playerid, const text[], colour, Float:x, Float:y, Float:z, Float:drawDistance, parentPlayerid = INVALID_PLAYER_ID, parentVehicleid = INVALID_VEHICLE_ID, bool:testLOS = false);` 286 | * `native CreateVehicle(modelid, Float:x, Float:y, Float:z, Float:rotation, colour1, colour2, respawnDelay, bool:addSiren = false);` 287 | * `native bool:IsVehicleStreamedIn(vehicleid, playerid);` 288 | * `native bool:IsTrailerAttachedToVehicle(vehicleid);` 289 | * `native bool:IsValidVehicle(vehicleid);` 290 | * `native bool:DB_Close(DB:db);` 291 | * `native bool:DB_FreeResult(DBResult:result);` 292 | * `native bool:DB_NextRow(DBResult:result);` 293 | * `native bool:DB_FieldName(DBResult:result, field, output[], size = sizeof (output));` 294 | * `native bool:DB_GetField(DBResult:result, field, output[], size = sizeof (output));` 295 | * `native bool:DB_GetFieldAssoc(DBResult:result, const field[], output[], size = sizeof (output));` 296 | * `native bool:IsActorStreamedIn(actorid, playerid);` 297 | * `native ApplyActorAnimation(actorid, const animationLibrary[], const animationName[], Float:delta, bool:loop, bool:lockX, bool:lockY, bool:freeze, time);` 298 | * `native SetActorInvulnerable(actorid, bool:invulnerable = true);` 299 | * `native bool:IsActorInvulnerable(actorid);` 300 | * `native bool:IsValidActor(actorid);` 301 | * `native AttachObjectToObject(objectid, parentid, Float:offsetX, Float:offsetY, Float:offsetZ, Float:rotX, Float:rotY, Float:rotZ, bool:syncRotation = true);` 302 | * `native bool:IsValidObject(objectid);` 303 | * `native bool:IsObjectMoving(objectid);` 304 | * `native bool:IsValidPlayerObject(playerid, objectid);` 305 | * `native bool:IsPlayerObjectMoving(playerid, objectid);` 306 | * `native SetObjectMaterialText(objectid, const text[], materialIndex = 0, OBJECT_MATERIAL_SIZE:materialSize = OBJECT_MATERIAL_SIZE_256x128, const fontFace[] = "Arial", fontSize = 24, bool:bold = true, fontColour = 0xFFFFFFFF, backgroundColour = 0, OBJECT_MATERIAL_TEXT_ALIGN:textalignment = OBJECT_MATERIAL_TEXT_ALIGN_LEFT);` 307 | * `native SetPlayerObjectMaterialText(playerid, objectid, const text[], materialIndex = 0, OBJECT_MATERIAL_SIZE:materialSize = OBJECT_MATERIAL_SIZE_256x128, const fontFace[] = "Arial", fontSize = 24, bool:bold = true, fontColour = 0xFFFFFFFF, backgroundColour = 0, OBJECT_MATERIAL_TEXT_ALIGN:textalignment = OBJECT_MATERIAL_TEXT_ALIGN_LEFT);` 308 | * `native SetObjectsDefaultCameraCol(bool:disable);` 309 | * `native bool:IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z);` 310 | * `native bool:IsPlayerStreamedIn(targetid, playerid);` 311 | * `native TogglePlayerClock(playerid, bool:toggle);` 312 | * `native PlayAudioStreamForPlayer(playerid, const url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, bool:usepos = false);` 313 | * `native bool:IsPlayerAttachedSlotUsed(playerid, index);` 314 | * `native PlayerTextDrawUseBox(playerid, PlayerText:text, bool:use);` 315 | * `native PlayerTextDrawSetProportional(playerid, PlayerText:text, bool:set);` 316 | * `native PlayerTextDrawSetSelectable(playerid, PlayerText:text, bool:set);` 317 | * `native TogglePlayerControllable(playerid, bool:toggle);` 318 | * `native ApplyAnimation(playerid, const animationLibrary[], const animationName[], Float:delta, bool:loop, bool:lockX, bool:lockY, bool:freeze, time, FORCE_SYNC:forceSync = _FIXES_FORCE_SYNC_NONE);` 319 | * `native DisableRemoteVehCollisions(playerid, bool:disable);` 320 | * `native ShowPlayerNameTagForPlayer(playerid, targetid, bool:show);` 321 | * `native AllowPlayerTeleport(playerid, bool:allow);` 322 | * `native EnablePlayerCameraTarget(playerid, bool:enable);` 323 | * `native bool:IsPlayerConnected(playerid);` 324 | * `native bool:IsPlayerInVehicle(playerid, vehicleid);` 325 | * `native bool:IsPlayerInAnyVehicle(playerid);` 326 | * `native bool:IsPlayerInCheckpoint(playerid);` 327 | * `native bool:IsPlayerInRaceCheckpoint(playerid);` 328 | * `native EnableStuntBonusForPlayer(playerid, bool:enable);` 329 | * `native EnableStuntBonusForAll(bool:enable);` 330 | * `native TogglePlayerSpectating(playerid, bool:toggle);` 331 | 332 | You can also see several additional tags in those definitions, such as `OBJECT_MATERIAL_SIZE:` but 333 | as stated they are optional. 334 | 335 | If you are using `WEAK_TAGS` or `STRONG_TAGS` there is a minor problem - callbacks give an error: 336 | 337 | ```pawn 338 | forward OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate); 339 | 340 | public OnPlayerStateChange(playerid, newstate, oldstate) 341 | { 342 | } 343 | ``` 344 | 345 | This gives an error, when it should be fine. Fixing it in a mode is easy - just use the correct 346 | tags on the variables in the callbacks. Fixing it in a generic library needs a few extra lines to 347 | define a default tag when one isn't found (i.e. the user isn't using the improved includes): 348 | 349 | ```pawn 350 | #if !defined PLAYER_STATE 351 | // Use the default tag (none, `_:`) when the improved includes aren't found. 352 | #define PLAYER_STATE: _: 353 | #endif 354 | public OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate) 355 | { 356 | return Hooked_OnPlayerStateChange(playerid, newstate, oldstate); 357 | } 358 | 359 | // Don't forget to use ALS as normal. 360 | forward Hooked_OnPlayerStateChange(playerid, PLAYER_STATE:newstate, PLAYER_STATE:oldstate); 361 | ``` 362 | 363 | ## Keys And Actions 364 | 365 | "Keys" have been renamed "Actions" because they aren't keys and the name constantly confused 366 | everyone. You can't detect "F" you can only detect "JUMP". You can't make any assumptions about 367 | which keys are bound to which actions. You can't ask players to press a specific key (except when 368 | using `"~k~"` in strings, which maps actions back to keys). You can't detect specific keys. No 369 | matter how many times this is explained the follow-up questions are invariably, "OK, but how do I 370 | detect this key?" You can't, and never could. Thus `GetPlayerKeys` has been replaced by 371 | `GetPlayerActions`, `OnPlayerKeyStateChange` has been replaced by `OnPlayerActionStateChange`, 372 | `newkeys` and `oldkeys` have been replaced by `newactions` and `oldactions`, and `KEY` has been 373 | replaced by `ACTION` (leading to the interestingly named macro `ACTION_ACTION` from `KEY_ACTION`): 374 | 375 | ```pawn 376 | // The `ACTION` tags are optional. 377 | public OnPlayerActionStateChange(playerid, ACTION:newactions, ACTION:oldactions) 378 | { 379 | new 380 | ACTION:actions, 381 | ACTION:updown, 382 | ACTION:leftright; 383 | GetPlayerActions(playerid, actions, updown, leftright); 384 | return 1; 385 | } 386 | ``` 387 | 388 | ## API 389 | 390 | fixes.inc includes a lot of data and processing that is required for it to function, but could be 391 | useful for other scripts - things like vehicle meta-data, current status of players, and more. 392 | While new functions are not the primary goal of this include, it seems silly to keep this 393 | information hidden when it can be used, forcing people to duplicate functionality just to do things 394 | like get a player's current dialog ID for example. The general rule is still not to add new 395 | functions, there are many other libraries for that; but if the data already exists thanks to the 396 | code being required for a fix, then it might as well be exposed. 397 | 398 | Most of these additional functions are controlled by `FIX_API`, and can be tested for with 399 | `FIXES_API`, but some older ones have their own `FIX_` definition (which now defaults to `FIX_API`). 400 | 401 | ### `GetDefaultPlayerColour(playerid)` 402 | 403 | Gets the default colour assigned to a player when they first connect. There are only 100 unique 404 | colours, which are repeated: 405 | 406 | ```pawn 407 | new colour = GetDefaultPlayerColour(playerid); 408 | printf("The player's colour is %x", colour); 409 | ``` 410 | 411 | Note that you can also use the alias `GetDefaultPlayerColor`. 412 | 413 | ### `GetVehicleSeats(modelid)` 414 | 415 | Get the number of seats in the given vehicle type (model). 416 | 417 | ```pawn 418 | new seats = GetVehicleSeats(400); 419 | printf("The landstalker has %d seats", seats); 420 | ``` 421 | 422 | ### `bool:VehicleCanHaveComponent(modelid, componentid)` 423 | 424 | Returns true if the given vehicle type (model) can use the given component (mod) type. 425 | 426 | ```pawn 427 | if (VehicleCanHaveComponent(536, 1005)) 428 | { 429 | printf("The Blade can have the fury scoop"); 430 | } 431 | else 432 | { 433 | printf("The Blade cannot have the fury scoop"); 434 | } 435 | ``` 436 | 437 | ### `bool:IsValidAnimationLibrary(const snimlib[])` 438 | 439 | Returns true if the named animation library exists. 440 | 441 | ```pawn 442 | if (IsValidAnimationLibrary("parkour") 443 | { 444 | printf("`parkour` is a valid animation library"); 445 | } 446 | else 447 | { 448 | printf("`parkour` is not a valid animation library"); 449 | } 450 | ``` 451 | 452 | ### `bool:GetRandomCarColPair(modelid, &colour1, &colour2, &colour3 = 0, &colour4 = 0)` 453 | 454 | Gets a random pair of colours for a vehicle (three vehicles have four colours), according to the 455 | predefined colour options in carcols.dat. These are the colours selected from when `-1` is used as 456 | the colour of a vehicle (but the colours chosen are not synced by default). 457 | 458 | ```pawn 459 | new c1, c2; 460 | GetRandomCarColPair(495, c1, c2); 461 | printf("Colours chosen for the Sandking: %d, %d", c1, c2); 462 | ``` 463 | 464 | Note that the values returned are the COLOUR INDEXES, those passed to say `CreateVehicle`, they are 465 | not the HEX codes for the given colours. 466 | 467 | ### `GetPlayerDialog(playerid)` 468 | 469 | Get's the currently displayed dialog ID for a player. 470 | 471 | ```pawn 472 | new dialogid = GetPlayerDialog(playerid); 473 | printf("Player %d is viewing dialog %d", playerid, dialogid); 474 | ``` 475 | 476 | ### `GetPlayerWeather(playerid)` 477 | 478 | Get's the current weather ID for a player. 479 | 480 | ```pawn 481 | new weatherid = GetPlayerWeather(playerid); 482 | printf("Player %d currently has weather %d", playerid, weatherid); 483 | ``` 484 | 485 | ### `GetWeather()` 486 | 487 | Get's the current server global weather. 488 | 489 | ```pawn 490 | new weatherid = GetWeather(); 491 | printf("The server currently has weather %d", weatherid); 492 | ``` 493 | 494 | ### `GetWorldTime()` 495 | 496 | Get's the current server global weather. 497 | 498 | ```pawn 499 | new time = GetWorldTime(); 500 | printf("The time on the server is currently %02d:00", time); 501 | ``` 502 | 503 | ### `ClearPlayerWorldBounds(playerid)` 504 | 505 | Resets the world boundaries to their maximum, after using `SetPlayerWorldBounds`. 506 | 507 | ```pawn 508 | ClearPlayerWorldBounds(playerid); 509 | ``` 510 | 511 | ### `GetPlayerWorldBounds(playerid, &Float:x_max, &Float:x_min, &Float:y_max, &Float:y_min)` 512 | 513 | Gets the world boundaries for a player, set by `SetPlayerWorldBounds`. 514 | 515 | ```pawn 516 | new 517 | Float:x_max, 518 | Float:x_min, 519 | Float:y_max, 520 | Float:y_min; 521 | GetPlayerWorldBounds(playerid, x_max, x_min, y_max, y_min); 522 | printf("Player %d's world boundaries are at (%.2f, %.2f) - (%.2f, %.2f)", x_min, y_min, x_max, y_max); 523 | ``` 524 | 525 | ### `HideGameTextForAll(style)` 526 | 527 | Hide this type of gametext for all players. 528 | 529 | ```pawn 530 | HideGameTextForAll(3); 531 | ``` 532 | 533 | ### `HideGameTextForPlayer(playerid, style)` 534 | 535 | Hide this type of gametext for one player. 536 | 537 | ```pawn 538 | HideGameTextForPlayer(playerid, 3); 539 | ``` 540 | 541 | ### `bool:PlayerHasClockEnabled(playerid)` 542 | 543 | Does this player have auto-incrementing time enabled? 544 | 545 | ```pawn 546 | if (PlayerHasClockEnabled(playerid)) 547 | { 548 | printf("Time might have changed."); 549 | } 550 | ``` 551 | 552 | ### `bool:IsMenuValid(Menu:menuid)` 553 | 554 | Is the given menu ID valid? 555 | 556 | ```pawn 557 | if (IsMenuValid(menuid)) 558 | { 559 | printf("The menu was created at some point."); 560 | } 561 | ``` 562 | 563 | ### `CarColIndexToColour(index, alpha = 0xFF)` 564 | 565 | Convert from a vehicle colour index to an RGBA colour (with the specified alpha). 566 | 567 | ```pawn 568 | new c1, c2; 569 | GetRandomCarColPair(495, c1, c2); 570 | printf("Colours chosen for the Sandking: %08x, %08x", CarColIndexToColour(c1), CarColIndexToColour(c2)); 571 | ``` 572 | 573 | Note that you can also use the alias `CarColIndexToColor`. 574 | 575 | ## Tests 576 | 577 | Other code and includes can test for certain fixes.inc symbols, to see what is defined and what isn't. These all use basic `#if defined` checks, with no need to test the value: 578 | 579 | * `FIXES_EXISTS`: The include is used. 580 | * `FIXES_API`: The additional API functions (see above) were defined and can be used. 581 | * `FIXES_USES_STATE_HOOKS`: fixes.inc uses advanced state-based ALS hooks, not just regular ones. 582 | * `FIXES_CONST_CORRECT`: The include is fully const-correct (and backwards-compatible). 583 | * `FIXES_TAG_CORRECT`: The include is fully tag-correct (and backwards-compatible), i.e. optionally uses additional tags in callbacks such as `OnPlayerStateChange`. 584 | * `FIXES_PAWNDOC`: The include has methods of hiding unwanted pawndoc declarations. 585 | * `FIXES_ID`: The include defines the pubic variable `@_`, which is a unique ID for the current script. This is also defined by YSI if it isn't defined here. 586 | 587 | ## Other Fixes 588 | 589 | There are a few other includes which aim to fix issues too large to be included here: 590 | 591 | * [Timerfix](https://sampforum.blast.hk/showthread.php?tid=435525) - [udan11 (Dan..)](https://github.com/udan11) 's fixes to make "SetTimer" and "SetTimerEx" vastly more accurate in their delays. 592 | * [SQLitei](https://sampforum.blast.hk/showthread.php?tid=303682) - [Slice](https://github.com/oscar-broman/) 's fixes and improvements for many SQLite functions. 593 | 594 | ## New Features 595 | 596 | fixes.inc is not intended to add new features; however, it does add a few and detractors think it is funny to point to those as a good reason why the library is bad. The reason why is simple - they were added before the exact scope and definition of "fix" was determined. New features are not added any more, but existing features that were already added (most notably the new game text styles) are left in because removing them is more breaking than having them. Yes, they exist; no, they probably shouldn't; no, they wouldn't be added today; no, they won't be removed. 597 | 598 | ## Bugs 599 | 600 | Originally Posted by [Y_Less](https://github.com/Y-Less/) : 601 | 602 | **[This] is beta software written by a small team in their spare time, thus it has bugs (as does all software). This software is explicitly designed to solve bugs, not cause them, but there may still be bugs.** 603 | 604 | The most likely cause of bugs is certain combinations of disabled fixes. Some fixes are inter-mixed and while they SHOULD work when the fixes they are combined with are disabled, not every combination has been tested. There are literally billions of possible combinations - if you find one that doesn't compile or work, please tell us. 605 | 606 | ## Expansion 607 | 608 | The file is fairly well documented, with a list of the currently (hopefully) fixed bugs at the top. If you know of others, or have solutions for others, it would be greatly appreciated if you could post them as issues on this repository. The fixes also need extensive testing to find bugs in the fixes themselves. 609 | 610 | Again, this is a community project, merely managed by Y_Less and others - if anyone has comments, contributions, criticisms etc. please again post them as issues on the repository. This includes additions to source code, documentation, presentation, translations (mainly of this documentation - multiple versions of the include should be avoided to reduce fragmentation), or any other related area you can think of. 611 | 612 | ## Style Rules 613 | 614 | * All globals should be `static stock` whenever possible (so they can only be accessed from this one file). 615 | * Statics must start with `FIXES_gs`, and all other globals with `FIXES_g`. 616 | * All functions not overriding existing functions must start with `FIXES_`. 617 | * Macros must be upper case, use underscores, and start `FIXES_`: `FIXES_LIKE_THIS`. 618 | * Functions should be upper camel case (as the original functions are) `FIXES_LikeThis`. 619 | * Globals (after the prefix) should be upper camel case `LikeThis`, and locals lower camel case `likeThis`. 620 | * ALS should be used to hook functions and callbacks. See this topic for more details: https://sampforum.blast.hk/showthread.php?tid=570910 621 | * The ALS prefix for chaining is `FIXES_`. 622 | * When redefining a native, add a `BAD_` external name declaration with the `_ALS_` definition so that others may use the original native if they so desire (with the caveat that it may break all fixes). Note the `BAD_` name is meant to indicate the possibility of breaking the fix, not a comment on the original native function. 623 | * The ALS hook defines used here are a little different to the normal ones as this file assumes that it is always first. The pattern is: 624 | 625 | ```pawn 626 | /** 627 | * Information about fix here 628 | * NameOfFixHere 629 | */ 630 | 631 | // No other ALS hook of this function much exist before here. 632 | #if _FIXES_SAMP && defined _ALS_NameOfFixHere 633 | #error _ALS_NameOfFixHere defined 634 | #endif 635 | native BAD_NameOfFixHere(params) = NameOfFixHere; 636 | 637 | /** 638 | * Information about fix here 639 | * NameOfFixHere 640 | */ 641 | 642 | #if FIX_NameOfFixHere 643 | stock FIXES_NameOfFixHere(params) 644 | { 645 | return 0; 646 | } 647 | 648 | // The trailing `(` is VERY important to keep future `native X() = Y;`s working. 649 | #if _FIXES_SAMP 650 | #define _ALS_NameOfFixHere 651 | #define NameOfFixHere( FIXES_NameOfFixHere( 652 | #endif 653 | 654 | // This is not normal ALS, because fixes.inc must come first. 655 | #define _ALS_NameOfFixHere__ 656 | #define NameOfFixHere__( FIXES_NameOfFixHere( 657 | #endif 658 | ``` 659 | 660 | A copyable version of this pattern is at the end of the file. 661 | * Enums start with `E_` or `e_` depending on type, then follow rules for macros. 662 | * NO libraries should be included - not even the default SA:MP ones. Let the user do it. 663 | * Due to the above rule, you cannot assume any third party libraries AT ALL, so do not use them. This can lead to some code duplication, but also means that the version of the code used here can be tailored for optimisations. 664 | * Certain terms may be shortened when dealing with long callback names to avoid compile truncation warnings (max symbol length is 31). Current list: 665 | * `Checkpoint`: `CP` 666 | * `Update `: `Upd` 667 | * `TextDraw `: `TD` 668 | * `Object `: `Obj` 669 | * `Player `: `P` 670 | * Document all fixes at the top of the file, and highlight code. 671 | * 4 space TABS - do not edit this file in PAWNO unless you know how to correct the indentation. 672 | * All rules have exceptions, but they must be justifiable. For example `IS_FILTERSCRIPT` is a global variable, but is not called `FIXES_gIsFilterscript` to better match the `FILTERSCRIPT` macro it replaces. Now a macro for `_FIXES_gIsFilterscript`. 673 | * Variables which need to be fully global (i.e. not `static`), but should not actually be used by other people (e.g. appear inside a macro) should be prefixed with `_FIXES` instead of `FIXES` to indicate their private use. 674 | * No comments beyond the end of column 80 (where the line in `PAWNO` is). 675 | * If a bug is fixed in some version of the server it can be conditionally included here. This is done by checking for the existance of a native function introduced in the same server version. For example `TogglePlayerControllable` was fixed in 0.3eRC6, the same time as the `SetObjectMaterial` native was introduced, thus the inclusion becomes: 676 | 677 | ```pawn 678 | /** 679 | * 680 | * 681 | * A description of the problem. 682 | * 683 | * 684 | * A description of the solution. 685 | * 686 | * FIXES_FunctionWithFixIn 687 | * Name 688 | * 689 | * 690 | */ 691 | 692 | #if !defined FIX_NameOfFixHere 693 | #if defined NativeInFixRelease 694 | #if FIXES_EnableDeprecated 695 | static _FIXES_STOCK FIX_NameOfFixHere = FIXES_EnableDeprecated; 696 | #else 697 | _FIXES_CONST_PAWNDOC(FIX_NameOfFixHere); 698 | #endif 699 | #define FIX_NameOfFixHere FIXES_EnableDeprecated 700 | #else 701 | static _FIXES_STOCK FIX_NameOfFixHere = _FIXES_DEFAULT; 702 | #define FIX_NameOfFixHere _FIXES_DEFAULT 703 | #endif 704 | #elseif _FIXES_IS_UNSET(FIX_NameOfFixHere) 705 | #undef FIX_NameOfFixHere 706 | static stock FIX_NameOfFixHere = 2; 707 | #define FIX_NameOfFixHere (2) 708 | #elseif FIX_NameOfFixHere 709 | #undef FIX_NameOfFixHere 710 | static stock FIX_NameOfFixHere = 1; 711 | #define FIX_NameOfFixHere (1) 712 | #else 713 | #undef FIX_NameOfFixHere 714 | static stock FIX_NameOfFixHere = 0; 715 | #define FIX_NameOfFixHere (0) 716 | #endif 717 | ``` 718 | 719 | This only includes this fix if that native doesn't exist. A copyable version of this pattern is at the end of the file. 720 | * To reduce general memory consumption, strings in this include are stored globally in constant arrays and referenced. This is EXACTLY as fast as using the string constants directly, but means that strings are not stored in the assembly multiple times (unless the string is only used once, in which case it's more work for no gain). See this post for more details: [http://forum.sa-mp.com/showpost.php?p=1795601](http://forum.sa-mp.com/showpost.php?p=1795601) 721 | * DO NOT EDIT THIS FILE IN PAWNO OR ON GITHUB. Both mess up the spacing - GitHub in an almost irreversible way (except for the fact that nothing is irreversible in source control. Pawno spacing is less tricky to solve, and can be worked around if you know when it uses spaces and tabs - in short, always write code first THEN indent and you won't have a problem (in that editor at least, that is normally a bad way to write code). 722 | 723 | ## Documentation Explanation 724 | 725 | The **fixes.inc** code itself now contains all of the documentation in its header, formatted using the compiler's natively supported pawn-doc, plus some custom XSL. Previously **README.md** and the header had to be kept in sync manually. Now you can just compile a script with `-r` and get a large amount of XML documentation, including all of this header in a `` pair. The repository comes with a file called **markdown.xsl** that, when saved as **pawno/xml/pawndoc.xsl**, will transform that XML to markdown to keep **README.md** fully up-to-data almost automatically. 726 | 727 | The descriptions of the fixes all look like: 728 | 729 | ```xml 730 | 731 | 732 | Description of problem. 733 | 734 | 735 | Description of solution. 736 | 737 | Relevant functions. 738 | Person who wrote the fix 739 | 740 | 741 | ``` 742 | 743 | ## Thanks 744 | 745 | A huge thanks to all the community members that have reported and fixed bugs, this include would not be anywhere near the level of quality it is right now without all of you. Fix writers are all listed above by their contributions. Fix reporters can be seen by browsing the github issues. A special thanks also to [@ziggi](https://github.com/ziggi) for hosting this repo for a long time. 746 | 747 | --------------------------------------------------------------------------------