Advertisement
Guest User

a_players

a guest
Aug 11th, 2012
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 11.17 KB | None | 0 0
  1. /*  SA-MP Player Functions
  2.  *
  3.  *  (c) Copyright 2005-2012, SA-MP Team
  4.  *
  5.  */
  6.  
  7. #if defined _players_included
  8.     #endinput
  9. #endif
  10. #define _players_included
  11. #pragma library players
  12.  
  13. #define SPECIAL_ACTION_NONE             0
  14. #define SPECIAL_ACTION_DUCK             1
  15. #define SPECIAL_ACTION_USEJETPACK       2
  16. #define SPECIAL_ACTION_ENTER_VEHICLE    3
  17. #define SPECIAL_ACTION_EXIT_VEHICLE     4
  18. #define SPECIAL_ACTION_DANCE1           5
  19. #define SPECIAL_ACTION_DANCE2           6
  20. #define SPECIAL_ACTION_DANCE3           7
  21. #define SPECIAL_ACTION_DANCE4           8
  22. #define SPECIAL_ACTION_HANDSUP          10
  23. #define SPECIAL_ACTION_USECELLPHONE     11
  24. #define SPECIAL_ACTION_SITTING          12
  25. #define SPECIAL_ACTION_STOPUSECELLPHONE 13
  26. #define SPECIAL_ACTION_DRINK_BEER       20
  27. #define SPECIAL_ACTION_SMOKE_CIGGY      21
  28. #define SPECIAL_ACTION_DRINK_WINE       22
  29. #define SPECIAL_ACTION_DRINK_SPRUNK     23
  30. #define SPECIAL_ACTION_CUFFED           24
  31.  
  32. #define FIGHT_STYLE_NORMAL              4
  33. #define FIGHT_STYLE_BOXING              5
  34. #define FIGHT_STYLE_KUNGFU              6
  35. #define FIGHT_STYLE_KNEEHEAD            7
  36. #define FIGHT_STYLE_GRABKICK            15
  37. #define FIGHT_STYLE_ELBOW               16
  38.  
  39. #define WEAPONSKILL_PISTOL              0
  40. #define WEAPONSKILL_PISTOL_SILENCED     1
  41. #define WEAPONSKILL_DESERT_EAGLE        2
  42. #define WEAPONSKILL_SHOTGUN             3
  43. #define WEAPONSKILL_SAWNOFF_SHOTGUN     4
  44. #define WEAPONSKILL_SPAS12_SHOTGUN      5
  45. #define WEAPONSKILL_MICRO_UZI           6
  46. #define WEAPONSKILL_MP5                 7
  47. #define WEAPONSKILL_AK47                8
  48. #define WEAPONSKILL_M4                  9
  49. #define WEAPONSKILL_SNIPERRIFLE         10
  50.  
  51. #define WEAPONSTATE_UNKNOWN             -1
  52. #define WEAPONSTATE_NO_BULLETS          0
  53. #define WEAPONSTATE_LAST_BULLET         1
  54. #define WEAPONSTATE_MORE_BULLETS        2
  55. #define WEAPONSTATE_RELOADING           3
  56.  
  57. // Player
  58. native SetSpawnInfo(playerid, team, skin, Float:x, Float:y, Float:z, Float:rotation, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  59. native SpawnPlayer(playerid);
  60.  
  61. // Player info
  62. native SetPlayerPos(playerid, Float:x, Float:y, Float:z);
  63. native SetPlayerPosFindZ(playerid, Float:x, Float:y, Float:z);
  64. native GetPlayerPos(playerid, &Float:x, &Float:y, &Float:z);
  65. native SetPlayerFacingAngle(playerid,Float:ang);
  66. native GetPlayerFacingAngle(playerid,&Float:ang);
  67. native IsPlayerInRangeOfPoint(playerid, Float:range, Float:x, Float:y, Float:z);
  68. native Float:GetPlayerDistanceFromPoint(playerid, Float:X, Float:Y, Float:Z);
  69. native IsPlayerStreamedIn(playerid, forplayerid);
  70. native SetPlayerInterior(playerid,interiorid);
  71. native GetPlayerInterior(playerid);
  72. native SetPlayerHealth(playerid, Float:health);
  73. native GetPlayerHealth(playerid, &Float:health);
  74. native SetPlayerArmour(playerid, Float:armour);
  75. native GetPlayerArmour(playerid, &Float:armour);
  76. native SetPlayerAmmo(playerid, weaponslot, ammo);
  77. native GetPlayerAmmo(playerid);
  78. native GetPlayerWeaponState(playerid);
  79. native GetPlayerTargetPlayer(playerid);
  80. native SetPlayerTeam(playerid, teamid);
  81. native GetPlayerTeam(playerid);
  82. native SetPlayerScore(playerid,score);
  83. native GetPlayerScore(playerid);
  84. native GetPlayerDrunkLevel(playerid);
  85. native SetPlayerDrunkLevel(playerid, level);
  86. native SetPlayerColor(playerid,color);
  87. native GetPlayerColor(playerid);
  88. native SetPlayerSkin(playerid, skinid);
  89. native GetPlayerSkin(playerid);
  90. native GivePlayerWeapon(playerid, weaponid, ammo);
  91. native ResetPlayerWeapons(playerid);
  92. native SetPlayerArmedWeapon(playerid, weaponid);
  93. native GetPlayerWeaponData(playerid, slot, &weapons, &ammo);
  94. native GivePlayerMoney(playerid,money);
  95. native ResetPlayerMoney(playerid);
  96. native SetPlayerName(playerid, const name[]);
  97. native GetPlayerMoney(playerid);
  98. native GetPlayerState(playerid);
  99. native GetPlayerIp(playerid, name[], len);
  100. native GetPlayerPing(playerid);
  101. native GetPlayerWeapon(playerid);
  102. native GetPlayerKeys(playerid, &keys, &updown, &leftright);
  103. native GetPlayerName(playerid, const name[], len);
  104. native SetPlayerTime(playerid, hour, minute);
  105. native GetPlayerTime(playerid, &hour, &minute);
  106. native TogglePlayerClock(playerid, toggle);
  107. native SetPlayerWeather(playerid, weather);
  108. native ForceClassSelection(playerid);
  109. native SetPlayerWantedLevel(playerid, level);
  110. native GetPlayerWantedLevel(playerid);
  111. native SetPlayerFightingStyle(playerid, style);
  112. native GetPlayerFightingStyle(playerid);
  113. native SetPlayerVelocity(playerid, Float:X, Float:Y, Float:Z);
  114. native GetPlayerVelocity( playerid, &Float:X, &Float:Y, &Float:Z );
  115. native PlayCrimeReportForPlayer(playerid, suspectid, crime);
  116. native PlayAudioStreamForPlayer(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0);
  117. native StopAudioStreamForPlayer(playerid);
  118. native SetPlayerShopName(playerid, shopname[]);
  119. native SetPlayerSkillLevel(playerid, skill, level);
  120. native GetPlayerSurfingVehicleID(playerid);
  121. native GetPlayerSurfingObjectID(playerid);
  122. native RemoveBuildingForPlayer(playerid, modelid, Float:fX, Float:fY, Float:fZ, Float:fRadius);
  123.  
  124. // Attached to bone objects
  125.  
  126. #define MAX_PLAYER_ATTACHED_OBJECTS 10 // This is the number of attached indexes available ie 10 = 0-9
  127.  
  128. native SetPlayerAttachedObject(playerid, index, modelid, bone, Float:fOffsetX = 0.0, Float:fOffsetY = 0.0, Float:fOffsetZ = 0.0, Float:fRotX = 0.0, Float:fRotY = 0.0, Float:fRotZ = 0.0, Float:fScaleX = 1.0, Float:fScaleY = 1.0, Float:fScaleZ = 1.0, materialcolor1 = 0, materialcolor2 = 0);
  129. native RemovePlayerAttachedObject(playerid, index);
  130. native IsPlayerAttachedObjectSlotUsed(playerid, index);
  131. native EditAttachedObject(playerid, index);
  132.  
  133. // Per-player TextDraws
  134. native PlayerText:CreatePlayerTextDraw(playerid, Float:x, Float:y, text[]);
  135. native PlayerTextDrawDestroy(playerid, PlayerText:text);
  136. native PlayerTextDrawLetterSize(playerid, PlayerText:text, Float:x, Float:y);
  137. native PlayerTextDrawTextSize(playerid, PlayerText:text, Float:x, Float:y);
  138. native PlayerTextDrawAlignment(playerid, PlayerText:text, alignment);
  139. native PlayerTextDrawColor(playerid, PlayerText:text, color);
  140. native PlayerTextDrawUseBox(playerid, PlayerText:text, use);
  141. native PlayerTextDrawBoxColor(playerid, PlayerText:text, color);
  142. native PlayerTextDrawSetShadow(playerid, PlayerText:text, size);
  143. native PlayerTextDrawSetOutline(playerid, PlayerText:text, size);
  144. native PlayerTextDrawBackgroundColor(playerid, PlayerText:text, color);
  145. native PlayerTextDrawFont(playerid, PlayerText:text, font);
  146. native PlayerTextDrawSetProportional(playerid, PlayerText:text, set);
  147. native PlayerTextDrawSetSelectable(playerid, PlayerText:text, set);
  148. native PlayerTextDrawShow(playerid, PlayerText:text);
  149. native PlayerTextDrawHide(playerid, PlayerText:text);
  150. native PlayerTextDrawSetString(playerid, PlayerText:text, string[]);
  151.  
  152. // Per-player variable system (PVars)
  153. native SetPVarInt(playerid, varname[], int_value);
  154. native GetPVarInt(playerid, varname[]);
  155. native SetPVarString(playerid, varname[], string_value[]);
  156. native GetPVarString(playerid, varname[], string_return[], len);
  157. native SetPVarFloat(playerid, varname[], Float:float_value);
  158. native Float:GetPVarFloat(playerid, varname[]);
  159. native DeletePVar(playerid, varname[]);
  160.  
  161. // PVar enumeration
  162. #define PLAYER_VARTYPE_NONE         0
  163. #define PLAYER_VARTYPE_INT          1
  164. #define PLAYER_VARTYPE_STRING       2
  165. #define PLAYER_VARTYPE_FLOAT        3
  166.  
  167. native GetPVarsUpperIndex(playerid);
  168. native GetPVarNameAtIndex(playerid, index, ret_varname[], ret_len);
  169. native GetPVarType(playerid, varname[]);
  170.  
  171. #define MAX_CHATBUBBLE_LENGTH 144
  172. native SetPlayerChatBubble(playerid, text[], color, Float:drawdistance, expiretime);
  173.  
  174. // Player controls
  175. native PutPlayerInVehicle(playerid, vehicleid, seatid);
  176. native GetPlayerVehicleID(playerid);
  177. native GetPlayerVehicleSeat(playerid);
  178. native RemovePlayerFromVehicle(playerid);
  179. native TogglePlayerControllable(playerid, toggle);
  180. native PlayerPlaySound(playerid, soundid, Float:x, Float:y, Float:z);
  181. native ApplyAnimation(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time, forcesync = 0);
  182. native ClearAnimations(playerid, forcesync = 0);
  183. native GetPlayerAnimationIndex(playerid); // return the index of any running applied animations (0 if none are running)
  184. native GetAnimationName(index, animlib[], len1, animname[], len2); // get the animation lib/name for the index
  185. native GetPlayerSpecialAction(playerid);
  186. native SetPlayerSpecialAction(playerid,actionid);
  187.  
  188. // Player world/map related
  189. native SetPlayerCheckpoint(playerid, Float:x, Float:y, Float:z, Float:size);
  190. native DisablePlayerCheckpoint(playerid);
  191. native SetPlayerRaceCheckpoint(playerid, type, Float:x, Float:y, Float:z, Float:nextx, Float:nexty, Float:nextz, Float:size);
  192. native DisablePlayerRaceCheckpoint(playerid);
  193. native SetPlayerWorldBounds(playerid,Float:x_max,Float:x_min,Float:y_max,Float:y_min);
  194. native SetPlayerMarkerForPlayer(playerid, showplayerid, color);
  195. native ShowPlayerNameTagForPlayer(playerid, showplayerid, show);
  196.  
  197. #define MAPICON_LOCAL             0 // displays in the player's local are
  198. #define MAPICON_GLOBAL            1 // displays always
  199. #define MAPICON_LOCAL_CHECKPOINT  2 // displays in the player's local area and has a checkpoint marker
  200. #define MAPICON_GLOBAL_CHECKPOINT 3 // displays always and has a checkpoint marker
  201.  
  202. native SetPlayerMapIcon(playerid, iconid, Float:x, Float:y, Float:z, markertype, color, style = MAPICON_LOCAL);
  203. native RemovePlayerMapIcon(playerid, iconid);
  204.  
  205. native AllowPlayerTeleport(playerid, allow);
  206.  
  207. // Player camera
  208. native SetPlayerCameraPos(playerid,Float:x, Float:y, Float:z);
  209.  
  210. #define CAMERA_CUT  2
  211. #define CAMERA_MOVE 1
  212.  
  213. native SetPlayerCameraLookAt(playerid, Float:x, Float:y, Float:z, cut = CAMERA_CUT);
  214. native SetCameraBehindPlayer(playerid);
  215. native GetPlayerCameraPos(playerid, &Float:x, &Float:y, &Float:z);
  216. native GetPlayerCameraFrontVector(playerid, &Float:x, &Float:y, &Float:z);
  217. native GetPlayerCameraMode(playerid);
  218. native AttachCameraToObject(playerid, objectid);
  219. native AttachCameraToPlayerObject(playerid, playerobjectid);
  220. native InterpolateCameraPos(playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT);
  221. native InterpolateCameraLookAt(playerid, Float:FromX, Float:FromY, Float:FromZ, Float:ToX, Float:ToY, Float:ToZ, time, cut = CAMERA_CUT);
  222.  
  223. // Player conditionals
  224. native IsPlayerConnected(playerid);
  225. native IsPlayerInVehicle(playerid, vehicleid);
  226. native IsPlayerInAnyVehicle(playerid);
  227. native IsPlayerInCheckpoint(playerid);
  228. native IsPlayerInRaceCheckpoint(playerid);
  229.  
  230. // Virtual Worlds
  231. native SetPlayerVirtualWorld(playerid, worldid);
  232. native GetPlayerVirtualWorld(playerid);
  233.  
  234. // Insane Stunts
  235. native EnableStuntBonusForPlayer(playerid, enable);
  236. native EnableStuntBonusForAll(enable);
  237.  
  238. // Spectating
  239. #define SPECTATE_MODE_NORMAL    1
  240. #define SPECTATE_MODE_FIXED     2
  241. #define SPECTATE_MODE_SIDE      3
  242.  
  243. native TogglePlayerSpectating(playerid, toggle);
  244. native PlayerSpectatePlayer(playerid, targetplayerid, mode = SPECTATE_MODE_NORMAL);
  245. native PlayerSpectateVehicle(playerid, targetvehicleid, mode = SPECTATE_MODE_NORMAL);
  246.  
  247. // Recording for NPC playback
  248. #define PLAYER_RECORDING_TYPE_NONE      0
  249. #define PLAYER_RECORDING_TYPE_DRIVER    1
  250. #define PLAYER_RECORDING_TYPE_ONFOOT    2
  251.  
  252. native StartRecordingPlayerData(playerid, recordtype, recordname[]);
  253. native StopRecordingPlayerData(playerid);
  254.  
  255. native SelectTextDraw(playerid, hovercolor); // enables the mouse so the player can select a textdraw
  256. native CancelSelectTextDraw(playerid)// cancel textdraw selection with the mouse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement