Advertisement
S4T3K

new.pwn - Optimisé pour 0.3z

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