Advertisement
Guest User

Untitled

a guest
Aug 24th, 2014
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.61 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new
  4. bool:swimming[ MAX_PLAYERS ]
  5. ;
  6.  
  7. forward OnPlayerStartSwimming( playerid ) ;
  8. forward OnPlayerStopSwimming( playerid );
  9. forward IsPlayerSwimming( playerid );
  10.  
  11. main()
  12. {
  13. print("ON") ;
  14. }
  15.  
  16. public OnGameModeInit()
  17. {
  18. SetGameModeText( "0.0.1" ) ;
  19. AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  20. return 1;
  21. }
  22.  
  23. public OnGameModeExit()
  24. {
  25. return 1;
  26. }
  27.  
  28. public OnPlayerRequestClass(playerid, classid)
  29. {
  30. return 1;
  31. }
  32.  
  33. public OnPlayerConnect(playerid)
  34. {
  35. return 1;
  36. }
  37.  
  38. public OnPlayerDisconnect(playerid, reason)
  39. {
  40. return 1;
  41. }
  42.  
  43. public OnPlayerSpawn(playerid)
  44. {
  45. return 1;
  46. }
  47.  
  48. public OnPlayerDeath(playerid, killerid, reason)
  49. {
  50. return 1;
  51. }
  52.  
  53. public OnVehicleSpawn(vehicleid)
  54. {
  55. return 1;
  56. }
  57.  
  58. public OnVehicleDeath(vehicleid, killerid)
  59. {
  60. return 1;
  61. }
  62.  
  63. public OnPlayerText(playerid, text[])
  64. {
  65. return 1;
  66. }
  67.  
  68.  
  69. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  70. {
  71. return 1;
  72. }
  73.  
  74. public OnPlayerExitVehicle(playerid, vehicleid)
  75. {
  76. return 1;
  77. }
  78.  
  79. public OnPlayerStateChange(playerid, newstate, oldstate)
  80. {
  81. return 1;
  82. }
  83.  
  84. public OnPlayerEnterCheckpoint(playerid)
  85. {
  86. return 1;
  87. }
  88.  
  89. public OnPlayerLeaveCheckpoint(playerid)
  90. {
  91. return 1;
  92. }
  93.  
  94. public OnPlayerEnterRaceCheckpoint(playerid)
  95. {
  96. return 1;
  97. }
  98.  
  99. public OnPlayerLeaveRaceCheckpoint(playerid)
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnRconCommand(cmd[])
  105. {
  106. return 1;
  107. }
  108.  
  109. public OnPlayerRequestSpawn(playerid)
  110. {
  111. return 1;
  112. }
  113.  
  114. public OnObjectMoved(objectid)
  115. {
  116. return 1;
  117. }
  118.  
  119. public OnPlayerObjectMoved(playerid, objectid)
  120. {
  121. return 1;
  122. }
  123.  
  124. public OnPlayerPickUpPickup(playerid, pickupid)
  125. {
  126. return 1;
  127. }
  128.  
  129. public OnVehicleMod(playerid, vehicleid, componentid)
  130. {
  131. return 1;
  132. }
  133.  
  134. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  135. {
  136. return 1;
  137. }
  138.  
  139. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  140. {
  141. return 1;
  142. }
  143.  
  144. public OnPlayerSelectedMenuRow(playerid, row)
  145. {
  146. return 1;
  147. }
  148.  
  149. public OnPlayerExitedMenu(playerid)
  150. {
  151. return 1;
  152. }
  153.  
  154. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  155. {
  156. return 1;
  157. }
  158.  
  159. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  160. {
  161. return 1;
  162. }
  163.  
  164. public OnRconLoginAttempt(ip[], password[], success)
  165. {
  166. return 1;
  167. }
  168.  
  169. public OnPlayerUpdate(playerid)
  170. {
  171. if(GetPlayerAnimationIndex(playerid))
  172. {
  173. new animlib[32];
  174. new animname[32];
  175. GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
  176. if(strcmp(animlib, "SWIM", true) == 0 && !swimming[playerid])
  177. {
  178. swimming[playerid] = true;
  179. OnPlayerStartSwimming(playerid);
  180. }
  181. else if(strcmp(animlib, "SWIM", true) != 0 && swimming[playerid] && strfind(animname, "jump", true) == -1)
  182. {
  183. swimming[playerid] = false;
  184. OnPlayerStopSwimming(playerid);
  185. }
  186. }
  187. else if(swimming[playerid])
  188. {
  189. swimming[playerid] = false;
  190. OnPlayerStopSwimming(playerid);
  191. }
  192. return 1;
  193. }
  194.  
  195. public OnPlayerStreamIn(playerid, forplayerid)
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnPlayerStreamOut(playerid, forplayerid)
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnVehicleStreamIn(vehicleid, forplayerid)
  206. {
  207. return 1;
  208. }
  209.  
  210. public OnVehicleStreamOut(vehicleid, forplayerid)
  211. {
  212. return 1;
  213. }
  214.  
  215. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  216. {
  217. return 1;
  218. }
  219.  
  220. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  221. {
  222. return 1;
  223. }
  224.  
  225. stock IsPlayerInWater( playerid ) {
  226. new Float:Z;
  227. GetPlayerPos(playerid, Z, Z, Z);
  228. if(Z < 0.7) switch(GetPlayerAnimationIndex(playerid)) { case 1543,1538,1539,1250: return (true); }
  229. if(GetPlayerDistanceFromPoint(playerid, -965, 2438, 42) <= 700 && Z < 45) return (true);
  230. new Float:water_places[][] =
  231. {
  232. {25.0, 2313.0, -1417.0, 23.0},
  233. {15.0, 1280.0, -773.0, 1082.0},
  234. {15.0, 1279.0, -804.0, 86.0},
  235. {20.0, 1094.0, -674.0, 111.0},
  236. {26.0, 194.0, -1232.0, 76.0},
  237. {25.0, 2583.0, 2385.0, 15.0},
  238. {25.0, 225.0, -1187.0, 73.0},
  239. {50.0, 1973.0, -1198.0, 17.0}
  240. };
  241. for(new t=0; t < sizeof water_places; t++)
  242. if(GetPlayerDistanceFromPoint(playerid, water_places[t][1], water_places[t][2], water_places[t][3]) <= water_places[t][0]) return (true);
  243. return (false);
  244. }
  245.  
  246. public IsPlayerSwimming(playerid)
  247. {
  248. if(swimming[playerid]) return 1;
  249. return 0;
  250. }
  251.  
  252. public OnPlayerStartSwimming(playerid)
  253. {
  254. if( !IsPlayerInWater( playerid ) ) SendClientMessage( playerid, -1, "FLY HACK DETECTED !" ) ;
  255. return 1;
  256. }
  257.  
  258. public OnPlayerStopSwimming(playerid)
  259. {
  260. return 1;
  261. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement