diff --git a/README.md b/README.md index 25e4c64..5bcd5b0 100644 --- a/README.md +++ b/README.md @@ -296,7 +296,7 @@ introduces. To use them, `#include ` in Pawno. [clothes page]: https://wiki.multitheftauto.com/wiki/CJ_Clothes ```pawn -native AddPlayerClothes ( playerid, type, index ); +native AddPlayerClothes(playerid, type, index); ``` Applies the specified clothing to a player. See the [clothes page] for a @@ -306,7 +306,7 @@ visible effect on players with the CJ skin. ### GetPlayerClothes ```pawn -native GetPlayerClothes ( playerid, type ); +native GetPlayerClothes(playerid, type); ``` Returns the clothes index of the specified type which the player is @@ -317,7 +317,7 @@ relevant for players with the CJ skin. ### RemovePlayerClothes ```pawn -native RemovePlayerClothes ( playerid, type ); +native RemovePlayerClothes(playerid, type); ``` Removes the specified clothing from a player. See the [clothes page] for a @@ -327,7 +327,7 @@ on players with the CJ skin. ### ShowPlayerMarker ```pawn -native ShowPlayerMarker ( playerid, show ); +native ShowPlayerMarker(playerid, mode); ``` Shows or hides the blip of one specific player. @@ -335,7 +335,7 @@ Shows or hides the blip of one specific player. ### SetVehicleModel ```pawn -native SetVehicleModel ( vehicleid, model ) +native SetVehicleModel(vehicleid, model); ``` Changes the model of a vehicle; more practical than destroying and @@ -344,7 +344,7 @@ recreating it. ### lua ```pawn -native lua ( const fnName[], {Float,_}:... ); +native lua(const fnName[], {Float,_}:...); ``` Calls a Lua function. The function must be defined in a .lua file in the @@ -361,7 +361,7 @@ new playerid = lua("luaTestfn1", 1.3, "Test string"); ### amxRegisterPawnPrototypes ```pawn -native amxRegisterPawnPrototypes ( const prototype[][] ); +native amxRegisterPawnPrototypes(const prototype[][]); ``` Registers prototypes for public functions that can be subsequently @@ -385,7 +385,7 @@ amxRegisterPawnPrototypes(prototypes); ### amxVersion ```pawn -native amxVersion ( &Float:ver ); +native amxVersion(&Float:ver); ``` Retrieves the *amx* version as a floating point number, e.g. `1.3`. @@ -393,7 +393,7 @@ Retrieves the *amx* version as a floating point number, e.g. `1.3`. ### amxVersionString ```pawn -native amxVersionString ( buffer[], size ); +native amxVersionString(buffer[], size); ``` Retrieves the complete *amx* version string. @@ -405,7 +405,7 @@ A number of new Lua functions were also introduced. ### pawn ```lua -variant pawn ( string fnName, ... ) +variant pawn(string fnName, ...) ``` Calls a Pawn function. The function must be public, must be defined in @@ -422,7 +422,7 @@ local player = pawn('pawnTestfn1', 0.5, 'Test string') ### amxIsPluginLoaded ```lua -bool amxIsPluginLoaded ( string pluginName ) +bool amxIsPluginLoaded(string pluginName) ``` Checks if a specific SA-MP server plugin is currently loaded. pluginName @@ -431,7 +431,7 @@ is the name of the plugin without a file extension. ### amxRegisterLuaPrototypes ```lua -bool amxRegisterLuaPrototypes ( table prototypes ) +bool amxRegisterLuaPrototypes(table prototypes) ``` Registers prototypes of Lua functions that can subsequently be called @@ -453,7 +453,7 @@ amxRegisterLuaPrototypes( ### amxVersion ```lua -float amxVersion ( ) +float amxVersion() ``` Returns the *amx* version as a floating point number, for example `1.3`. @@ -461,7 +461,7 @@ Returns the *amx* version as a floating point number, for example `1.3`. ### amxVersionString ```lua -string amxVersionString ( ) +string amxVersionString() ``` Returns the complete *amx* version string. @@ -474,7 +474,7 @@ unloaded. ### onAMXStart ```lua -onAMXStart ( resource res, string amxName ) +onAMXStart(resource res, string amxName) ``` Triggered when an .amx file has just finished loading and initializing. @@ -489,7 +489,7 @@ registered their functions yet. ### onAMXStop ```lua -onAMXStop ( resource res, string amxName ) +onAMXStop(resource res, string amxName) ``` Triggered when an .amx file was unloaded. The source of this event is @@ -680,8 +680,7 @@ addressed in later versions of *amx* and Multi Theft Auto. EnableStuntBonusForAll, EnableStuntBonusForPlayer, EnableTirePopping (tire popping is always on), PlayerPlaySound, SendDeathMessage (use the "killmessages" resource on your server instead for graphical - death messages), SetNameTagDrawDistance, TextDrawSetProportional, - UsePlayerPedAnims. + death messages), SetNameTagDrawDistance, TextDrawSetProportional. ## Credits diff --git a/amx-test/file.txt b/amx-test/file.txt deleted file mode 100644 index e13d619..0000000 --- a/amx-test/file.txt +++ /dev/null @@ -1 +0,0 @@ -This is the content of an external file - it is in the gamemode's folder, not in a central "scriptfiles" folder between the files of all other gamemodes. diff --git a/amx-test/pawno/include/a_amx.inc b/amx-test/pawno/include/a_amx.inc index bdbcdbd..445eef6 100644 --- a/amx-test/pawno/include/a_amx.inc +++ b/amx-test/pawno/include/a_amx.inc @@ -43,8 +43,8 @@ native GetInteriorSoundsEnabled(); native SetInteriorSoundsEnabled(bool:enable); native IsGarageOpen(garageid); native SetGarageOpen(garageid, bool:open); -native IsGlitchEnabled(name[]); -native SetGlitchEnabled(name[], bool:enable); +native IsGlitchEnabled(const name[]); +native SetGlitchEnabled(const name[], bool:enable); native Float:GetAircraftMaxVelocity(); native SetAircraftMaxVelocity(Float:velocity); native Float:GetAircraftMaxHeight(); @@ -69,7 +69,7 @@ native GetPickupWeapon(pickupid); native GetPickupAmmo(pickupid); // Native Markers -native CreateMarker(Float:X, Float:Y, Float:Z, type[], Float:size, red, green, blue, alpha); +native CreateMarker(Float:X, Float:Y, Float:Z, const type[], Float:size, red, green, blue, alpha); native DestroyMarker(markerid); native GetMarkerColor(markerid, colorid); // Color IDs: 0 = Red, 1 = Green, 2 = Blue, 3 = Alpha native GetMarkerIcon(markerid); // 0 = No icon, 1 = Arrow, 2 = Race finish @@ -86,10 +86,10 @@ native IsBotInMarker(markerid, botid); native IsVehicleInMarker(markerid, vehicleid); // Rules -native IsValidServerRule(name[]); -native GetServerRule(name[], buf[], bufsize = sizeof(buf)); -native SetServerRule(name[], value[]); -native RemoveServerRule(name[]); +native IsValidServerRule(const name[]); +native GetServerRule(const name[], buf[], bufsize = sizeof(buf)); +native SetServerRule(const name[], const value[]); +native RemoveServerRule(const name[]); // Objects native IsObjectBreakable(objectid); @@ -122,12 +122,13 @@ native SetPlayerCanBeKnockedOffBike(playerid, bool:knockOff); native GetPlayerWeaponSlot(playerid); native SetPlayerWeaponSlot(playerid, slotid); native GetPlayerAmmoInClip(playerid); +native GetPlayerIdleTime(playerid); native IsPlayerHeadless(playerid); native SetPlayerHeadless(playerid, bool:headless); native GetPlayerBlurLevel(playerid); native SetPlayerBlurLevel(playerid, level); native FadePlayerCamera(playerid, bool:fadeIn, Float:timeToFade = 1.0, red = 0, green = 0, blue = 0); -native SetPlayerControlState(playerid, control[], bool:controlState); +native SetPlayerControlState(playerid, const control[], bool:controlState); native IsPlayerCursorShowing(playerid); native ShowPlayerCursor(playerid, bool:show, bool:controls); native GetPlayerAlpha(playerid); @@ -168,14 +169,14 @@ native GetTrainDirection(vehicleid); native SetTrainDirection(vehicleid, bool:clockwise); native GetTrainSpeed(vehicleid, &Float:speed); native SetTrainSpeed(vehicleid, Float:speed); -native GetVehicleDriver(vehicleid); +native GetVehicleOccupant(vehicleid, seatid); native GetVehicleNumberPlate(vehicleid, plate[], len = sizeof(plate)); native GetVehicleColor(vehicleid, &color1, &color2); native GetVehiclePaintjob(vehicleid); native GetVehicleInterior(vehicleid); // Bots -native CreateBot(modelid, Float:x, Float:y, Float:z, name[] = "Bot"); +native CreateBot(modelid, Float:x, Float:y, Float:z, const name[] = "Bot"); native DestroyBot(botid); native AddBotClothes(botid, type, index); native GetBotClothes(botid, type); @@ -218,7 +219,7 @@ native GetBotVehicleID(botid); native GetBotVehicleSeat(botid); native IsBotInVehicle(botid, vehicleid); native IsBotInAnyVehicle(botid); -native SetBotControlState(botid, control[], bool:controlState); +native SetBotControlState(botid, const control[], bool:controlState); native SetBotAimTarget(botid, Float:X, Float:Y, Float:Z); native GetBotDoingDriveBy(botid); native SetBotDoingDriveBy(botid, bool:driveBy); @@ -239,22 +240,22 @@ native GetBotAlpha(botid); native SetBotAlpha(botid, alpha); // Scoreboard -native AddScoreBoardColumn(column[]); -native SetPlayerScoreBoardData(playerid, column[], data[]); -native RemoveScoreBoardColumn(column[]); +native AddScoreBoardColumn(const column[]); +native SetPlayerScoreBoardData(playerid, const column[], const data[]); +native RemoveScoreBoardColumn(const column[]); // Player Data -native SetPlayerIntData(playerid, key[], value); -native GetPlayerIntData(playerid, key[]); -native SetPlayerFloatData(playerid, key[], Float:value); -native Float:GetPlayerFloatData(playerid, key[]); -native SetPlayerBoolData(playerid, key[], bool:value); -native GetPlayerBoolData(playerid, key[]); -native SetPlayerStringData(playerid, key[], value[]); -native GetPlayerStringData(playerid, key[], buf[], bufsize = sizeof(buf)); -native ResetPlayerData(playerid, key[]); +native SetPlayerIntData(playerid, const key[], value); +native GetPlayerIntData(playerid, const key[]); +native SetPlayerFloatData(playerid, const key[], Float:value); +native Float:GetPlayerFloatData(playerid, const key[]); +native SetPlayerBoolData(playerid, const key[], bool:value); +native GetPlayerBoolData(playerid, const key[]); +native SetPlayerStringData(playerid, const key[], const value[]); +native GetPlayerStringData(playerid, const key[], buf[], bufsize = sizeof(buf)); +native ResetPlayerData(playerid, const key[]); // Misc -native AddEventHandler(event[], func[]); -native RemoveEventHandler(func[]); -native IsPluginLoaded(plugin[]); +native AddEventHandler(const event[], const func[]); +native RemoveEventHandler(const func[]); +native IsPluginLoaded(const plugin[]); diff --git a/amx/meta.xml b/amx/meta.xml index 6d91c00..35e33e1 100644 --- a/amx/meta.xml +++ b/amx/meta.xml @@ -4,6 +4,7 @@