Guest User

Hiddos

a guest
Nov 11th, 2010
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.33 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. forward PutPlayerInStreakRcVehicle(playerid);
  17. public PutPlayerInStreakRcVehicle(playerid)
  18. {
  19.     new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]);
  20.     SetPVarFloat(playerid, "rcX", Pos[0]);
  21.     SetPVarFloat(playerid, "rcY", Pos[1]);
  22.     SetPVarFloat(playerid, "rcZ", Pos[2]);
  23.     SetPVarFloat(playerid, "rcA", Pos[3]);
  24.     GetPlayerFacingAngle(playerid, Pos[3]);
  25.     new veh = CreateVehicle(441, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, 0);
  26.     PutPlayerInVehicle(playerid, veh, 0);
  27.     SetPVarInt(playerid, "KSV", veh);
  28.     CallRemoteFunction("OnPlayerEnterStreakRcVehicle", "ii", playerid, veh);
  29. }
  30.  
  31. public OnVehicleDeath(vehicleid)
  32. {
  33.     for(new i; i < MAX_PLAYERS; i++)
  34.     {
  35.         if(GetPVarInt(i, "KSV") == vehicleid) OnPlayerKeyStateChange(i, KEY_FIRE, 0);
  36.            
  37.     }
  38.     return 1;
  39. }
  40.  
  41. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  42. {
  43.     if(newkeys & KEY_FIRE && !(oldkeys & KEY_FIRE))
  44.     {
  45.         if(GetPVarInt(playerid, "rcTimer") > 0)
  46.         {
  47.             ReturnPlayerToNormalState(playerid);
  48.             KillTimer(GetPVarInt(playerid, "rcTimer"));
  49.             DeletePVar(playerid, "rcTimer");
  50.             return 1;
  51.         }
  52.        
  53.         if(GetPVarInt(playerid, "KSV")) //KillStreakVehicle
  54.         {
  55.             new Float:Pos[6]; GetVehiclePos(GetPVarInt(playerid, "KSV"), Pos[0], Pos[1], Pos[2]);
  56.             SetPlayerPos(playerid, GetPVarFloat(playerid, "rcX"), GetPVarFloat(playerid, "rcY"), GetPVarFloat(playerid, "rcZ"));
  57.             SetPlayerFacingAngle(playerid, GetPVarFloat(playerid, "rcA"));
  58. //3 Explosion for impact
  59.             CreateExplosion(Pos[0] + floatdiv(random(250), 100), Pos[1] + floatdiv(random(250), 100), Pos[2] + floatdiv(random(250), 100), 7, 12);
  60.             CreateExplosion(Pos[0] + floatdiv(random(250), 100), Pos[1] + floatdiv(random(250), 100), Pos[2] + floatdiv(random(250), 100), 7, 12);
  61.             CreateExplosion(Pos[0] + floatdiv(random(250), 100), Pos[1] + floatdiv(random(250), 100), Pos[2] + floatdiv(random(250), 100), 7, 12);
  62.            
  63.             new Float:angle = float( random( 360 ) );
  64.             Pos[3] = Pos[0] + 15 * floatsin(-angle, degrees);
  65.             Pos[4] = Pos[1] + 15 * floatcos(-angle, degrees);
  66.             Pos[5] = float( random( 18 ) );
  67.             SetPlayerCameraPos(playerid, Pos[3], Pos[4], Pos[5]);
  68.             SetPlayerCameraLookAt(playerid, Pos[0], Pos[1], Pos[2]);
  69.            
  70.             SetTimerEx("GoAwayWithVehicleDamnit", 500, 0, "i", GetPVarInt(playerid, "KSV"));
  71.             DeletePVar(playerid, "KSV");
  72.             SetPVarInt(playerid, "rcTimer", SetTimerEx("ReturnPlayerToNormalState", 3250, 0, "i", playerid) + 1);
  73.             CallRemoteFunction("OnPlayerDetonateStreakRcVehicle", "ifff", playerid, Pos[0], Pos[1], Pos[2]);
  74.             return 1;
  75.         }
  76.     }
  77.     return 1;
  78. }
  79.  
  80. forward GoAwayWithVehicleDamnit(vehicleid);
  81. public GoAwayWithVehicleDamnit(vehicleid)
  82. {   //Major function, I know lolz
  83.     DestroyVehicle(vehicleid);
  84. }
  85.  
  86. forward ReturnPlayerToNormalState(playerid);
  87. public ReturnPlayerToNormalState(playerid)
  88. {
  89.     DeletePVar(playerid, "rcTimer");
  90.     SetCameraBehindPlayer(playerid);
  91.     CallRemoteFunction("OnPlayerExitStreakRcVehicle", "i", playerid);
  92. }
Advertisement
Add Comment
Please, Sign In to add comment