#include forward OnPlayerEnterStreakRcVehicle(playerid, vehicleid); forward OnPlayerDetonateStreakRcVehicle(playerid, vehicleid); forward OnPlayerExitStreakRcVehicle(playerid); public OnPlayerDisconnect(playerid, reason) { DestroyVehicle(GetPVarInt(playerid, "KSV")); return 1; } stock PutPlayerInStreakRcVehicle(playerid) { new Float:Pos[4]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); GetPlayerFacingAngle(playerid, Pos[3]); SetPVarFloat(playerid, "rcX", Pos[0]); SetPVarFloat(playerid, "rcY", Pos[1]); SetPVarFloat(playerid, "rcZ", Pos[2]); SetPVarFloat(playerid, "rcA", Pos[3]); new veh = CreateVehicle(441, Pos[0], Pos[1], Pos[2], Pos[3], -1, -1, 0); PutPlayerInVehicle(playerid, veh, 0); SetPVarInt(playerid, "KSV", veh); CallLocalFunction("OnPlayerEnterStreakRcVehicle", "ii", playerid, veh); } public OnVehicleDeath(vehicleid) { for(new i; i < MAX_PLAYERS; i++) { if(GetPVarInt(i, "KSV") == vehicleid) { OnPlayerKeyStateChange(i, KEY_FIRE, 0); break; } } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(newkeys & KEY_FIRE && !(oldkeys & KEY_FIRE)) { if(GetPVarInt(playerid, "rcTimer") > 0) { ReturnPlayerToNormalState(playerid); KillTimer(GetPVarInt(playerid, "rcTimer")); DeletePVar(playerid, "rcTimer"); return 1; } if(GetPVarInt(playerid, "KSV")) //KillStreakVehicle { new Float:Pos[6]; GetVehiclePos(GetPVarInt(playerid, "KSV"), Pos[0], Pos[1], Pos[2]); SetPlayerPos(playerid, GetPVarFloat(playerid, "rcX"), GetPVarFloat(playerid, "rcY"), GetPVarFloat(playerid, "rcZ")); SetPlayerFacingAngle(playerid, GetPVarFloat(playerid, "rcA")); //3 Explosion for impact CreateExplosion(Pos[0] + floatdiv(random(250), 100), Pos[1] + floatdiv(random(250), 100), Pos[2] + floatdiv(random(250), 100), 7, 12); CreateExplosion(Pos[0] + floatdiv(random(250), 100), Pos[1] + floatdiv(random(250), 100), Pos[2] + floatdiv(random(250), 100), 7, 12); CreateExplosion(Pos[0] + floatdiv(random(250), 100), Pos[1] + floatdiv(random(250), 100), Pos[2] + floatdiv(random(250), 100), 7, 12); new Float:angle = float( random( 360 ) ); Pos[3] = Pos[0] + 15 * floatsin(-angle, degrees); Pos[4] = Pos[1] + 15 * floatcos(-angle, degrees); Pos[5] = float( random( 18 ) ); SetPlayerCameraPos(playerid, Pos[3], Pos[4], Pos[5]); SetPlayerCameraLookAt(playerid, Pos[0], Pos[1], Pos[2]); SetTimerEx("GoAwayWithVehicleDamnit", 500, 0, "i", GetPVarInt(playerid, "KSV")); SetPVarInt(playerid, "rcTimer", SetTimerEx("ReturnPlayerToNormalState", 3250, 0, "i", playerid) + 1); CallLocalFunction("OnPlayerDetonateStreakRcVehicle", "ii", playerid, GetPVarInt(playerid, "KSV")); DeletePVar(playerid, "KSV"); return 1; } } return 1; } forward GoAwayWithVehicleDamnit(vehicleid); public GoAwayWithVehicleDamnit(vehicleid) { //Major function, I know lolz DestroyVehicle(vehicleid); } forward ReturnPlayerToNormalState(playerid); public ReturnPlayerToNormalState(playerid) { DeletePVar(playerid, "rcTimer"); SetCameraBehindPlayer(playerid); CallLocalFunction("OnPlayerExitStreakRcVehicle", "i", playerid); }