Advertisement
S4T3K

new.pwn - Optimized for 0.3z RC

Jan 24th, 2014
610
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 6.21 KB | None | 0 0
  1. /****************************************************
  2.  
  3. Presentation of the script :
  4.  
  5.  
  6. Commands :
  7.  
  8.  
  9. Credits :
  10.  
  11.  
  12. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  13. Changelog :
  14. \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  15.  
  16.  
  17. *****************************************************/
  18.  
  19. // #define)
  20.  
  21. // #define USE_MYSQL // Uncomment to use MySQL
  22. // #define FILTERSCRIPT // Uncomment if it is a filterscript
  23.  
  24. // Defines of the bodyparts for OnPlayerTakeDamage and OnPlayerGiveDamage (0.3z)
  25.  
  26. #define BODY_PART_TORSO 3
  27. #define BODY_PART_GROIN 4
  28. #define BODY_PART_LEFT_ARM 5
  29. #define BODY_PART_RIGHT_ARM 6
  30. #define BODY_PART_RIGHT_ARM 7
  31. #define BODY_PART_RIGHT_LEG 8
  32. #define BODY_PART_HEAD 9
  33.  
  34. // Definition of the hit types for OnPlayerWeaponShot(0.3z)
  35.  
  36. #define BULLET_HIT_TYPE_NONE            0
  37. #define BULLET_HIT_TYPE_PLAYER          1
  38. #define BULLET_HIT_TYPE_VEHICLE         2
  39. #define BULLET_HIT_TYPE_OBJECT          3
  40. #define BULLET_HIT_TYPE_PLAYER_OBJECT   4
  41.  
  42. // Includes
  43. // These are my personal and usual includes.
  44. // If you don't use some or just don't have them, delete the line :)
  45.  
  46. #include <a_samp>
  47. #include <a_npc>
  48. #include <a_players>
  49. #include <a_vehicles>
  50. #include <a_objects>
  51. #include <float>
  52. #include <string>
  53. #include <core>
  54. #include <file>
  55. #include <streamer>
  56.  
  57. #if defined USE_MYSQL
  58.     #include <a_mysql>
  59. #endif
  60.  
  61. // News
  62.  
  63. new cmd[32], x_nr[256], tmp[128], giveplayerid;
  64.  
  65. // Forwards (public functions (your personnal ones/undefined ones)
  66.  
  67. forward OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart);
  68. forward OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart);
  69. forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
  70.  
  71. #if defined FILTERSCRIPT
  72.  
  73.  
  74. public OnFilterScriptInit()
  75. {
  76.     print("\n--------------------------------------");
  77.     print("[Filterscript name] by [your nick]");
  78.     print("--------------------------------------\n");
  79.     return 1;
  80. }
  81.  
  82. public OnFilterScriptExit()
  83. {
  84.     return 1;
  85. }
  86.  
  87. #else
  88.  
  89. main()
  90. {
  91.     print("\n----------------------------------");
  92.     print("[Gamemode name] by [your nick]");
  93.     print("----------------------------------\n");
  94. }
  95.  
  96. #endif
  97.  
  98. public OnGameModeInit()
  99. {
  100.     // If you're doin a filterscript, simply use OnFilterScriptInit
  101.     SetGameModeText("Blank script");
  102.     AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  103.     return 1;
  104. }
  105.  
  106. public OnGameModeExit()
  107. {
  108.     // If you're doin a filterscript, simply use OnFilterScriptInit
  109.     return 1;
  110. }
  111.  
  112. public OnPlayerRequestClass(playerid, classid)
  113. {
  114.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  115.     SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  116.     SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  117.     return 1;
  118. }
  119.  
  120. public OnPlayerConnect(playerid)
  121. {
  122.     return 1;
  123. }
  124.  
  125. public OnPlayerDisconnect(playerid, reason)
  126. {
  127.     return 1;
  128. }
  129.  
  130. public OnPlayerSpawn(playerid)
  131. {
  132.     return 1;
  133. }
  134.  
  135. public OnPlayerDeath(playerid, killerid, reason)
  136. {
  137.     return 1;
  138. }
  139.  
  140. public OnVehicleSpawn(vehicleid)
  141. {
  142.     return 1;
  143. }
  144.  
  145. public OnVehicleDeath(vehicleid, killerid)
  146. {
  147.     return 1;
  148. }
  149.  
  150. public OnPlayerText(playerid, text[])
  151. {
  152.     return 1;
  153. }
  154.  
  155. public OnPlayerCommandText(playerid, cmdtext[])
  156. {
  157.     cmd = strtok(cmdtext, idx);
  158.     if (strcmp(cmd, "/respawn", true) == 0)
  159.     {
  160.         SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  161.         SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  162.         SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  163.         SendClientMessage(playerid, -1, "{9ACD32}[Information]{FFFFFF} You've respawned !");
  164.         return 1;
  165.     }
  166.     return 0;
  167. }
  168.  
  169. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  170. {
  171.     return 1;
  172. }
  173.  
  174. public OnPlayerExitVehicle(playerid, vehicleid)
  175. {
  176.     return 1;
  177. }
  178.  
  179. public OnPlayerStateChange(playerid, newstate, oldstate)
  180. {
  181.     return 1;
  182. }
  183.  
  184. public OnPlayerEnterCheckpoint(playerid)
  185. {
  186.     return 1;
  187. }
  188.  
  189. public OnPlayerLeaveCheckpoint(playerid)
  190. {
  191.     return 1;
  192. }
  193.  
  194. public OnPlayerEnterRaceCheckpoint(playerid)
  195. {
  196.     return 1;
  197. }
  198.  
  199. public OnPlayerLeaveRaceCheckpoint(playerid)
  200. {
  201.     return 1;
  202. }
  203.  
  204. public OnRconCommand(cmd[])
  205. {
  206.     return 1;
  207. }
  208.  
  209. public OnPlayerRequestSpawn(playerid)
  210. {
  211.     return 1;
  212. }
  213.  
  214. public OnObjectMoved(objectid)
  215. {
  216.     return 1;
  217. }
  218.  
  219. public OnPlayerObjectMoved(playerid, objectid)
  220. {
  221.     return 1;
  222. }
  223.  
  224. public OnPlayerPickUpPickup(playerid, pickupid)
  225. {
  226.     return 1;
  227. }
  228.  
  229. public OnVehicleMod(playerid, vehicleid, componentid)
  230. {
  231.     return 1;
  232. }
  233.  
  234. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  235. {
  236.     return 1;
  237. }
  238.  
  239. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  240. {
  241.     return 1;
  242. }
  243.  
  244. public OnPlayerSelectedMenuRow(playerid, row)
  245. {
  246.     return 1;
  247. }
  248.  
  249. public OnPlayerExitedMenu(playerid)
  250. {
  251.     return 1;
  252. }
  253.  
  254. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  255. {
  256.     return 1;
  257. }
  258.  
  259. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  260. {
  261.     return 1;
  262. }
  263.  
  264. public OnRconLoginAttempt(ip[], password[], success)
  265. {
  266.     return 1;
  267. }
  268.  
  269. public OnPlayerUpdate(playerid)
  270. {
  271.     return 1;
  272. }
  273.  
  274. public OnPlayerStreamIn(playerid, forplayerid)
  275. {
  276.     return 1;
  277. }
  278.  
  279. public OnPlayerStreamOut(playerid, forplayerid)
  280. {
  281.     return 1;
  282. }
  283.  
  284. public OnVehicleStreamIn(vehicleid, forplayerid)
  285. {
  286.     return 1;
  287. }
  288.  
  289. public OnVehicleStreamOut(vehicleid, forplayerid)
  290. {
  291.     return 1;
  292. }
  293.  
  294. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  295. {
  296.     return 1;
  297. }
  298.  
  299. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  300. {
  301.     return 1;
  302. }
  303.  
  304. public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
  305. {
  306.     return 1;
  307. }
  308.  
  309. public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid, bodypart)
  310. {
  311.     return 1;
  312. }
  313.  
  314. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  315. {
  316.     return 1;
  317. }
  318.  
  319. // Stocks
  320.  
  321. // Yes, i still use strtok. Delete this part or comment it if you don't use it any more.
  322. strtok(const string[], &index)
  323. {
  324.     new length = strlen(string);
  325.     while ((index < length) && (string[index] <= ' '))
  326.     {
  327.         index++;
  328.     }
  329.  
  330.     new offset = index;
  331.     new result[20];
  332.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  333.     {
  334.         result[index - offset] = string[index];
  335.         index++;
  336.     }
  337.     result[index - offset] = EOS;
  338.     return result;
  339. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement