Advertisement
DarkZeroX

Untitled

Jun 10th, 2014
485
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.70 KB | None | 0 0
  1. #include <a_samp>
  2. #include <zcmd>
  3. #include <sscanf2>
  4.  
  5. new LastCarSpawn[MAX_PLAYERS],
  6. LastJumpCar[MAX_PLAYERS],
  7. LastBoostCar[MAX_PLAYERS],
  8. Float:Velocity[3];
  9.  
  10. forward ResetJump(playerid);
  11. forward ResetBoost(playerid);
  12.  
  13.  
  14. public OnPlayerConnect(playerid)
  15. {
  16. LastCarSpawn[playerid] = -1; LastStuntSpawn[playerid] = -1; LastJumpCar[playerid] = -1; LastBoostCar[playerid] = -1;
  17. return 1;
  18. }
  19.  
  20. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  21. {
  22. if(newkeys == KEY_YES)
  23. {
  24. if(IsPlayerInAnyVehicle(playerid))
  25. {
  26. if(LastJumpCar[playerid] != -1)
  27. {
  28. SendClientMessage(playerid,-1,"{F60121}[Erreur:] Le JUMP de votre véhicule n'est pas écoulé.");
  29. return 1;
  30. }
  31. new vehicleid; vehicleid = GetPlayerVehicleID(playerid);
  32. SetVelocityCar(vehicleid,0.0,0.0,0.3);
  33. LastJumpCar[playerid] = 1;
  34. SetTimerEx("ResetJump",5000,0,"i",playerid);
  35. }
  36. return 1;
  37. }
  38. if(newkeys == KEY_CROUCH)
  39. {
  40. if(IsPlayerInAnyVehicle(playerid))
  41. {
  42. if(LastBoostCar[playerid] != -1)
  43. {
  44. SendClientMessage(playerid,-1,"{F60121}[Erreur:] Le boost de votre véhicule n'est pas écoulé.");
  45. return 1;
  46. }
  47. new vehicleid; vehicleid = GetPlayerVehicleID(playerid);
  48. SetVelocityCar(vehicleid,0.0,0.3,0.0);
  49. LastBoostCar[playerid] = 1;
  50. SetTimerEx("ResetBoost",5000,0,"i",playerid);
  51. }
  52. return 1;
  53. }
  54. return 1;
  55. }
  56.  
  57.  
  58. public ResetJump(playerid)
  59. {
  60. SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}Le jump est de nouveau opérationnel");
  61. LastJumpCar[playerid] = -1;
  62. return 1;
  63. }
  64.  
  65.  
  66. public ResetBoost(playerid)
  67. {
  68. SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}Le boost est de nouveau opérationnel");
  69. LastBoostCar[playerid] = -1;
  70. return 1;
  71. }
  72.  
  73.  
  74. stock SetVelocityCar(vehicleid,Float:X,Float:Y,Float:Z)
  75. {
  76. GetVehicleVelocity(vehicleid,Velocity[0], Velocity[1], Velocity[2]);
  77. SetVehicleVelocity(vehicleid,Velocity[0]+X, Velocity[1]+Y, Velocity[2]+Z);
  78. return 1;
  79. }
  80.  
  81.  
  82.  
  83. COMMAND:creerveh(playerid,params[])
  84. {
  85. new idcar, idcolor[2],Float:Pos[3];
  86. if(sscanf(params, "iii", idcar,idcolor[0],idcolor[1])) return SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}/creerveh <id> <couleur1> <couleur2>");
  87. {
  88. if(idcar > 399 && idcar < 613)
  89. {
  90. if(LastCarSpawn[playerid] != -1)
  91. DestroyVehicle(LastCarSpawn[playerid]);
  92.  
  93. GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);
  94. LastCarSpawn[playerid] = CreateVehicle(idcar,Pos[0],Pos[1],Pos[2], 0.0,idcolor[0],idcolor[1], 0);
  95. PutPlayerInVehicle(playerid,LastCarSpawn[playerid],0);
  96.  
  97. SendClientMessage(playerid,-1,"{ADAEAD}[Info:] {C5F601}Véhicule spawn");
  98. return 1;
  99. }
  100. SendClientMessage(playerid,-1,"{F60121}[Erreur:] L'id du véhicule n'est pas la bonne");
  101.  
  102. }
  103. return 1;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement