Advertisement
Guest User

Fighting Styles

a guest
Jul 17th, 2012
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.81 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6.  
  7. //Dialog Defines
  8. #define DIALOG_FIGHT 1
  9.  
  10. #if defined FILTERSCRIPT
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.     print("\n--------------------------------------");
  15.     print(" Fighting System Filterscript");
  16.     print("--------------------------------------\n");
  17.     return 1;
  18. }
  19.  
  20. public OnFilterScriptExit()
  21. {
  22.     return 1;
  23. }
  24.  
  25. #else
  26.  
  27. main()
  28. {
  29.     print("\n----------------------------------");
  30.     print(" Fighting System GameMode");
  31.     print("----------------------------------\n");
  32. }
  33.  
  34. #endif
  35.  
  36. public OnGameModeInit()
  37. {
  38.     SetGameModeText("Fighting System FS v1.0");
  39.     AddPlayerClass(299, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  40.     AddPlayerClass(292, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  41.     AddPlayerClass(294, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  42.     AddPlayerClass(36, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  43.    
  44.     UsePlayerPedAnims();
  45.     return 1;
  46. }
  47.  
  48. public OnGameModeExit()
  49. {
  50.     return 1;
  51. }
  52.  
  53. public OnPlayerRequestClass(playerid, classid)
  54. {
  55.     SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  56.     SetPlayerCameraPos(playerid, 1961.7427,1343.1292,15.3746);
  57.     SetPlayerCameraLookAt(playerid, 1961.7427,1343.1292,15.3746);
  58.     return 1;
  59. }
  60.  
  61. public OnPlayerConnect(playerid)
  62. {
  63.     return 1;
  64. }
  65.  
  66. public OnPlayerDisconnect(playerid, reason)
  67. {
  68.     return 1;
  69. }
  70.  
  71. public OnPlayerSpawn(playerid)
  72. {
  73.     if(GetPlayerFightingStyle(playerid) == FIGHT_STYLE_NORMAL)
  74.     {
  75.         SendClientMessage(playerid, -1, "Learn some new moves! (/train)");
  76.     }
  77.    
  78.     SetPlayerInterior(playerid, 5);
  79.     SetPlayerPos(playerid, 772.3120,-3.3076,1000.7296);
  80.     return 1;
  81. }
  82.  
  83. public OnPlayerDeath(playerid, killerid, reason)
  84. {
  85.     return 1;
  86. }
  87.  
  88. public OnVehicleSpawn(vehicleid)
  89. {
  90.     return 1;
  91. }
  92.  
  93. public OnVehicleDeath(vehicleid, killerid)
  94. {
  95.     return 1;
  96. }
  97.  
  98. public OnPlayerText(playerid, text[])
  99. {
  100.     return 1;
  101. }
  102.  
  103. /*
  104. ---Fighting Styles---
  105. 4 - FIGHT_STYLE_NORMAL
  106. 5 - FIGHT_STYLE_BOXING
  107. 6 - FIGHT_STYLE_KUNGFU
  108. 7 - FIGHT_STYLE_KNEEHEAD
  109. 15 - FIGHT_STYLE_GRABKICK
  110. 16 - FIGHT_STYLE_ELBOW
  111. ------------------------
  112. */
  113. public OnPlayerCommandText(playerid, cmdtext[])
  114. {
  115.     if (strcmp("/train", cmdtext, true, 6) == 0)
  116.     {
  117.         ShowPlayerDialog(playerid, DIALOG_FIGHT, DIALOG_STYLE_LIST, "Fighting Styles", "Normal Fighting Style\nBoxing Fighting Style\nKneeHead Fighting Style\nKungFu Fighting Style\nGrabKick Fighting Style\nElbow Fighting Style", "Proceed", "Cancel");
  118.         return 1;
  119.     }
  120.     return 0;
  121. }
  122.  
  123. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  124. {
  125.     return 1;
  126. }
  127.  
  128. public OnPlayerExitVehicle(playerid, vehicleid)
  129. {
  130.     return 1;
  131. }
  132.  
  133. public OnPlayerStateChange(playerid, newstate, oldstate)
  134. {
  135.     return 1;
  136. }
  137.  
  138. public OnPlayerEnterCheckpoint(playerid)
  139. {
  140.     return 1;
  141. }
  142.  
  143. public OnPlayerLeaveCheckpoint(playerid)
  144. {
  145.     return 1;
  146. }
  147.  
  148. public OnPlayerEnterRaceCheckpoint(playerid)
  149. {
  150.     return 1;
  151. }
  152.  
  153. public OnPlayerLeaveRaceCheckpoint(playerid)
  154. {
  155.     return 1;
  156. }
  157.  
  158. public OnRconCommand(cmd[])
  159. {
  160.     return 1;
  161. }
  162.  
  163. public OnPlayerRequestSpawn(playerid)
  164. {
  165.     return 1;
  166. }
  167.  
  168. public OnObjectMoved(objectid)
  169. {
  170.     return 1;
  171. }
  172.  
  173. public OnPlayerObjectMoved(playerid, objectid)
  174. {
  175.     return 1;
  176. }
  177.  
  178. public OnPlayerPickUpPickup(playerid, pickupid)
  179. {
  180.     return 1;
  181. }
  182.  
  183. public OnVehicleMod(playerid, vehicleid, componentid)
  184. {
  185.     return 1;
  186. }
  187.  
  188. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  189. {
  190.     return 1;
  191. }
  192.  
  193. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  194. {
  195.     return 1;
  196. }
  197.  
  198. public OnPlayerSelectedMenuRow(playerid, row)
  199. {
  200.     return 1;
  201. }
  202.  
  203. public OnPlayerExitedMenu(playerid)
  204. {
  205.     return 1;
  206. }
  207.  
  208. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  209. {
  210.     return 1;
  211. }
  212.  
  213. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  214. {
  215.     return 1;
  216. }
  217.  
  218. public OnRconLoginAttempt(ip[], password[], success)
  219. {
  220.     return 1;
  221. }
  222.  
  223. public OnPlayerUpdate(playerid)
  224. {
  225.     return 1;
  226. }
  227.  
  228. public OnPlayerStreamIn(playerid, forplayerid)
  229. {
  230.     return 1;
  231. }
  232.  
  233. public OnPlayerStreamOut(playerid, forplayerid)
  234. {
  235.     return 1;
  236. }
  237.  
  238. public OnVehicleStreamIn(vehicleid, forplayerid)
  239. {
  240.     return 1;
  241. }
  242.  
  243. public OnVehicleStreamOut(vehicleid, forplayerid)
  244. {
  245.     return 1;
  246. }
  247.  
  248. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  249. {
  250.     if(dialogid == DIALOG_FIGHT)
  251.     {
  252.         if(response) // If they clicked 'Select' or double-clicked a fighting style
  253.         {
  254.             if(listitem == 0) // Normal Fighting Style
  255.             {
  256.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_NORMAL);
  257.                 SendClientMessage(playerid, -1, "* You have changed your fighting style to a Normal Fighting Style.");
  258.             }
  259.             if(listitem == 1) // Boxing Fighting Style
  260.             {
  261.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_BOXING);
  262.                 SendClientMessage(playerid, -1, "* You have changed your fighting style to a Boxing Fighting Style.");
  263.             }
  264.             if(listitem == 2) // KneeHead Fighting Style
  265.             {
  266.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_KNEEHEAD);
  267.                 SendClientMessage(playerid, -1, "* You have changed your fighting style to a KneeHead Fighting Style.");
  268.             }
  269.             if(listitem == 4) // GrabKick Fighting Style
  270.             {
  271.                 SetPlayerFightingStyle(playerid, FIGHT_STYLE_GRABKICK);
  272.                 SendClientMessage(playerid, -1, "* You have changed your fighting style to a GrabKick Fighting Style.");
  273.             }
  274.             if(listitem == 5) // Elbow Fighting Style
  275.             {
  276.                 SetPlayerFightingStyle(playerid,  FIGHT_STYLE_ELBOW);
  277.                 SendClientMessage(playerid, -1, "* You have changed your fighting style to a Elbow Fighting Style.");
  278.             }
  279.         }
  280.         return 1; // We handled a dialog, so return 1. Just like OnPlayerCommandText.
  281.     }
  282.     return 0; // You MUST return 0 here! Just like OnPlayerCommandText.
  283. }
  284.  
  285. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  286. {
  287.     return 1;
  288. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement