Hi I would like to present include for Vehicle Missile Launcher.
Video:
https://www.youtube.com/watch?v=Pd5HmlL8uXw
Functions:
Definitions:
Example Command:
Download:
VehicleMissile.inc
Missile.inc
3DTryg.inc
ATM.inc
See also Missile Launcher
Video:
https://www.youtube.com/watch?v=Pd5HmlL8uXw
Functions:
PHP Code:
ToggleVehicleMiniMissile(vehicleid,toggle); //active hydra rocket weapon
ToggleVehicleHeavyMissile(vehicleid,toggle); //active heavy rocket weapon
ToggleVehicleRhinoMissile(vehicleid,toggle); //active shoots the front part of the vehicle
ToggleVehicleBomberMissile(vehicleid,toggle); //active bomber weapon
IsToggleVehicleMiniMissile(vehicleid); //checks whether an item is active
IsToggleVehicleHeavyMissile(vehicleid);
IsToggleVehicleRhinoMissile(vehicleid);
IsToggleVehicleBomberMissile(vehicleid);
SetVehicleMiniMissileSpeed(vehicleid,Float:speed); //set combat speed for Mini Missile
SetVehicleHeavyMissileSpeed(vehicleid,Float:speed); //set combat speed for Heavy Missile
SetVehicleBomberMissileSpeed(vehicleid,Float:speed); //set combat speed for Bomber Missile
GetVehicleMiniMissileSpeed(vehicleid);
GetVehicleHeavyMissileSpeed(vehicleid);
GetVehicleBomberMissileSpeed(vehicleid);
GetVehicleMiniMissileReload(vehicleid);
GetVehicleHeavyMissileReload(vehicleid);
GetVehicleBomberMissileReload(vehicleid);
GetVehicleRhinoMissileReload(vehicleid);
SetVehicleMiniMissileReload(vehicleid,time);
SetVehicleHeavyMissileReload(vehicleid,time);
SetVehicleBomberMissileReload(vehicleid,time);
SetVehicleRhinoMissileReload(vehicleid,time);
OnVehicleShot(playerid,type); //This function is automatically used in hook OnPlayerKeyStateChange
OnVehicleMissileInit(); //reset all settings
PHP Code:
Vehicle Missile Types:
VEHICLE_MISSILE_TYPE_MINI
VEHICLE_MISSILE_TYPE_HEAVY
VEHICLE_MISSILE_TYPE_BOMBER
VEHICLE_MISSILE_TYPE_RHINO
Other:
VEHICLE_MISSILE_SPEED_MINI // default combat speed for Mini Missile
VEHICLE_MISSILE_SPEED_HEAVY // default combat speed for Heavy Missile
VEHICLE_MISSILE_SPEED_BOMBER // default combat speed for Bomber Missile
VEHICLE_MISSILE_RELOAD_MINI // default reload time in milisecond for Mini Missile
VEHICLE_MISSILE_RELOAD_HEAVY // default reload time in milisecond for Heavy Missile
VEHICLE_MISSILE_RELOAD_BOMBER // default reload time in milisecond for Bomber Missile
VEHICLE_MISSILE_RELOAD_RHINO // default reload time in milisecond for Rhino Missile
PHP Code:
CMD:veharm(playerid,params[]){
if(!IsPlayerAdmin(playerid)) return 0;
new vehid, toggle_id, toggle_value, Float:arm_speed = 40.0, arm_reload;
if(sscanf(params,"dddF(-1)D(-1)",vehid,toggle_id,toggle_value,arm_speed,arm_reload)) return SendClientMessage(playerid,0xFFFFFFFF,"/veharm <vehicleid> <toggleid> <toggle> [speed = -1] [time = -1]");
if(toggle_value < 0 || toggle_value > 2) return SendClientMessage(playerid,0xFFFFFFFF,"Toggle Value: 0 - 1");
if((arm_speed <= 0.0 || arm_speed > 250.0) && arm_speed != -1) return SendClientMessage(playerid,0xFFFFFFFF,"Speed: 0.0 - 250.0");
switch(toggle_id){
case VEHICLE_MISSILE_TYPE_MINI: {
ToggleVehicleMiniMissile(vehid,toggle_value);
if(arm_speed == -1){
SetVehicleMiniMissileSpeed(vehid,VEHICLE_MISSILE_SPEED_MINI);
} else {
SetVehicleMiniMissileSpeed(vehid,arm_speed);
}
if(arm_reload == -1){
SetVehicleMiniMissileReload(vehid,VEHICLE_MISSILE_RELOAD_MINI);
} else {
SetVehicleMiniMissileReload(vehid,arm_reload);
}
}
case VEHICLE_MISSILE_TYPE_HEAVY: {
ToggleVehicleHeavyMissile(vehid,toggle_value);
if(arm_speed == -1){
SetVehicleHeavyMissileSpeed(vehid,VEHICLE_MISSILE_SPEED_HEAVY);
} else {
SetVehicleHeavyMissileSpeed(vehid,arm_speed);
}
if(arm_reload == -1){
SetVehicleHeavyMissileReload(vehid,VEHICLE_MISSILE_RELOAD_HEAVY);
} else {
SetVehicleHeavyMissileReload(vehid,arm_reload);
}
}
case VEHICLE_MISSILE_TYPE_BOMBER: {
ToggleVehicleBomberMissile(vehid,toggle_value);
if(arm_speed == -1){
SetVehicleBomberMissileSpeed(vehid,VEHICLE_MISSILE_SPEED_BOMBER);
} else {
SetVehicleBomberMissileSpeed(vehid,arm_speed);
}
if(arm_reload == -1){
SetVehicleBomberMissileReload(vehid,VEHICLE_MISSILE_RELOAD_BOMBER);
} else {
SetVehicleBomberMissileReload(vehid,arm_reload);
}
}
case VEHICLE_MISSILE_TYPE_RHINO: {
ToggleVehicleRhinoMissile(vehid,toggle_value);
if(arm_reload == -1){
SetVehicleRhinoMissileReload(vehid,VEHICLE_MISSILE_RELOAD_RHINO);
} else {
SetVehicleRhinoMissileReload(vehid,arm_reload);
}
}
default: return SendClientMessage(playerid,0xFFFFFFFF,"Invalid Toggle ID: 0 - 3");
}
return 1;
}
CMD:veharmreset(playerid){
if(!IsPlayerAdmin(playerid)) return 0;
OnVehicleMissileInit(); //reset all settings
return 1;
}
VehicleMissile.inc
Missile.inc
3DTryg.inc
ATM.inc
See also Missile Launcher