Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.92 KB | None | 0 0
  1. #include <a_samp>
  2. public OnFilterScriptInit()
  3. {
  4.     print("\n--------------------------------------");
  5.     print("RC Boom Boom FS \nbased on the killstreak in \nCall of Duty: Black ops");
  6.     print("Script created by Hiddos (McFaik)\n--------------------------------------\n");
  7.     return 1;
  8. }
  9.  
  10. public OnPlayerDisconnect(playerid, reason)
  11. {
  12.     DestroyVehicle(GetPVarInt(playerid, "KSV"));
  13.     return 1;
  14. }
  15.  
  16. public OnPlayerCommandText(playerid, cmdtext[])
  17. {
  18.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  19.     {
  20.     }
  21.     return 0;
  22. }
  23.  
  24. forward PutPlayerInRcKillstreakVehicle(playerid);
  25. public PutPlayerInRcKillstreakVehicle(playerid)
  26. {
  27.     new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  28.     SetPVarFloat(playerid, "rcX", Pos[0]);
  29.     SetPVarFloat(playerid, "rcY", Pos[1]);
  30.     SetPVarFloat(playerid, "rcZ", Pos[2]);
  31.     SetPVarFloat(playerid, "rcA", Pos[3]);
  32.     GetPlayerFacingAngle(playerid, Pos[3]);
  33.     new veh = CreateVehicle(441, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, 0);
  34.     PutPlayerInVehicle(playerid, veh, 0);
  35.     SetPVarInt(playerid, "KSV", veh);
  36.     CallRemoteFunction("OnPlayerEnterStreakRcVehicle", "ii", playerid, veh);
  37. }
  38.  
  39. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  40. {
  41.     if(newkeys & KEY_FIRE && !(oldkeys & KEY_FIRE))
  42.     {
  43.         if(GetPVarInt(playerid, "rcTimer") > 0)
  44.         {
  45.             ReturnPlayerToNormalState(playerid);
  46.             KillTimer(GetPVarInt(playerid, "rcTimer"));
  47.             DeletePVar(playerid, "rcTimer");
  48.             return 1;
  49.         }
  50.        
  51.         if(GetPVarInt(playerid, "KSV")) //KillStreakVehicle
  52.         {
  53.             new Float:Pos[6]; GetVehiclePos(GetPVarInt(playerid, "KSV"), Pos[0], Pos[1], Pos[2]);
  54.             SetPlayerPos(playerid, GetPVarFloat(playerid, "rcX"), GetPVarFloat(playerid, "rcY"), GetPVarFloat(playerid, "rcZ"));
  55.             SetPlayerFacingAngle(playerid, GetPVarFloat(playerid, "rcA"));
  56. //3 Explosion for impact
  57.             CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 12);
  58.             CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 12);
  59.             CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 12);
  60.            
  61.             new Float:angle = float( random( 360 ) );
  62.             Pos[3] = Pos[0] + 15 * floatsin(-angle, degrees);
  63.             Pos[4] = Pos[1] + 15 * floatcos(-angle, degrees);
  64.             Pos[5] = float( random( 18 ) );
  65.             SetPlayerCameraPos(playerid, Pos[3], Pos[4], Pos[5]);
  66.             SetPlayerCameraLookAt(playerid, Pos[0], Pos[1], Pos[2]);
  67.            
  68.             SetTimerEx("GoAwayWithVehicleDamnit", 500, 0, "i", GetPVarInt(playerid, "KSV"));
  69.             DeletePVar(playerid, "KSV");
  70.             SetPVarInt(playerid, "rcTimer", SetTimerEx("ReturnPlayerToNormalState", 3250, 0, "i", playerid) + 1);
  71.             return 1;
  72.         }
  73.     }
  74.     return 1;
  75. }
  76.  
  77. forward GoAwayWithVehicleDamnit(vehicleid);
  78. public GoAwayWithVehicleDamnit(vehicleid)
  79. {   //Major function, I know lolz
  80.     DestroyVehicle(vehicleid);
  81. }
  82.  
  83. forward ReturnPlayerToNormalState(playerid);
  84. public ReturnPlayerToNormalState(playerid)
  85. {
  86.     DeletePVar(playerid, "rcTimer");
  87.     SetCameraBehindPlayer(playerid);
  88.     CallRemoteFunction("OnPlayerExitStreakRcVehicle", "i", playerid);
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement