Advertisement
Guest User

Degalu sistema

a guest
Jun 19th, 2013
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.36 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. #if defined FILTERSCRIPT
  8.  
  9. public OnFilterScriptInit()
  10. {
  11. print("\n--------------------------------------");
  12. print(" NMG 1.0");
  13. print("--------------------------------------\n");
  14. return 1;
  15. }
  16.  
  17. public OnFilterScriptExit()
  18. {
  19. return 1;
  20. }
  21.  
  22. #else
  23.  
  24. main()
  25. {
  26. print("\n----------------------------------");
  27. print(" NMG 1.0");
  28. print("----------------------------------\n");
  29. }
  30.  
  31. #endif
  32. forward SetPlayerSpeedCap( playerid, Float:value );
  33. forward DisablePlayerSpeedCap( playerid );
  34. new
  35. Float:g_fSpeedCap[ MAX_PLAYERS ] = { 0.0, ... }
  36. ;
  37. new
  38. bool:GreicioMatvaimas[ MAX_PLAYERS ]
  39. ;
  40.  
  41.  
  42. public OnGameModeExit()
  43. {
  44. return 1;
  45. }
  46.  
  47.  
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51. return 1;
  52. }
  53.  
  54. public OnPlayerDisconnect(playerid, reason)
  55. {
  56. return 1;
  57. }
  58.  
  59. public OnPlayerSpawn(playerid)
  60. {
  61. return 1;
  62. }
  63.  
  64. public OnPlayerDeath(playerid, killerid, reason)
  65. {
  66. return 1;
  67. }
  68.  
  69. public OnVehicleSpawn(vehicleid)
  70. {
  71. return 1;
  72. }
  73.  
  74. public OnVehicleDeath(vehicleid, killerid)
  75. {
  76. return 1;
  77. }
  78.  
  79. public OnPlayerText(playerid, text[])
  80. {
  81. return 1;
  82. }
  83.  
  84. public OnPlayerCommandText(playerid, cmdtext[])
  85. {
  86. if(strcmp(cmdtext, "/kuras", true) == 0 )
  87. {
  88. if(!IsPlayerInAnyVehicle(playerid)){
  89. SendClientMessage(playerid,0x33AA33AA,"Jûs ne maðinoje");
  90. return 1;
  91. }
  92.  
  93. if( GreicioMatvaimas[ playerid ] == false )
  94. {
  95.  
  96. GreicioMatvaimas[ playerid ] = true;
  97.  
  98. SetPlayerSpeedCap( playerid, 0.5 );
  99.  
  100. SendClientMessage(playerid, 0x33AA33AA, "Perjungiai á dujas");
  101. GameTextForPlayer(playerid, "~g~Perjungiai á dujas!", 2000, 3);
  102. }
  103. else
  104. {
  105. GreicioMatvaimas[ playerid ] = false;
  106.  
  107. DisablePlayerSpeedCap( playerid );
  108.  
  109. SendClientMessage(playerid, 0x33AA33AA, "Perjungiai á bendzinà");
  110. GameTextForPlayer(playerid, "~r~Perjungiai á bendzinà!", 2000, 3);
  111. }
  112. return true;
  113. }
  114. return 0;
  115. }
  116.  
  117. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  118. {
  119. if( GreicioMatvaimas[ playerid ] == true )
  120. SetPlayerSpeedCap( playerid, 0.5 );
  121. else
  122. DisablePlayerSpeedCap( playerid );
  123. }
  124.  
  125. public OnPlayerExitVehicle(playerid, vehicleid)
  126. {
  127. return 1;
  128. }
  129.  
  130. public OnPlayerStateChange(playerid, newstate, oldstate)
  131. {
  132. return 1;
  133. }
  134.  
  135. public OnPlayerEnterCheckpoint(playerid)
  136. {
  137. return 1;
  138. }
  139.  
  140. public OnPlayerLeaveCheckpoint(playerid)
  141. {
  142. return 1;
  143. }
  144.  
  145. public OnPlayerEnterRaceCheckpoint(playerid)
  146. {
  147. return 1;
  148. }
  149.  
  150. public OnPlayerLeaveRaceCheckpoint(playerid)
  151. {
  152. return 1;
  153. }
  154.  
  155. public OnRconCommand(cmd[])
  156. {
  157. return 1;
  158. }
  159.  
  160. public OnPlayerRequestSpawn(playerid)
  161. {
  162. return 1;
  163. }
  164.  
  165. public OnObjectMoved(objectid)
  166. {
  167. return 1;
  168. }
  169.  
  170. public OnPlayerObjectMoved(playerid, objectid)
  171. {
  172. return 1;
  173. }
  174.  
  175. public OnPlayerPickUpPickup(playerid, pickupid)
  176. {
  177. return 1;
  178. }
  179.  
  180. public OnVehicleMod(playerid, vehicleid, componentid)
  181. {
  182. return 1;
  183. }
  184.  
  185. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  186. {
  187. return 1;
  188. }
  189.  
  190. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  191. {
  192. return 1;
  193. }
  194.  
  195. public OnPlayerSelectedMenuRow(playerid, row)
  196. {
  197. return 1;
  198. }
  199.  
  200. public OnPlayerExitedMenu(playerid)
  201. {
  202. return 1;
  203. }
  204.  
  205. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  206. {
  207. return 1;
  208. }
  209.  
  210. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  211. {
  212. return 1;
  213. }
  214.  
  215. public OnRconLoginAttempt(ip[], password[], success)
  216. {
  217. return 1;
  218. }
  219. forward OnPlayerUpdate(playerid);
  220. public OnPlayerUpdate(playerid)
  221. {
  222. static
  223. s_iVehicle
  224. ;
  225.  
  226. if ( g_fSpeedCap[ playerid ] != 0.0 && GetPlayerState( playerid ) == PLAYER_STATE_DRIVER )
  227. {
  228. s_iVehicle = GetPlayerVehicleID( playerid );
  229.  
  230. if ( s_iVehicle )
  231. {
  232. static
  233. Float:s_fX,
  234. Float:s_fY,
  235. Float:s_fZ,
  236. Float:s_fVX,
  237. Float:s_fVY,
  238. Float:s_fVZ
  239. ;
  240.  
  241. GetVehiclePos( s_iVehicle, s_fX, s_fY, s_fZ );
  242. GetVehicleVelocity( s_iVehicle, s_fVX, s_fVY, s_fVZ );
  243.  
  244. if ( !IsPlayerInRangeOfPoint( playerid, g_fSpeedCap[ playerid ] + 0.03, s_fX + s_fVX, s_fY + s_fVY, s_fZ + s_fVZ ) )
  245. {
  246. static
  247. Float:s_fLength
  248. ;
  249.  
  250. s_fLength = floatsqroot( ( s_fVX * s_fVX ) + ( s_fVY * s_fVY ) + ( s_fVZ * s_fVZ ) );
  251.  
  252. s_fVX = ( s_fVX / s_fLength ) * g_fSpeedCap[ playerid ];
  253. s_fVY = ( s_fVY / s_fLength ) * g_fSpeedCap[ playerid ];
  254. s_fVZ = ( s_fVZ / s_fLength ) * g_fSpeedCap[ playerid ];
  255.  
  256. if ( s_iVehicle )
  257. SetVehicleVelocity( s_iVehicle, s_fVX, s_fVY, s_fVZ );
  258. else
  259. SetPlayerVelocity( playerid, s_fVX, s_fVY, s_fVZ );
  260. }
  261. }
  262. }
  263.  
  264. return 1;
  265. }
  266. public SetPlayerSpeedCap( playerid, Float:value )
  267. {
  268. if ( 0 <= playerid < sizeof( g_fSpeedCap ) )
  269. g_fSpeedCap[ playerid ] = value;
  270. }
  271.  
  272. public DisablePlayerSpeedCap( playerid )
  273. {
  274. if ( 0 <= playerid < sizeof( g_fSpeedCap ) )
  275. g_fSpeedCap[ playerid ] = 0.0;
  276. }
  277.  
  278.  
  279. public OnPlayerStreamIn(playerid, forplayerid)
  280. {
  281. return 1;
  282. }
  283.  
  284. public OnPlayerStreamOut(playerid, forplayerid)
  285. {
  286. return 1;
  287. }
  288.  
  289. public OnVehicleStreamIn(vehicleid, forplayerid)
  290. {
  291. return 1;
  292. }
  293.  
  294. public OnVehicleStreamOut(vehicleid, forplayerid)
  295. {
  296. return 1;
  297. }
  298.  
  299. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  300. {
  301. return 1;
  302. }
  303.  
  304. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  305. {
  306. return 1;
  307. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement