daily pastebin goal
8%
SHARE
TWEET

Untitled

a guest Jun 8th, 2016 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma tabsize 4
  2. // Ignores warning 217 for properly indented PAWNO code
  3. // It's tab size is 4 and often uses 4 spaces instead, PAWNCC's is 8
  4.  
  5. #include <core>
  6. #include <float>
  7. #include <string>
  8. #include <file>
  9. #include <time>
  10. #include <datagram>
  11. #include <a_players>
  12. #include <a_vehicles>
  13. #include <a_objects>
  14. #include <a_actor>
  15. #include <a_sampdb>
  16.  
  17. // Limits and internal constants
  18. #define MAX_PLAYER_NAME                         (24)
  19. #define MAX_PLAYERS                             (1000)
  20. #define MAX_VEHICLES                            (2000)
  21. #define MAX_ACTORS                              (1000)
  22. #define INVALID_PLAYER_ID                       (0xFFFF)
  23. #define INVALID_VEHICLE_ID                      (0xFFFF)
  24. #define INVALID_ACTOR_ID                        (0xFFFF)
  25. #define NO_TEAM                                 (255)
  26. #define MAX_OBJECTS                             (1000)
  27. #define INVALID_OBJECT_ID                       (0xFFFF)
  28. #define MAX_GANG_ZONES                          (1024)
  29. #define MAX_TEXT_DRAWS                          (2048)
  30. #define MAX_PLAYER_TEXT_DRAWS                   (256)
  31. #define MAX_MENUS                               (128)
  32. #define MAX_3DTEXT_GLOBAL                       (1024)
  33. #define MAX_3DTEXT_PLAYER                       (1024)
  34. #define MAX_PICKUPS                             (4096)
  35. #define INVALID_MENU                            (0xFF)
  36. #define INVALID_TEXT_DRAW                       (0xFFFF)
  37. #define INVALID_GANG_ZONE                       (-1)
  38. #define INVALID_3DTEXT_ID                       (0xFFFF)
  39.  
  40. // --------------------------------------------------
  41. // Natives
  42. // --------------------------------------------------
  43.  
  44. // Util
  45. native print(const string[]);
  46. native printf(const format[], {Float,_}:...);
  47. native format(output[], len, const format[], {Float,_}:...);
  48. native SendClientMessage(playerid, color, const message[]);
  49. native SendClientMessageToAll(color, const message[]);
  50. native SendPlayerMessageToPlayer(playerid, senderid, const message[]);
  51. native SendPlayerMessageToAll(senderid, const message[]);
  52. native SendDeathMessage(killer, killee, weapon);
  53. native SendDeathMessageToPlayer(playerid, killer, killee, weapon);
  54. native GameTextForAll(const string[],time,style);
  55. native GameTextForPlayer(playerid,const string[],time,style);
  56. native SetTimer(funcname[], interval, repeating);
  57. native SetTimerEx(funcname[], interval, repeating, const format[], {Float,_}:...);
  58. native KillTimer(timerid);
  59. native GetTickCount();
  60. native GetMaxPlayers();
  61. native CallRemoteFunction(const function[], const format[], {Float,_}:...);
  62. native CallLocalFunction(const function[], const format[], {Float,_}:...);
  63. native Float:VectorSize(Float:x, Float:y, Float:z);
  64. native Float:asin(Float:value);
  65. native Float:acos(Float:value);
  66. native Float:atan(Float:value);
  67. native Float:atan2(Float:x, Float:y);
  68. native GetPlayerPoolSize();
  69. native GetVehiclePoolSize();
  70. native GetActorPoolSize();
  71.  
  72. // Hash
  73. native SHA256_PassHash(password[], salt[], ret_hash[], ret_hash_len); // SHA256 for password hashing
  74.  
  75. // Server wide persistent variable system (SVars)
  76. native SetSVarInt(varname[], int_value);
  77. native GetSVarInt(varname[]);
  78. native SetSVarString(varname[], string_value[]);
  79. native GetSVarString(varname[], string_return[], len);
  80. native SetSVarFloat(varname[], Float:float_value);
  81. native Float:GetSVarFloat(varname[]);
  82. native DeleteSVar(varname[]);
  83.  
  84. // SVar enumeration
  85. #define SERVER_VARTYPE_NONE         0
  86. #define SERVER_VARTYPE_INT          1
  87. #define SERVER_VARTYPE_STRING       2
  88. #define SERVER_VARTYPE_FLOAT        3
  89.  
  90. native GetSVarsUpperIndex();
  91. native GetSVarNameAtIndex(index, ret_varname[], ret_len);
  92. native GetSVarType(varname[]);
  93.  
  94. // Game
  95. native SetGameModeText(const string[]);
  96. native SetTeamCount(count);
  97. native AddPlayerClass(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  98. native AddPlayerClassEx(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo);
  99. native AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2);
  100. native AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren=0);
  101. native AddStaticPickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
  102. native CreatePickup(model, type, Float:X, Float:Y, Float:Z, virtualworld = 0);
  103. native DestroyPickup(pickup);
  104. native ShowNameTags(show);
  105. native ShowPlayerMarkers(mode);
  106. native GameModeExit();
  107. native SetWorldTime(hour);
  108. native GetWeaponName(weaponid, const weapon[], len);
  109. native EnableTirePopping(enable); // deprecated function
  110. native EnableVehicleFriendlyFire();
  111. native AllowInteriorWeapons(allow);
  112. native SetWeather(weatherid);
  113. native SetGravity(Float:gravity);
  114. native AllowAdminTeleport(allow);
  115. native SetDeathDropAmount(amount);
  116. native CreateExplosion(Float:X, Float:Y, Float:Z, type, Float:Radius);
  117. native EnableZoneNames(enable);
  118. native UsePlayerPedAnims();     // Will cause the players to use CJ running/walking animations
  119. native DisableInteriorEnterExits();  // will disable all interior enter/exits in the game.
  120. native SetNameTagDrawDistance(Float:distance); // Distance at which nametags will start rendering on the client.
  121. native DisableNameTagLOS(); // Disables the nametag Line-Of-Sight checking
  122. native LimitGlobalChatRadius(Float:chat_radius);
  123. native LimitPlayerMarkerRadius(Float:marker_radius);
  124.  
  125. // Npc
  126. native ConnectNPC(name[], script[]);
  127. native IsPlayerNPC(playerid);
  128.  
  129. // Admin
  130. native IsPlayerAdmin(playerid);
  131. native Kick(playerid);
  132. native Ban(playerid);
  133. native BanEx(playerid, const reason[]);
  134. native SendRconCommand(command[]);
  135. native GetPlayerNetworkStats(playerid, retstr[], retstr_size);
  136. native GetNetworkStats(retstr[], retstr_size);
  137. native GetPlayerVersion(playerid, const version[], len); // Returns the SA-MP client revision as reported by the player
  138. native BlockIpAddress(ip_address[], timems);
  139. native UnBlockIpAddress(ip_address[]);
  140.  
  141. // Deprecated:
  142. native GetServerVarAsString(const varname[], buffer[], len);
  143. native GetServerVarAsInt(const varname[]);
  144. native GetServerVarAsBool(const varname[]);
  145. // These are the same 3 functions as above although they avoid the name ambiguity/conflict with the SVar system.
  146. native GetConsoleVarAsString(const varname[], buffer[], len);
  147. native GetConsoleVarAsInt(const varname[]);
  148. native GetConsoleVarAsBool(const varname[]);
  149.  
  150. // Extended admin network stats
  151. native GetServerTickRate();
  152. native NetStats_GetConnectedTime(playerid);
  153. native NetStats_MessagesReceived(playerid);
  154. native NetStats_BytesReceived(playerid);
  155. native NetStats_MessagesSent(playerid);
  156. native NetStats_BytesSent(playerid);
  157. native NetStats_MessagesRecvPerSecond(playerid);
  158. native Float:NetStats_PacketLossPercent(playerid);
  159. native NetStats_ConnectionStatus(playerid);
  160. native NetStats_GetIpPort(playerid, ip_port[], ip_port_len);
  161.  
  162. // Menu
  163. native Menu:CreateMenu(const title[], columns, Float:x, Float:y, Float:col1width, Float:col2width = 0.0);
  164. native DestroyMenu(Menu:menuid);
  165. native AddMenuItem(Menu:menuid, column, const menutext[]);
  166. native SetMenuColumnHeader(Menu:menuid, column, const columnheader[]);
  167. native ShowMenuForPlayer(Menu:menuid, playerid);
  168. native HideMenuForPlayer(Menu:menuid, playerid);
  169. native IsValidMenu(Menu:menuid);
  170. native DisableMenu(Menu:menuid);
  171. native DisableMenuRow(Menu:menuid, row);
  172. native Menu:GetPlayerMenu(playerid);
  173.  
  174. // Text Draw
  175. #define TEXT_DRAW_FONT_SPRITE_DRAW   4
  176. #define TEXT_DRAW_FONT_MODEL_PREVIEW 5
  177.  
  178. native Text:TextDrawCreate(Float:x, Float:y, text[]);
  179. native TextDrawDestroy(Text:text);
  180. native TextDrawLetterSize(Text:text, Float:x, Float:y);
  181. native TextDrawTextSize(Text:text, Float:x, Float:y);
  182. native TextDrawAlignment(Text:text, alignment);
  183. native TextDrawColor(Text:text, color);
  184. native TextDrawUseBox(Text:text, use);
  185. native TextDrawBoxColor(Text:text, color);
  186. native TextDrawSetShadow(Text:text, size);
  187. native TextDrawSetOutline(Text:text, size);
  188. native TextDrawBackgroundColor(Text:text, color);
  189. native TextDrawFont(Text:text, font);
  190. native TextDrawSetProportional(Text:text, set);
  191. native TextDrawSetSelectable(Text:text, set);
  192. native TextDrawShowForPlayer(playerid, Text:text);
  193. native TextDrawHideForPlayer(playerid, Text:text);
  194. native TextDrawShowForAll(Text:text);
  195. native TextDrawHideForAll(Text:text);
  196. native TextDrawSetString(Text:text, string[]);
  197. native TextDrawSetPreviewModel(Text:text, modelindex);
  198. native TextDrawSetPreviewRot(Text:text, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fZoom = 1.0);
  199. native TextDrawSetPreviewVehCol(Text:text, color1, color2);
  200.  
  201. // Gang Zones
  202. native GangZoneCreate(Float:minx, Float:miny, Float:maxx, Float:maxy);
  203. native GangZoneDestroy(zone);
  204. native GangZoneShowForPlayer(playerid, zone, color);
  205. native GangZoneShowForAll(zone, color);
  206. native GangZoneHideForPlayer(playerid, zone);
  207. native GangZoneHideForAll(zone);
  208. native GangZoneFlashForPlayer(playerid, zone, flashcolor);
  209. native GangZoneFlashForAll(zone, flashcolor);
  210. native GangZoneStopFlashForPlayer(playerid, zone);
  211. native GangZoneStopFlashForAll(zone);
  212.  
  213. // Global 3D Text Labels
  214. native Text3D:Create3DTextLabel(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, virtualworld, testLOS=0);
  215. native Delete3DTextLabel(Text3D:id);
  216. native Attach3DTextLabelToPlayer(Text3D:id, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
  217. native Attach3DTextLabelToVehicle(Text3D:id, vehicleid, Float:OffsetX, Float:OffsetY, Float:OffsetZ);
  218. native Update3DTextLabelText(Text3D:id, color, text[]);
  219.  
  220. // Per-player 3D Text Labels
  221. native PlayerText3D:CreatePlayer3DTextLabel(playerid, text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, attachedplayer=INVALID_PLAYER_ID, attachedvehicle=INVALID_VEHICLE_ID, testLOS=0);
  222. native DeletePlayer3DTextLabel(playerid, PlayerText3D:id);
  223. native UpdatePlayer3DTextLabelText(playerid, PlayerText3D:id, color, text[]);
  224.  
  225. // Player GUI Dialog
  226. #define DIALOG_STYLE_MSGBOX             0
  227. #define DIALOG_STYLE_INPUT              1
  228. #define DIALOG_STYLE_LIST               2
  229. #define DIALOG_STYLE_PASSWORD           3
  230. #define DIALOG_STYLE_TABLIST            4
  231. #define DIALOG_STYLE_TABLIST_HEADERS    5
  232.  
  233. native ShowPlayerDialog(playerid, dialogid, style, caption[], info[], button1[], button2[]);
  234.  
  235. // --------------------------------------------------
  236. // Defines
  237. // --------------------------------------------------
  238.  
  239. // States
  240. #define PLAYER_STATE_NONE                       (0)
  241. #define PLAYER_STATE_ONFOOT                     (1)
  242. #define PLAYER_STATE_DRIVER                     (2)
  243. #define PLAYER_STATE_PASSENGER                  (3)
  244. #define PLAYER_STATE_EXIT_VEHICLE               (4) // (used internally)
  245. #define PLAYER_STATE_ENTER_VEHICLE_DRIVER       (5) // (used internally)
  246. #define PLAYER_STATE_ENTER_VEHICLE_PASSENGER    (6) // (used internally)
  247. #define PLAYER_STATE_WASTED                     (7)
  248. #define PLAYER_STATE_SPAWNED                    (8)
  249. #define PLAYER_STATE_SPECTATING                 (9)
  250.  
  251. // Marker modes used by ShowPlayerMarkers()
  252. #define PLAYER_MARKERS_MODE_OFF         (0)
  253. #define PLAYER_MARKERS_MODE_GLOBAL      (1)
  254. #define PLAYER_MARKERS_MODE_STREAMED    (2)
  255.  
  256. // Weapons
  257. #define WEAPON_BRASSKNUCKLE             (1)
  258. #define WEAPON_GOLFCLUB                 (2)
  259. #define WEAPON_NITESTICK                (3)
  260. #define WEAPON_KNIFE                    (4)
  261. #define WEAPON_BAT                      (5)
  262. #define WEAPON_SHOVEL                   (6)
  263. #define WEAPON_POOLSTICK                (7)
  264. #define WEAPON_KATANA                   (8)
  265. #define WEAPON_CHAINSAW                 (9)
  266. #define WEAPON_DILDO                    (10)
  267. #define WEAPON_DILDO2                   (11)
  268. #define WEAPON_VIBRATOR                 (12)
  269. #define WEAPON_VIBRATOR2                (13)
  270. #define WEAPON_FLOWER                   (14)
  271. #define WEAPON_CANE                     (15)
  272. #define WEAPON_GRENADE                  (16)
  273. #define WEAPON_TEARGAS                  (17)
  274. #define WEAPON_MOLTOV                   (18)
  275. #define WEAPON_COLT45                   (22)
  276. #define WEAPON_SILENCED                 (23)
  277. #define WEAPON_DEAGLE                   (24)
  278. #define WEAPON_SHOTGUN                  (25)
  279. #define WEAPON_SAWEDOFF                 (26)
  280. #define WEAPON_SHOTGSPA                 (27)
  281. #define WEAPON_UZI                      (28)
  282. #define WEAPON_MP5                      (29)
  283. #define WEAPON_AK47                     (30)
  284. #define WEAPON_M4                       (31)
  285. #define WEAPON_TEC9                     (32)
  286. #define WEAPON_RIFLE                    (33)
  287. #define WEAPON_SNIPER                   (34)
  288. #define WEAPON_ROCKETLAUNCHER           (35)
  289. #define WEAPON_HEATSEEKER               (36)
  290. #define WEAPON_FLAMETHROWER             (37)
  291. #define WEAPON_MINIGUN                  (38)
  292. #define WEAPON_SATCHEL                  (39)
  293. #define WEAPON_BOMB                     (40)
  294. #define WEAPON_SPRAYCAN                 (41)
  295. #define WEAPON_FIREEXTINGUISHER         (42)
  296. #define WEAPON_CAMERA                   (43)
  297. #define WEAPON_PARACHUTE                (46)
  298. #define WEAPON_VEHICLE                  (49)
  299. #define WEAPON_DROWN                    (53)
  300. #define WEAPON_COLLISION                (54)
  301.  
  302. // Keys
  303. #define KEY_ACTION              (1)
  304. #define KEY_CROUCH              (2)
  305. #define KEY_FIRE                (4)
  306. #define KEY_SPRINT              (8)
  307. #define KEY_SECONDARY_ATTACK    (16)
  308. #define KEY_JUMP                (32)
  309. #define KEY_LOOK_RIGHT          (64)
  310. #define KEY_HANDBRAKE           (128)
  311. #define KEY_LOOK_LEFT           (256)
  312. #define KEY_SUBMISSION          (512)
  313. #define KEY_LOOK_BEHIND         (512)
  314. #define KEY_WALK                (1024)
  315. #define KEY_ANALOG_UP           (2048)
  316. #define KEY_ANALOG_DOWN         (4096)
  317. #define KEY_ANALOG_LEFT         (8192)
  318. #define KEY_ANALOG_RIGHT        (16384)
  319. #define KEY_YES                 (65536)
  320. #define KEY_NO                  (131072)
  321. #define KEY_CTRL_BACK           (262144)
  322.  
  323. #define KEY_UP                  (-128)
  324. #define KEY_DOWN                (128)
  325. #define KEY_LEFT                (-128)
  326. #define KEY_RIGHT               (128)
  327.  
  328. // --------------------------------------------------
  329. // Forwards (Callback declarations)
  330. // --------------------------------------------------
  331.  
  332. forward OnGameModeInit();
  333. forward OnGameModeExit();
  334. forward OnFilterScriptInit();
  335. forward OnFilterScriptExit();
  336. forward OnPlayerConnect(playerid);
  337. forward OnPlayerDisconnect(playerid, reason);
  338. forward OnPlayerSpawn(playerid);
  339. forward OnPlayerDeath(playerid, killerid, reason);
  340. forward OnVehicleSpawn(vehicleid);
  341. forward OnVehicleDeath(vehicleid, killerid);
  342. forward OnPlayerText(playerid, text[]);
  343. forward OnPlayerCommandText(playerid, cmdtext[]);
  344. forward OnPlayerRequestClass(playerid, classid);
  345. forward OnPlayerEnterVehicle(playerid, vehicleid, ispassenger);
  346. forward OnPlayerExitVehicle(playerid, vehicleid);
  347. forward OnPlayerStateChange(playerid, newstate, oldstate);
  348. forward OnPlayerEnterCheckpoint(playerid);
  349. forward OnPlayerLeaveCheckpoint(playerid);
  350. forward OnPlayerEnterRaceCheckpoint(playerid);
  351. forward OnPlayerLeaveRaceCheckpoint(playerid);
  352. forward OnRconCommand(cmd[]);
  353. forward OnPlayerRequestSpawn(playerid);
  354. forward OnObjectMoved(objectid);
  355. forward OnPlayerObjectMoved(playerid, objectid);
  356. forward OnPlayerPickUpPickup(playerid, pickupid);
  357. forward OnVehicleMod(playerid, vehicleid, componentid);
  358. forward OnEnterExitModShop(playerid, enterexit, interiorid);
  359. forward OnVehiclePaintjob(playerid, vehicleid, paintjobid);
  360. forward OnVehicleRespray(playerid, vehicleid, color1, color2);
  361. forward OnVehicleDamageStatusUpdate(vehicleid, playerid);
  362. forward OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat, Float:new_x, Float:new_y, Float:new_z, Float:vel_x, Float:vel_y, Float:vel_z);
  363. forward OnPlayerSelectedMenuRow(playerid, row);
  364. forward OnPlayerExitedMenu(playerid);
  365. forward OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid);
  366. forward OnPlayerKeyStateChange(playerid, newkeys, oldkeys);
  367. forward OnRconLoginAttempt( ip[], password[], success );
  368. forward OnPlayerUpdate(playerid);
  369. forward OnPlayerStreamIn(playerid, forplayerid);
  370. forward OnPlayerStreamOut(playerid, forplayerid);
  371. forward OnVehicleStreamIn(vehicleid, forplayerid);
  372. forward OnVehicleStreamOut(vehicleid, forplayerid);
  373. forward OnActorStreamIn(actorid, forplayerid);
  374. forward OnActorStreamOut(actorid, forplayerid);
  375. forward OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]);
  376. forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  377. forward OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart);
  378. forward OnPlayerGiveDamageActor(playerid, damaged_actorid, Float:amount, weaponid, bodypart);
  379. forward OnPlayerClickMap(playerid, Float:fX, Float:fY, Float:fZ);
  380. forward OnPlayerClickTextDraw(playerid, Text:clickedid);
  381. forward OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid);
  382. forward OnIncomingConnection(playerid, ip_address[], port);
  383. forward OnTrailerUpdate(playerid, vehicleid);
  384. forward OnVehicleSirenStateChange(playerid, vehicleid, newstate);
  385.  
  386. #define CLICK_SOURCE_SCOREBOARD     0
  387. forward OnPlayerClickPlayer(playerid, clickedplayerid, source);
  388.  
  389. #define EDIT_RESPONSE_CANCEL        0
  390. #define EDIT_RESPONSE_FINAL         1
  391. #define EDIT_RESPONSE_UPDATE        2
  392.  
  393. forward OnPlayerEditObject( playerid, playerobject, objectid, response,
  394. Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ );
  395.  
  396. forward OnPlayerEditAttachedObject( playerid, response, index, modelid, boneid,
  397. Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ,
  398. Float:fRotX, Float:fRotY, Float:fRotZ,
  399. Float:fScaleX, Float:fScaleY, Float:fScaleZ );
  400.  
  401. #define SELECT_OBJECT_GLOBAL_OBJECT 1
  402. #define SELECT_OBJECT_PLAYER_OBJECT 2
  403.  
  404. forward OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ);
  405.  
  406. #define BULLET_HIT_TYPE_NONE            0
  407. #define BULLET_HIT_TYPE_PLAYER          1
  408. #define BULLET_HIT_TYPE_VEHICLE         2
  409. #define BULLET_HIT_TYPE_OBJECT          3
  410. #define BULLET_HIT_TYPE_PLAYER_OBJECT   4
  411.  
  412. forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  413.  
  414. main()
  415. {
  416. }
  417.  
  418. new tablica;
  419.  
  420. public OnGameModeInit()
  421. {
  422.     tablica = 1;
  423.     return 1;
  424. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top