Guest User

Shoot And teleport :)

a guest
Jun 30th, 2014
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.56 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. #include <zcmd>
  7.  
  8. /////+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++////
  9. new ModeOn = 0;
  10.  
  11. #if defined FILTERSCRIPT
  12.  
  13. public OnFilterScriptInit()
  14. {
  15. print("\n--------------------------------------");
  16. print(" Shoot And teleport");
  17. print("--------------------------------------\n");
  18. return 1;
  19. }
  20.  
  21. public OnFilterScriptExit()
  22. {
  23. return 1;
  24. }
  25.  
  26. #else
  27.  
  28. main()
  29. {
  30. print("\n----------------------------------");
  31. print(" Blank Gamemode by your name here");
  32. print("----------------------------------\n");
  33. }
  34.  
  35. #endif
  36.  
  37. public OnGameModeInit()
  38. {
  39. // Don't use these lines if it's a filterscript
  40. SetGameModeText("Blank Script");
  41. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  42. return 1;
  43. }
  44.  
  45. public OnGameModeExit()
  46. {
  47. return 1;
  48. }
  49.  
  50. public OnPlayerRequestClass(playerid, classid)
  51. {
  52. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  53. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  54. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  55. return 1;
  56. }
  57.  
  58. public OnPlayerConnect(playerid)
  59. {
  60. ModeOn = 0;
  61. return 1;
  62. }
  63.  
  64. public OnPlayerDisconnect(playerid, reason)
  65. {
  66. return 1;
  67. }
  68.  
  69. public OnPlayerSpawn(playerid)
  70. {
  71. ModeOn = 0;
  72. return 1;
  73. }
  74.  
  75. public OnPlayerDeath(playerid, killerid, reason)
  76. {
  77. ModeOn = 0;
  78. return 1;
  79. }
  80.  
  81. public OnVehicleSpawn(vehicleid)
  82. {
  83. return 1;
  84. }
  85.  
  86. public OnVehicleDeath(vehicleid, killerid)
  87. {
  88. return 1;
  89. }
  90.  
  91. public OnPlayerText(playerid, text[])
  92. {
  93. return 1;
  94. }
  95.  
  96. public OnPlayerCommandText(playerid, cmdtext[])
  97. {
  98. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  99. {
  100. // Do something here
  101. return 1;
  102. }
  103. return 0;
  104. }
  105.  
  106. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  107. {
  108. return 1;
  109. }
  110.  
  111. public OnPlayerExitVehicle(playerid, vehicleid)
  112. {
  113. return 1;
  114. }
  115.  
  116. public OnPlayerStateChange(playerid, newstate, oldstate)
  117. {
  118. return 1;
  119. }
  120.  
  121. public OnPlayerEnterCheckpoint(playerid)
  122. {
  123. return 1;
  124. }
  125.  
  126. public OnPlayerLeaveCheckpoint(playerid)
  127. {
  128. return 1;
  129. }
  130.  
  131. public OnPlayerEnterRaceCheckpoint(playerid)
  132. {
  133. return 1;
  134. }
  135.  
  136. public OnPlayerLeaveRaceCheckpoint(playerid)
  137. {
  138. return 1;
  139. }
  140.  
  141. public OnRconCommand(cmd[])
  142. {
  143. return 1;
  144. }
  145.  
  146. public OnPlayerRequestSpawn(playerid)
  147. {
  148. return 1;
  149. }
  150.  
  151. public OnObjectMoved(objectid)
  152. {
  153. return 1;
  154. }
  155.  
  156. public OnPlayerObjectMoved(playerid, objectid)
  157. {
  158. return 1;
  159. }
  160.  
  161. public OnPlayerPickUpPickup(playerid, pickupid)
  162. {
  163. return 1;
  164. }
  165.  
  166. public OnVehicleMod(playerid, vehicleid, componentid)
  167. {
  168. return 1;
  169. }
  170.  
  171. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  172. {
  173. return 1;
  174. }
  175.  
  176. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  177. {
  178. return 1;
  179. }
  180.  
  181. public OnPlayerSelectedMenuRow(playerid, row)
  182. {
  183. return 1;
  184. }
  185.  
  186. public OnPlayerExitedMenu(playerid)
  187. {
  188. return 1;
  189. }
  190.  
  191. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  192. {
  193. return 1;
  194. }
  195.  
  196. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  197. {
  198. return 1;
  199. }
  200.  
  201. public OnRconLoginAttempt(ip[], password[], success)
  202. {
  203. return 1;
  204. }
  205.  
  206. public OnPlayerUpdate(playerid)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnPlayerStreamIn(playerid, forplayerid)
  212. {
  213. return 1;
  214. }
  215.  
  216. public OnPlayerStreamOut(playerid, forplayerid)
  217. {
  218. return 1;
  219. }
  220.  
  221. public OnVehicleStreamIn(vehicleid, forplayerid)
  222. {
  223. return 1;
  224. }
  225.  
  226. public OnVehicleStreamOut(vehicleid, forplayerid)
  227. {
  228. return 1;
  229. }
  230.  
  231. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  232. {
  233. return 1;
  234. }
  235.  
  236. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  237. {
  238. return 1;
  239. }
  240.  
  241. public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
  242. {
  243. if(GetPlayerWeapon(playerid) != 34) return 1;
  244. if(ModeOn == 1)
  245. {
  246. new lsString[128],
  247. Float:fOriginX, Float:fOriginY, Float:fOriginZ,
  248. Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
  249. GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
  250. format(lsString, 128, "Last Shot Information: Origin: %f, %f, %f. Hit position: %f, %f, %f", fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
  251. SendClientMessage(playerid, -1, lsString);
  252. SetPlayerPos(playerid, fHitPosX, fHitPosY, fHitPosZ + 3);
  253. }
  254.  
  255. return 1;
  256. }
  257.  
  258. CMD:telemodeon(playerid, params[])
  259. {
  260. SetPlayerHealth(playerid, 99999);
  261. ModeOn = 1;
  262. }
  263.  
  264. CMD:telemodeoff(playerid, params[])
  265. {
  266. SetPlayerHealth(playerid, 100);
  267. ModeOn = 0;
  268. }
Advertisement
Add Comment
Please, Sign In to add comment