Advertisement
Shiny_

Invoke.hxx

Mar 27th, 2014
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 26.03 KB | None | 0 0
  1. /*
  2.     SA-MP 0.3z Invoke v1.0
  3.     Copyright (c) 2014, Linux_Shines
  4.     All rights reserved.
  5.  
  6.     Redistribution and use in source and binary forms, with or without
  7.     modification, are permitted provided that the following conditions are met:
  8.         * Redistributions of source code must retain the above copyright
  9.           notice, this list of conditions and the following disclaimer.
  10.         * Redistributions in binary form must reproduce the above copyright
  11.           notice, this list of conditions and the following disclaimer in the
  12.           documentation and/or other materials provided with the distribution.
  13.         * Neither the name of the Linux_Shines nor the
  14.           names of its contributors may be used to endorse or promote products
  15.           derived from this software without specific prior written permission.
  16.  
  17.     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
  18.     ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19.     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20.     DISCLAIMED. IN NO EVENT SHALL LINUX_SHINES BE LIABLE FOR ANY
  21.     DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22.     (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23.     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24.     ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25.     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  26.     SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. */
  28.  
  29. #pragma once
  30.  
  31. #include <bitset>
  32. #include <list>
  33. #include <map>
  34. #include <stdarg.h>
  35.  
  36. #include "..\SDK\plugin.h"
  37.  
  38. namespace INVOKE {
  39.     struct Native {
  40.         const char * name;
  41.         const char * data;
  42.     };
  43. #define NATIVE static const Native
  44.  
  45.     static const char * const names[] = {
  46.         // a_http:
  47.         "HTTP",
  48.  
  49.         // a_npc:
  50.         "print",
  51.         "printf",
  52.         "format",
  53.         "SetTimer",
  54.         "KillTimer",
  55.         "GetTickCount",
  56.         "asin",
  57.         "acos",
  58.         "atan",
  59.         "atan2",
  60.         "SendChat",
  61.         "SendCommand",
  62.         "GetPlayerState",
  63.         "GetPlayerPos",
  64.         "GetPlayerVehicleID",
  65.         "GetPlayerArmedWeapon",
  66.         "GetPlayerHealth",
  67.         "GetPlayerArmour",
  68.         "GetPlayerSpecialAction",
  69.         "IsPlayerStreamedIn",
  70.         "IsVehicleStreamedIn",
  71.         "GetPlayerKeys",
  72.         "GetPlayerFacingAngle",
  73.         "GetMyPos",
  74.         "SetMyPos",
  75.         "GetMyFacingAngle",
  76.         "SetMyFacingAngle",
  77.         "GetDistanceFromMeToPoint",
  78.         "IsPlayerInRangeOfPoint",
  79.         "GetPlayerName",
  80.         "IsPlayerConnected",
  81.         "StartRecordingPlayback",
  82.         "StopRecordingPlayback",
  83.         "PauseRecordingPlayback",
  84.         "ResumeRecordingPlayback",
  85.  
  86.         // a_objects:
  87.         "CreateObject",
  88.         "AttachObjectToVehicle",
  89.         "AttachObjectToObject",
  90.         "AttachObjectToPlayer",
  91.         "SetObjectPos",
  92.         "GetObjectPos",
  93.         "SetObjectRot",
  94.         "GetObjectRot",
  95.         "IsValidObject",
  96.         "DestroyObject",
  97.         "MoveObject",
  98.         "StopObject",
  99.         "IsObjectMoving",
  100.         "EditObject",
  101.         "EditPlayerObject",
  102.         "SelectObject",
  103.         "CancelEdit",
  104.         "CreatePlayerObject",
  105.         "AttachPlayerObjectToVehicle",
  106.         "SetPlayerObjectPos",
  107.         "GetPlayerObjectPos",
  108.         "SetPlayerObjectRot",
  109.         "GetPlayerObjectRot",
  110.         "IsValidPlayerObject",
  111.         "DestroyPlayerObject",
  112.         "MovePlayerObject",
  113.         "StopPlayerObject",
  114.         "IsPlayerObjectMoving",
  115.         "AttachPlayerObjectToPlayer",
  116.         "SetObjectMaterial",
  117.         "SetPlayerObjectMaterial",
  118.         "SetObjectMaterialText",
  119.         "SetPlayerObjectMaterialText",
  120.  
  121.         // a_players:
  122.         "SetSpawnInfo",
  123.         "SpawnPlayer",
  124.         "SetPlayerPos",
  125.         "SetPlayerPosFindZ",
  126.         "GetPlayerPos",
  127.         "SetPlayerFacingAngle",
  128.         "GetPlayerFacingAngle",
  129.         "IsPlayerInRangeOfPoint",
  130.         "GetPlayerDistanceFromPoint",
  131.         "IsPlayerStreamedIn",
  132.         "SetPlayerInterior",
  133.         "GetPlayerInterior",
  134.         "SetPlayerHealth",
  135.         "GetPlayerHealth",
  136.         "SetPlayerArmour",
  137.         "GetPlayerArmour",
  138.         "SetPlayerAmmo",
  139.         "GetPlayerAmmo",
  140.         "GetPlayerWeaponState",
  141.         "GetPlayerTargetPlayer",
  142.         "SetPlayerTeam",
  143.         "GetPlayerTeam",
  144.         "SetPlayerScore",
  145.         "GetPlayerScore",
  146.         "GetPlayerDrunkLevel",
  147.         "SetPlayerDrunkLevel",
  148.         "SetPlayerColor",
  149.         "GetPlayerColor",
  150.         "SetPlayerSkin",
  151.         "GetPlayerSkin",
  152.         "GivePlayerWeapon",
  153.         "ResetPlayerWeapons",
  154.         "SetPlayerArmedWeapon",
  155.         "GetPlayerWeaponData",
  156.         "GivePlayerMoney",
  157.         "ResetPlayerMoney",
  158.         "SetPlayerName",
  159.         "GetPlayerMoney",
  160.         "GetPlayerState",
  161.         "GetPlayerIp",
  162.         "GetPlayerPing",
  163.         "GetPlayerWeapon",
  164.         "GetPlayerKeys",
  165.         "GetPlayerName",
  166.         "SetPlayerTime",
  167.         "GetPlayerTime",
  168.         "TogglePlayerClock",
  169.         "SetPlayerWeather",
  170.         "ForceClassSelection",
  171.         "SetPlayerWantedLevel",
  172.         "GetPlayerWantedLevel",
  173.         "SetPlayerFightingStyle",
  174.         "GetPlayerFightingStyle",
  175.         "SetPlayerVelocity",
  176.         "GetPlayerVelocity",
  177.         "PlayCrimeReportForPlayer",
  178.         "PlayAudioStreamForPlayer",
  179.         "StopAudioStreamForPlayer",
  180.         "SetPlayerShopName",
  181.         "SetPlayerSkillLevel",
  182.         "GetPlayerSurfingVehicleID",
  183.         "GetPlayerSurfingObjectID",
  184.         "RemoveBuildingForPlayer",
  185.         "GetPlayerLastShotVectors",
  186.         "SetPlayerAttachedObject",
  187.         "RemovePlayerAttachedObject",
  188.         "IsPlayerAttachedObjectSlotUsed",
  189.         "EditAttachedObject",
  190.         "PlayerText:CreatePlayerTextDraw",
  191.         "PlayerTextDrawDestroy",
  192.         "PlayerTextDrawLetterSize",
  193.         "PlayerTextDrawTextSize",
  194.         "PlayerTextDrawAlignment",
  195.         "PlayerTextDrawColor",
  196.         "PlayerTextDrawUseBox",
  197.         "PlayerTextDrawBoxColor",
  198.         "PlayerTextDrawSetShadow",
  199.         "PlayerTextDrawSetOutline",
  200.         "PlayerTextDrawBackgroundColor",
  201.         "PlayerTextDrawFont",
  202.         "PlayerTextDrawSetProportional",
  203.         "PlayerTextDrawSetSelectable",
  204.         "PlayerTextDrawShow",
  205.         "PlayerTextDrawHide",
  206.         "PlayerTextDrawSetString",
  207.         "PlayerTextDrawSetPreviewModel",
  208.         "PlayerTextDrawSetPreviewRot",
  209.         "PlayerTextDrawSetPreviewVehCol",
  210.         "SetPVarInt",
  211.         "GetPVarInt",
  212.         "SetPVarString",
  213.         "GetPVarString",
  214.         "SetPVarFloat",
  215.         "GetPVarFloat",
  216.         "DeletePVar",
  217.         "GetPVarsUpperIndex",
  218.         "GetPVarNameAtIndex",
  219.         "GetPVarType",
  220.         "SetPlayerChatBubble",
  221.         "PutPlayerInVehicle",
  222.         "GetPlayerVehicleID",
  223.         "GetPlayerVehicleSeat",
  224.         "RemovePlayerFromVehicle",
  225.         "TogglePlayerControllable",
  226.         "PlayerPlaySound",
  227.         "ApplyAnimation",
  228.         "ClearAnimations",
  229.         "GetPlayerAnimationIndex",
  230.         "GetAnimationName",
  231.         "GetPlayerSpecialAction",
  232.         "SetPlayerSpecialAction",
  233.         "SetPlayerCheckpoint",
  234.         "DisablePlayerCheckpoint",
  235.         "SetPlayerRaceCheckpoint",
  236.         "DisablePlayerRaceCheckpoint",
  237.         "SetPlayerWorldBounds",
  238.         "SetPlayerMarkerForPlayer",
  239.         "ShowPlayerNameTagForPlayer",
  240.         "SetPlayerMapIcon",
  241.         "RemovePlayerMapIcon",
  242.         "AllowPlayerTeleport",
  243.         "SetPlayerCameraPos",
  244.         "SetPlayerCameraLookAt",
  245.         "SetCameraBehindPlayer",
  246.         "GetPlayerCameraPos",
  247.         "GetPlayerCameraFrontVector",
  248.         "GetPlayerCameraMode",
  249.         "GetPlayerCameraAspectRatio",
  250.         "GetPlayerCameraZoom",
  251.         "AttachCameraToObject",
  252.         "AttachCameraToPlayerObject",
  253.         "InterpolateCameraPos",
  254.         "InterpolateCameraLookAt",
  255.         "IsPlayerConnected",
  256.         "IsPlayerInVehicle",
  257.         "IsPlayerInAnyVehicle",
  258.         "IsPlayerInCheckpoint",
  259.         "IsPlayerInRaceCheckpoint",
  260.         "SetPlayerVirtualWorld",
  261.         "GetPlayerVirtualWorld",
  262.         "EnableStuntBonusForPlayer",
  263.         "EnableStuntBonusForAll",
  264.         "TogglePlayerSpectating",
  265.         "PlayerSpectatePlayer",
  266.         "PlayerSpectateVehicle",
  267.         "StartRecordingPlayerData",
  268.         "StopRecordingPlayerData",
  269.         "SelectTextDraw",
  270.         "CancelSelectTextDraw",
  271.  
  272.         // a_samp:
  273.         "SendClientMessage",
  274.         "SendClientMessageToAll",
  275.         "SendPlayerMessageToPlayer",
  276.         "SendPlayerMessageToAll",
  277.         "SendDeathMessage",
  278.         "GameTextForAll",
  279.         "GameTextForPlayer",
  280.         "GetTickCount",
  281.         "GetMaxPlayers",
  282.         "CallRemoteFunction",
  283.         "CallLocalFunction",
  284.         "VectorSize",
  285.         "SetGameModeText",
  286.         "SetTeamCount",
  287.         "AddPlayerClass",
  288.         "AddPlayerClassEx",
  289.         "AddStaticVehicle",
  290.         "AddStaticVehicleEx",
  291.         "AddStaticPickup",
  292.         "CreatePickup",
  293.         "DestroyPickup",
  294.         "ShowNameTags",
  295.         "ShowPlayerMarkers",
  296.         "GameModeExit",
  297.         "SetWorldTime",
  298.         "GetWeaponName",
  299.         "EnableTirePopping",
  300.         "EnableVehicleFriendlyFire",
  301.         "AllowInteriorWeapons",
  302.         "SetWeather",
  303.         "SetGravity",
  304.         "AllowAdminTeleport",
  305.         "SetDeathDropAmount",
  306.         "CreateExplosion",
  307.         "EnableZoneNames",
  308.         "UsePlayerPedAnims",
  309.         "DisableInteriorEnterExits",
  310.         "SetNameTagDrawDistance",
  311.         "DisableNameTagLOS",
  312.         "LimitGlobalChatRadius",
  313.         "LimitPlayerMarkerRadius",
  314.         "ConnectNPC",
  315.         "IsPlayerNPC",
  316.         "IsPlayerAdmin",
  317.         "Kick",
  318.         "Ban",
  319.         "BanEx",
  320.         "SendRconCommand",
  321.         "GetServerVarAsString",
  322.         "GetServerVarAsInt",
  323.         "GetServerVarAsBool",
  324.         "GetPlayerNetworkStats",
  325.         "GetNetworkStats",
  326.         "GetPlayerVersion",
  327.         "GetServerTickRate",
  328.         "NetStats_GetConnectedTime",
  329.         "NetStats_MessagesReceived",
  330.         "NetStats_BytesReceived",
  331.         "NetStats_MessagesSent",
  332.         "NetStats_BytesSent",
  333.         "NetStats_MessagesRecvPerSecond",
  334.         "NetStats_PacketLossPercent",
  335.         "NetStats_ConnectionStatus",
  336.         "NetStats_GetIpPort",
  337.         "CreateMenu",
  338.         "DestroyMenu",
  339.         "AddMenuItem",
  340.         "SetMenuColumnHeader",
  341.         "ShowMenuForPlayer",
  342.         "HideMenuForPlayer",
  343.         "IsValidMenu",
  344.         "DisableMenu",
  345.         "DisableMenuRow",
  346.         "GetPlayerMenu",
  347.         "TextDrawCreate",
  348.         "TextDrawDestroy",
  349.         "TextDrawLetterSize",
  350.         "TextDrawTextSize",
  351.         "TextDrawAlignment",
  352.         "TextDrawColor",
  353.         "TextDrawUseBox",
  354.         "TextDrawBoxColor",
  355.         "TextDrawSetShadow",
  356.         "TextDrawSetOutline",
  357.         "TextDrawBackgroundColor",
  358.         "TextDrawFont",
  359.         "TextDrawSetProportional",
  360.         "TextDrawSetSelectable",
  361.         "TextDrawShowForPlayer",
  362.         "TextDrawHideForPlayer",
  363.         "TextDrawShowForAll",
  364.         "TextDrawHideForAll",
  365.         "TextDrawSetString",
  366.         "TextDrawSetPreviewModel",
  367.         "TextDrawSetPreviewRot",
  368.         "TextDrawSetPreviewVehCol",
  369.         "GangZoneCreate",
  370.         "GangZoneDestroy",
  371.         "GangZoneShowForPlayer",
  372.         "GangZoneShowForAll",
  373.         "GangZoneHideForPlayer",
  374.         "GangZoneHideForAll",
  375.         "GangZoneFlashForPlayer",
  376.         "GangZoneFlashForAll",
  377.         "GangZoneStopFlashForPlayer",
  378.         "GangZoneStopFlashForAll",
  379.         "Text3D:Create3DTextLabel",
  380.         "Delete3DTextLabel",
  381.         "Attach3DTextLabelToPlayer",
  382.         "Attach3DTextLabelToVehicle",
  383.         "Update3DTextLabelText",
  384.         "PlayerText3D:CreatePlayer3DTextLabel",
  385.         "DeletePlayer3DTextLabel",
  386.         "UpdatePlayer3DTextLabelText",
  387.         "ShowPlayerDialog",
  388.  
  389.         // a_sampdb:
  390.         "db_open",
  391.         "db_close",
  392.         "db_query",
  393.         "db_free_result",
  394.         "db_num_rows",
  395.         "db_next_row",
  396.         "db_num_fields",
  397.         "db_field_name",
  398.         "db_get_field",
  399.         "db_get_field_assoc",
  400.  
  401.         // a_vehicles:
  402.         "CreateVehicle",
  403.         "DestroyVehicle",
  404.         "IsVehicleStreamedIn",
  405.         "GetVehiclePos",
  406.         "SetVehiclePos",
  407.         "GetVehicleZAngle",
  408.         "GetVehicleRotationQuat",
  409.         "GetVehicleDistanceFromPoint",
  410.         "SetVehicleZAngle",
  411.         "SetVehicleParamsForPlayer",
  412.         "ManualVehicleEngineAndLights",
  413.         "SetVehicleParamsEx",
  414.         "GetVehicleParamsEx",
  415.         "SetVehicleToRespawn",
  416.         "LinkVehicleToInterior",
  417.         "AddVehicleComponent",
  418.         "RemoveVehicleComponent",
  419.         "ChangeVehicleColor",
  420.         "ChangeVehiclePaintjob",
  421.         "SetVehicleHealth",
  422.         "GetVehicleHealth",
  423.         "AttachTrailerToVehicle",
  424.         "DetachTrailerFromVehicle",
  425.         "IsTrailerAttachedToVehicle",
  426.         "GetVehicleTrailer",
  427.         "SetVehicleNumberPlate",
  428.         "GetVehicleModel",
  429.         "GetVehicleComponentInSlot",
  430.         "GetVehicleComponentType",
  431.         "RepairVehicle",
  432.         "GetVehicleVelocity",
  433.         "SetVehicleVelocity",
  434.         "SetVehicleAngularVelocity",
  435.         "GetVehicleDamageStatus",
  436.         "UpdateVehicleDamageStatus",
  437.         "GetVehicleModelInfo",
  438.         "SetVehicleVirtualWorld",
  439.         "GetVehicleVirtualWorld",
  440.     };
  441.  
  442.     // a_http:
  443.     // HTTP(index, type, url[], data[], callback[]);
  444.     NATIVE HTTP = {"HTTP", "iisss"};
  445.  
  446.     // a_npc:
  447.     NATIVE print = {"print", "s"};
  448.     NATIVE SetTimer = {"SetTimer", "sii"};
  449.     NATIVE KillTimer = {"KillTimer", "i"};
  450.     NATIVE GetTickCount = {"GetTickCount", ""};
  451.     NATIVE asin = {"asin", "f"};
  452.     NATIVE acos = {"acos", "f"};
  453.     NATIVE atan = {"atan", "f"};
  454.     NATIVE atan2 = {"atan2", "ff"};
  455.     NATIVE SendChat = {"SendChat", "s"};
  456.     NATIVE SendCommand = {"SendCommand", "s"};
  457.     NATIVE GetPlayerState = {"GetPlayerState", "d"};
  458.     NATIVE GetPlayerPos = {"GetPlayerPos", "dvvv"};
  459.     NATIVE GetPlayerVehicleID = {"GetPlayerVehicleID", "d"};
  460.     NATIVE GetPlayerArmedWeapon = {"GetPlayerArmedWeapon", "d"};
  461.     NATIVE GetPlayerHealth = {"GetPlayerHealth", "d"};
  462.     NATIVE GetPlayerArmour = {"GetPlayerArmour", "d"};
  463.     NATIVE GetPlayerSpecialAction = {"GetPlayerSpecialAction", "d"};
  464.     NATIVE IsPlayerStreamedIn = {"IsPlayerStreamedIn", "d"};
  465.     NATIVE IsVehicleStreamedIn = {"IsVehicleStreamedIn", "d"};
  466.     NATIVE GetPlayerKeys = {"GetPlayerKeys", "dvvv"};
  467.     NATIVE GetPlayerFacingAngle = {"GetPlayerFacingAngle", "dv"};
  468.     NATIVE GetMyPos = {"GetMyPos", "vvv"};
  469.     NATIVE SetMyPos = {"SetMyPos", "fff"};
  470.     NATIVE GetMyFacingAngle = {"GetMyFacingAngle", "v"};
  471.     NATIVE SetMyFacingAngle = {"SetMyFacingAngle", "f"};
  472.     NATIVE GetDistanceFromMeToPoint = {"GetDistanceFromMeToPoint", "vvvv"};
  473.     NATIVE IsPlayerInRangeOfPoint = {"IsPlayerInRangeOfPoint", "dffff"};
  474.     NATIVE GetPlayerName = {"GetPlayerName", "dpd"};
  475.     NATIVE IsPlayerConnected = {"IsPlayerConnected", "d"};
  476.     NATIVE StartRecordingPlayback = {"StartRecordingPlayback", "ds"};
  477.     NATIVE StopRecordingPlayback = {"StopRecordingPlayback", ""};
  478.     NATIVE PauseRecordingPlayback = {"PauseRecordingPlayback", ""};
  479.     NATIVE ResumeRecordingPlayback = {"ResumeRecordingPlayback", ""};
  480.  
  481.     // a_objects:
  482.     NATIVE CreateObject = {"CreateObject", "dfffffff"};
  483.     NATIVE AttachObjectToVehicle = {"AttachObjectToVehicle", "ddffffff"};
  484.     NATIVE AttachObjectToObject = {"AttachObjectToObject", "ddffffffd"};
  485.     NATIVE AttachObjectToPlayer = {"AttachObjectToPlayer", "ddffffff"};
  486.     NATIVE SetObjectPos = {"SetObjectPos", "dfff"};
  487.     NATIVE GetObjectPos = {"GetObjectPos", "dvvv"};
  488.     NATIVE SetObjectRot = {"SetObjectRot", "dfff"};
  489.     NATIVE GetObjectRot = {"GetObjectRot", "dvvv"};
  490.     NATIVE IsValidObject = {"IsValidObject", "d"};
  491.     NATIVE DestroyObject = {"DestroyObject", "d"};
  492.     NATIVE MoveObject = {"MoveObject", "dfffffff"};
  493.     NATIVE StopObject = {"StopObject", "d"};
  494.     NATIVE IsObjectMoving = {"IsObjectMoving", "d"};
  495.     NATIVE EditObject = {"EditObject", "dd"};
  496.     NATIVE EditPlayerObject = {"EditPlayerObject", "dd"};
  497.     NATIVE SelectObject = {"SelectObject", "d"};
  498.     NATIVE CancelEdit = {"CancelEdit", "d"};
  499.     NATIVE CreatePlayerObject = {"CreatePlayerObject", "ddfffffff"};
  500.     NATIVE AttachPlayerObjectToVehicle = {"AttachPlayerObjectToVehicle", "dddffffff"};
  501.     NATIVE SetPlayerObjectPos = {"SetPlayerObjectPos", "ddfff"};
  502.     NATIVE GetPlayerObjectPos = {"GetPlayerObjectPos", "ddvvv"};
  503.     NATIVE SetPlayerObjectRot = {"SetPlayerObjectRot", "ddfff"};
  504.     NATIVE GetPlayerObjectRot = {"GetPlayerObjectRot", "ddvvv"};
  505.     NATIVE IsValidPlayerObject = {"IsValidPlayerObject", "dd"};
  506.     NATIVE DestroyPlayerObject = {"DestroyPlayerObject", "dd"};
  507.     NATIVE MovePlayerObject = {"MovePlayerObject", "ddfffffff"};
  508.     NATIVE StopPlayerObject = {"StopPlayerObject", "dd"};
  509.     NATIVE IsPlayerObjectMoving = {"IsPlayerObjectMoving", "dd"};
  510.     NATIVE AttachPlayerObjectToPlayer = {"AttachPlayerObjectToPlayer", "dddffffff"};
  511.     NATIVE SetObjectMaterial = {"SetObjectMaterial", "dddssd"};
  512.     NATIVE SetPlayerObjectMaterial = {"SetPlayerObjectMaterial", "ddddssd"};
  513.     NATIVE SetObjectMaterialText = {"SetObjectMaterialText", "dsddsddddd"};
  514.     NATIVE SetPlayerObjectMaterialText = {"SetPlayerObjectMaterialText", "ddsddsddddd"};
  515.  
  516.  
  517.     NATIVE SendClientMessage =                  { "SendClientMessage","iis" };
  518.     NATIVE SendClientMessageToAll =         { "SendClientMessageToAll","is" };
  519.     NATIVE SendDeathMessage =                   { "SendDeathMessage","iii" };
  520.     NATIVE GameTextForAll =                 { "GameTextForAll","sii" };
  521.     NATIVE GameTextForPlayer =                  { "GameTextForPlayer""isii" };
  522.     NATIVE GetTickCount =                       { "GetTickCount","" };
  523.     NATIVE GetMaxPlayers =                      { "GetMaxPlayers""" };
  524.     NATIVE SetGameModeText =                    {  "SetGameModeText","s" };
  525.     NATIVE SetTeamCount =                       {  "SetTeamCount", "i" };
  526.     NATIVE AddPlayerClass =                 { "AddPlayerClass","iffffiiiiii" };
  527.     NATIVE AddPlayerClassEx =                   { "AddPlayerClassEx","iiffffiiiiii" };
  528.     NATIVE AddStaticVehicle =                   { "AddStaticVehicle","iffffii" };
  529.     NATIVE AddStaticVehicleEx =             { "AddStaticVehicleEx","iffffiii" };
  530.     NATIVE AddStaticPickup =                    { "AddStaticPickup","iifff" };
  531.     NATIVE ShowNameTags =                       { "ShowNameTags","i" };
  532.     NATIVE ShowPlayerMarkers =                  { "ShowPlayerMarkers""i" };
  533.     NATIVE GameModeExit =                       { "GameModeExit","" };
  534.     NATIVE SetWorldTime =                       {"SetWorldTime","i" };
  535.     NATIVE GetWeaponName =                      { "GetWeaponName""ivi" };
  536.     NATIVE EnableTirePopping =                  { "EnableTirePopping","i" };
  537.     NATIVE AllowInteriorWeapons =               { "AllowInteriorWeapons","i" };
  538.     NATIVE SetWeather =                     { "SetWeather","i" };
  539.     NATIVE SetGravity =                     { "SetGravity","f" };
  540.     NATIVE AllowAdminTeleport =             {  "AllowAdminTeleport","i" };
  541.     NATIVE SetDeathDropAmount =             { "SetDeathDropAmount","i" };
  542.     NATIVE CreateExplosion =                    { "CreateExplosion","fffif" };
  543.     NATIVE EnableZoneNames =                    { "EnableZoneNames","i" };
  544.     NATIVE IsPlayerAdmin =                      { "IsPlayerAdmin""i" };
  545.     NATIVE Kick =                               { "Kick","i" };
  546.     NATIVE Ban =                                { "Ban",    "i" };
  547.     NATIVE SendRconCommand =                    { "SendRconCommand",    "s" };
  548.     NATIVE ShowPlayerDialog =                   { "ShowPlayerDialog",   "dddssss"};
  549.  
  550.     // a_players.inc
  551.     NATIVE SetSpawnInfo =                       { "SetSpawnInfo","iiiffffiiiiii" };
  552.     NATIVE SpawnPlayer =                        { "SpawnPlayer","i" };
  553.     NATIVE SetPlayerPos =                       { "SetPlayerPos","ifff" };
  554.     NATIVE GetPlayerPos =                       { "GetPlayerPos","ivvv" };
  555.     NATIVE SetPlayerFacingAngle =               { "SetPlayerFacingAngle","if" };
  556.     NATIVE GetPlayerFacingAngle =               { "GetPlayerFacingAngle","iv" };
  557.     NATIVE SetPlayerInterior =                  { "SetPlayerInterior""ii" };
  558.     NATIVE GetPlayerInterior =                  { "GetPlayerInterior""i" };
  559.     NATIVE SetPlayerHealth =                    { "SetPlayerHealth",                        "if" };
  560.     NATIVE GetPlayerHealth =                    { "GetPlayerHealth",                        "iv" };
  561.     NATIVE SetPlayerArmour =                    { "SetPlayerArmour",                        "if" };
  562.     NATIVE GetPlayerArmour =                    { "GetPlayerArmour",                        "iv" };
  563.     NATIVE SetPlayerAmmo =                      { "SetPlayerAmmo",                      "iii" };
  564.     NATIVE GetPlayerAmmo =                      { "GetPlayerAmmo",                      "i" };
  565.     NATIVE SetPlayerTeam =                      { "SetPlayerTeam",                      "ii" };
  566.     NATIVE GetPlayerTeam =                      { "GetPlayerTeam",                      "i" };
  567.     NATIVE SetPlayerScore =                 {  "SetPlayerScore",                        "ii" };
  568.     NATIVE GetPlayerScore =                 {  "GetPlayerScore",                        "i" };
  569.     NATIVE SetPlayerColor =                 {  "SetPlayerColor",                        "ii" };
  570.     NATIVE GetPlayerColor =                 {  "GetPlayerColor",                        "i" };
  571.     NATIVE SetPlayerSkin =                      {  "SetPlayerSkin",                     "ii" };
  572.     NATIVE GivePlayerWeapon =                   {  "GivePlayerWeapon",                  "iii" };
  573.     NATIVE ResetPlayerWeapons =             { "ResetPlayerWeapons",                 "i" };
  574.     NATIVE GetPlayerWeaponData =                {  "GetPlayerWeaponData",                   "iiiviv " };
  575.     NATIVE GivePlayerMoney =                    {  "GivePlayerMoney",                       "ii" };
  576.     NATIVE ResetPlayerMoney =                   {  "ResetPlayerMoney",                  "i" };
  577.     NATIVE SetPlayerName =                      {  "SetPlayerName",                     "is" };
  578.     NATIVE GetPlayerMoney =                 {  "GetPlayerMoney",                        "i" };
  579.     NATIVE GetPlayerState =                 {  "GetPlayerState",                        "i" };
  580.     NATIVE GetPlayerIp =                        {  "GetPlayerIp",                           "ipi" };
  581.     NATIVE GetPlayerPing =                      {  "GetPlayerPing",                     "i" };
  582.     NATIVE GetPlayerWeapon =                    {  "GetPlayerWeapon",                       "i" };
  583.     NATIVE GetPlayerKeys =                      {  "GetPlayerKeys",                     "ivvv" };
  584.     NATIVE GetPlayerName =                      {  "GetPlayerName",                     "ipi" };
  585.     NATIVE PutPlayerInVehicle =             {  "PutPlayerInVehicle",                    "iii" };
  586.     NATIVE GetPlayerVehicleID =             {  "GetPlayerVehicleID",                    "i" };
  587.     NATIVE RemovePlayerFromVehicle =            {  "RemovePlayerFromVehicle",               "i" };
  588.     NATIVE TogglePlayerControllable =           {  "TogglePlayerControllable",          "ii" };
  589.     NATIVE PlayerPlaySound =                    {  "PlayerPlaySound",                       "iifff" };
  590.     NATIVE SetPlayerCheckpoint =                {  "SetPlayerCheckpoint",                   "iffff" };
  591.     NATIVE DisablePlayerCheckpoint =            {  "DisablePlayerCheckpoint",               "i" };
  592.     NATIVE SetPlayerRaceCheckpoint =            {  "SetPlayerRaceCheckpoint",               "iifffffff" };
  593.     NATIVE DisablePlayerRaceCheckpoint =        {  "DisablePlayerRaceCheckpoint",           "i" };
  594.     NATIVE SetPlayerWorldBounds =               {  "SetPlayerWorldBounds",              "iffff" };
  595.     NATIVE SetPlayerMarkerForPlayer =           {  "SetPlayerMarkerForPlayer",          "iii" };
  596.     NATIVE ShowPlayerNameTagForPlayer =     {  "ShowPlayerNameTagForPlayer",            "iii" };
  597.     NATIVE SetPlayerMapIcon =                   {  "SetPlayerMapIcon",                  "iifffii" };
  598.     NATIVE RemovePlayerMapIcon =                {  "RemovePlayerMapIcon",                   "ii" };
  599.     NATIVE SetPlayerCameraPos =             {  "SetPlayerCameraPos",                    "ifff" };
  600.     NATIVE SetPlayerCameraLookAt =              {  "SetPlayerCameraLookAt",             "ifff" };
  601.     NATIVE SetCameraBehindPlayer =              {  "SetCameraBehindPlayer",             "i" };
  602.     NATIVE AllowPlayerTeleport =                {  "AllowPlayerTeleport",                   "ii" };
  603.     NATIVE IsPlayerConnected =                  {  "IsPlayerConnected"                  "i" };
  604.     NATIVE IsPlayerInVehicle =                  {  "IsPlayerInVehicle",                 "ii" };
  605.     NATIVE IsPlayerInAnyVehicle =               {  "IsPlayerInAnyVehicle",              "i" };
  606.     NATIVE IsPlayerInCheckpoint =               {  "IsPlayerInCheckpoint",              "i" };
  607.     NATIVE IsPlayerInRaceCheckpoint =           {  "IsPlayerInRaceCheckpoint",          "i" };
  608.     NATIVE SetPlayerTime =                      {  "SetPlayerTime",                     "iii" };
  609.     NATIVE TogglePlayerClock =                  {  "TogglePlayerClock",                 "ii" };
  610.     NATIVE SetPlayerWeather =                   {  "SetPlayerWeather",                  "ii" };
  611.     NATIVE GetPlayerTime =                      {  "GetPlayerTime",                     "ivv" };
  612.     NATIVE SetPlayerVirtualWorld =              {  "SetPlayerVirtualWorld",             "ii" };
  613.     NATIVE GetPlayerVirtualWorld =              {  "GetPlayerVirtualWorld",             "i" };
  614.  
  615.     // a_vehicle.inc
  616.     NATIVE CreateVehicle =                      {  "CreateVehicle",                     "iffffiii" };
  617.     NATIVE DestroyVehicle =                 {  "DestroyVehicle",                        "i" };
  618.     NATIVE GetVehiclePos =                      {  "GetVehiclePos",                     "ivvv" };
  619.     NATIVE SetVehiclePos =                      {  "SetVehiclePos",                     "ifff" };
  620.     NATIVE GetVehicleZAngle =                   {  "GetVehicleZAngle",                  "iv" };
  621.     NATIVE SetVehicleZAngle =                   {  "SetVehicleZAngle",                  "if" };
  622.     NATIVE SetVehicleParamsForPlayer =          {  "SetVehicleParamsForPlayer",         "iiii" };
  623.     NATIVE SetVehicleToRespawn =                {  "SetVehicleToRespawn",                   "i" };
  624.     NATIVE LinkVehicleToInterior =              { "LinkVehicleToInterior",              "ii" };
  625.     NATIVE AddVehicleComponent =                {  "AddVehicleComponent",                   "ii" };
  626.     NATIVE ChangeVehicleColor =             { "ChangeVehicleColor",                 "iii" };
  627.     NATIVE ChangeVehiclePaintjob =              {  "ChangeVehiclePaintjob",             "ii" };
  628.     NATIVE SetVehicleHealth =                   {  "SetVehicleHealth",                  "if" };
  629.     NATIVE GetVehicleHealth =                   {  "GetVehicleHealth",                  "iv" };
  630.     NATIVE AttachTrailerToVehicle =         {  "AttachTrailerToVehicle",                "ii" };
  631.     NATIVE DetachTrailerFromVehicle =           {  "DetachTrailerFromVehicle",          "i" };
  632.     NATIVE IsTrailerAttachedToVehicle =     {  "IsTrailerAttachedToVehicle",            "i" };
  633.     NATIVE GetVehicleModel =                    {  "GetVehicleModel",                   "d"};
  634.     NATIVE SetVehicleNumberPlate =              {  "SetVehicleNumberPlate",             "is" };
  635.     NATIVE SetVehicleVirtualWorld =         {  "SetVehicleVirtualWorld",                "ii" };
  636.     NATIVE GetVehicleVirtualWorld =         {  "GetVehicleVirtualWorld",                "i" };
  637.     NATIVE ApplyAnimation =                 { "ApplyAnimation",                     "issfiiiii" };
  638.  
  639.     // a_objects.inc
  640.     NATIVE CreateObject =                       { "CreateObject",                       "ifffffff" };
  641.     NATIVE SetObjectPos =                       {  "SetObjectPos",                      "ifff" };
  642.     NATIVE GetObjectPos =                       {  "GetObjectPos",                      "ivvv" };
  643.     NATIVE SetObjectRot =                       {  "SetObjectRot",                      "ifff" };
  644.     NATIVE GetObjectRot =                       {  "GetObjectRot",                      "ivvv" };
  645.     NATIVE IsValidObject =                      {  "IsValidObject",                     "i" };
  646.     NATIVE DestroyObject =                      {  "DestroyObject",                     "i" };
  647.     NATIVE MoveObject =                     {  "MoveObject",                            "iffff" };
  648.     NATIVE StopObject =                     {  "StopObject ",                           "i" };
  649.     NATIVE CreatePlayerObject =             {  "CreatePlayerObject",                    "iiffffff" };
  650.     NATIVE SetPlayerObjectPos =             {  "SetPlayerObjectPos",                    "iifff" };
  651.     NATIVE GetPlayerObjectPos =             {  "GetPlayerObjectPos",                    "iivvv" };
  652.     NATIVE GetPlayerObjectRot =             {  "GetPlayerObjectRot",                    "iivvv" };
  653.     NATIVE SetPlayerObjectRot =             {  "SetPlayerObjectRot",                    "iifff" };
  654.     NATIVE IsValidPlayerObject =                {  "IsValidPlayerObject",                   "ii" };
  655.     NATIVE DestroyPlayerObject =                {  "DestroyPlayerObject",                   "ii" };
  656.     NATIVE MovePlayerObject =                   {  "MovePlayerObject",                  "iiffff" };
  657.     NATIVE StopPlayerObject =                   {  "StopPlayerObject",                  "ii" };
  658.  
  659.     // Menu's
  660.     NATIVE CreateMenu =                     {  "CreateMenu",                            "siffff" };
  661.     NATIVE DestroyMenu =                        {  "DestroyMenu",                           "i" };
  662.     NATIVE AddMenuItem =                        {  "AddMenuItem",                           "iis" };
  663.     NATIVE SetMenuColumnHeader =                {  "SetMenuColumnHeader",                   "iis" };
  664.     NATIVE ShowMenuForPlayer =                  {  "ShowMenuForPlayer",                 "ii" };
  665.     NATIVE HideMenuForPlayer =                  {  "HideMenuForPlayer",                 "ii" };
  666.     NATIVE IsValidMenu =                        {  "IsValidMenu",                           "i" };
  667.     NATIVE DisableMenu =                        {  "DisableMenu",                           "i" };
  668.     NATIVE DisableMenuRow =                 {  "DisableMenuRow",                        "ii" };
  669.  
  670.     // Textdraw
  671.     NATIVE TextDrawCreate =                 { "TextDrawCreate",                     "ffs" };
  672.     NATIVE TextDrawDestroy =                    {  "TextDrawDestroy",                       "i" };
  673.     NATIVE TextDrawLetterSize =             { "TextDrawLetterSize",                 "iff" };
  674.     NATIVE TextDrawTextSize =                   {  "TextDrawTextSize",                  "iff" };
  675.     NATIVE TextDrawAlignment =                  {  "TextDrawAlignment",                 "ii" };
  676.     NATIVE TextDrawColor =                      {  "TextDrawColor",                     "ii" };
  677.     NATIVE TextDrawUseBox =                 {  "TextDrawUseBox",                        "ii" };
  678.     NATIVE TextDrawBoxColor =                   {  "TextDrawBoxColor",                  "ii" };
  679.     NATIVE TextDrawSetShadow =                  {  "TextDrawSetShadow",                 "ii" };
  680.     NATIVE TextDrawSetOutline =             {  "TextDrawSetOutline",                    "ii" };
  681.     NATIVE TextDrawBackgroundColor =            {  "TextDrawBackgroundColor",               "ii" };
  682.     NATIVE TextDrawFont =                       { "TextDrawFont",                       "ii" };
  683.     NATIVE TextDrawSetProportional =            {  "TextDrawSetProportional",               "ii" };
  684.     NATIVE TextDrawShowForPlayer =              {  "TextDrawShowForPlayer",             "ii" };
  685.     NATIVE TextDrawHideForPlayer =              {  "TextDrawHideForPlayer",             "ii" };
  686.     NATIVE TextDrawShowForAll =             { "TextDrawShowForAll",                 "i" };
  687.     NATIVE TextDrawHideForAll =             { "TextDrawHideForAll",                 "i" };
  688.  
  689. };
  690. #define PAWN INVOKE
  691.  
  692. class Invoke {
  693.     public:
  694.         Invoke() {
  695.             gotAddresses = false;
  696.         }
  697.         int Call_Native(const INVOKE::Native * native, ...);
  698.         int getAddresses();
  699.         int amx_idx;
  700.         std::list<AMX *> amx_list;
  701.    
  702.     private:
  703.         bool gotAddresses;
  704.         std::map<std::string, unsigned int> amx_map;
  705. };
  706.  
  707. typedef int(* amx_Function_t) (AMX * amx, long int * params);
  708. extern Invoke * Invoke_Call;
  709.  
  710. #define callNative Call_Native
  711. #define gInvoke Invoke_Call
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement