Vehicle Missile Launcher -
AbyssMorgan - 16.06.2016
Hi I would like to present include for Vehicle Missile Launcher.
Video:
1.
Vehicle Missile (Beta)
2.
Vehicle Missile (ColAndreas)
3.
Marica Mortar V1
4.
Heavy Marica Mortar
5.
Congreve Rocket
6.
Marica Mortar V2
7.
New Vehicle Missile
PHP Code:
//Functions Mini Missile:
ToggleVehicleMiniMissile(vehicleid,toggle);
IsToggleVehicleMiniMissile(vehicleid);
Float:GetVehicleMiniMissileSpeed(vehicleid);
SetVehicleMiniMissileSpeed(vehicleid,Float:speed);
GetVehicleMiniMissileReload(vehicleid);
SetVehicleMiniMissileReload(vehicleid,time);
Float:GetVehicleMiniMissileDistance(vehicleid);
SetVehicleMiniMissileDistance(vehicleid,Float:distance);
GetVehicleMiniMissileKey(vehicleid);
SetVehicleMiniMissileKey(vehicleid,key);
GetVehicleMiniMissileAmmo(vehicleid);
SetVehicleMiniMissileAmmo(vehicleid,ammo);
Float:GetVehicleMiniMissileDMG(vehicleid);
SetVehicleMiniMissileDMG(vehicleid,Float:damage);
Float:GetVehicleMiniMissileVehDMG(vehicleid);
SetVehicleMiniMissileVehDMG(vehicleid,Float:damage);
//Functions Heavy Missile:
ToggleVehicleHeavyMissile(vehicleid,toggle);
IsToggleVehicleHeavyMissile(vehicleid);
Float:GetVehicleHeavyMissileSpeed(vehicleid);
SetVehicleHeavyMissileSpeed(vehicleid,Float:speed);
GetVehicleHeavyMissileReload(vehicleid);
SetVehicleHeavyMissileReload(vehicleid,time);
Float:GetVehicleHeavyMissileDistance(vehicleid);
SetVehicleHeavyMissileDistance(vehicleid,Float:distance);
GetVehicleHeavyMissileKey(vehicleid);
SetVehicleHeavyMissileKey(vehicleid,key);
GetVehicleHeavyMissileAmmo(vehicleid);
SetVehicleHeavyMissileAmmo(vehicleid,ammo);
Float:GetVehicleHeavyMissileDMG(vehicleid);
SetVehicleHeavyMissileDMG(vehicleid,Float:damage);
Float:GetVehicleHeavyMissileVehDMG(vehicleid);
SetVehicleHeavyMissileVehDMG(vehicleid,Float:damage);
//Functions Rhino Missile:
ToggleVehicleRhinoMissile(vehicleid,toggle);
IsToggleVehicleRhinoMissile(vehicleid);
GetVehicleRhinoMissileReload(vehicleid);
SetVehicleRhinoMissileReload(vehicleid,time);
Float:GetVehicleRhinoMissileDistance(vehicleid);
SetVehicleRhinoMissileDistance(vehicleid,Float:distance);
GetVehicleRhinoMissileKey(vehicleid);
SetVehicleRhinoMissileKey(vehicleid,key);
GetVehicleRhinoMissileAmmo(vehicleid);
SetVehicleRhinoMissileAmmo(vehicleid,ammo);
Float:GetVehicleRhinoMissileDMG(vehicleid);
SetVehicleRhinoMissileDMG(vehicleid,Float:damage);
Float:GetVehicleRhinoMissileVehDMG(vehicleid);
SetVehicleRhinoMissileVehDMG(vehicleid,Float:damage);
//Functions Bomber Missile:
ToggleVehicleBomberMissile(vehicleid,toggle);
IsToggleVehicleBomberMissile(vehicleid);
Float:GetVehicleBomberMissileSpeed(vehicleid);
SetVehicleBomberMissileSpeed(vehicleid,Float:speed);
GetVehicleBomberMissileReload(vehicleid);
SetVehicleBomberMissileReload(vehicleid,time);
Float:GetVehicleBomberMissileDistance(vehicleid);
SetVehicleBomberMissileDistance(vehicleid,Float:distance);
GetVehicleBomberMissileKey(vehicleid);
SetVehicleBomberMissileKey(vehicleid,key);
GetVehicleBomberMissileAmmo(vehicleid);
SetVehicleBomberMissileAmmo(vehicleid,ammo);
Float:GetVehicleBomberMissileDMG(vehicleid);
SetVehicleBomberMissileDMG(vehicleid,Float:damage);
Float:GetVehicleBomberMissileVehDMG(vehicleid);
SetVehicleBomberMissileVehDMG(vehicleid,Float:damage);
//Functions Mortar Missile:
ToggleVehicleMortarMissile(vehicleid,toggle);
IsToggleVehicleMortarMissile(vehicleid);
Float:GetVehicleMortarMissileSpeed(vehicleid);
SetVehicleMortarMissileSpeed(vehicleid,Float:speed);
GetVehicleMortarMissileReload(vehicleid);
SetVehicleMortarMissileReload(vehicleid,time);
Float:GetVehicleMortarMissileDistance(vehicleid);
SetVehicleMortarMissileDistance(vehicleid,Float:distance);
GetVehicleMortarMissileKey(vehicleid);
SetVehicleMortarMissileKey(vehicleid,key);
Float:GetVehicleMortarMissileHeight(vehicleid);
SetVehicleMortarMissileHeight(vehicleid,Float:height);
Float:GetVehicleMortarMissileRotation(vehicleid);
SetVehicleMortarMissileRotation(vehicleid,Float:rotation);
GetVehicleMortarMissileAmmo(vehicleid);
SetVehicleMortarMissileAmmo(vehicleid,ammo);
GetVehicleMortarMissileAimSys(vehicleid);
SetVehicleMortarMissileAimSys(vehicleid,toggle);
Float:GetVehicleMortarMissileDMG(vehicleid);
SetVehicleMortarMissileDMG(vehicleid,Float:damage);
Float:GetVehicleMortarMissileVehDMG(vehicleid);
SetVehicleMortarMissileVehDMG(vehicleid,Float:damage);
//Functions Mega Missile:
ToggleVehicleMegaMissile(vehicleid,toggle);
IsToggleVehicleMegaMissile(vehicleid);
Float:GetVehicleMegaMissileSpeed(vehicleid);
SetVehicleMegaMissileSpeed(vehicleid,Float:speed);
GetVehicleMegaMissileReload(vehicleid);
SetVehicleMegaMissileReload(vehicleid,time);
Float:GetVehicleMegaMissileDistance(vehicleid);
SetVehicleMegaMissileDistance(vehicleid,Float:distance);
GetVehicleMegaMissileKey(vehicleid);
SetVehicleMegaMissileKey(vehicleid,key);
Float:GetVehicleMegaMissileHeight(vehicleid);
SetVehicleMegaMissileHeight(vehicleid,Float:height);
Float:GetVehicleMegaMissileRotation(vehicleid);
SetVehicleMegaMissileRotation(vehicleid,Float:rotation);
GetVehicleMegaMissileAmmo(vehicleid);
SetVehicleMegaMissileAmmo(vehicleid,ammo);
GetVehicleMegaMissileAimSys(vehicleid);
SetVehicleMegaMissileAimSys(vehicleid,toggle);
Float:GetVehicleMegaMissileDMG(vehicleid);
SetVehicleMegaMissileDMG(vehicleid,Float:damage);
Float:GetVehicleMegaMissileVehDMG(vehicleid);
SetVehicleMegaMissileVehDMG(vehicleid,Float:damage);
//Functions Congreve Rocket:
ToggleVehicleCongreve(vehicleid,toggle);
IsToggleVehicleCongreve(vehicleid);
Float:GetVehicleCongreveSpeed(vehicleid);
SetVehicleCongreveSpeed(vehicleid,Float:speed);
GetVehicleCongreveReload(vehicleid);
SetVehicleCongreveReload(vehicleid,time);
Float:GetVehicleCongreveDistance(vehicleid);
SetVehicleCongreveDistance(vehicleid,Float:distance);
GetVehicleCongreveKey(vehicleid);
SetVehicleCongreveKey(vehicleid,key);
Float:GetVehicleCongreveSpread(vehicleid);
SetVehicleCongreveSpread(vehicleid,Float:spread);
GetVehicleCongreveSalvo(vehicleid);
SetVehicleCongreveSalvo(vehicleid,salvo);
GetVehicleCongreveAmmo(vehicleid);
SetVehicleCongreveAmmo(vehicleid,ammo);
Float:GetVehicleCongreveDMG(vehicleid);
SetVehicleCongreveDMG(vehicleid,Float:damage);
Float:GetVehicleCongreveVehDMG(vehicleid);
SetVehicleCongreveVehDMG(vehicleid,Float:damage);
//Functions Havoc Rocket:
ToggleVehicleHavoc(vehicleid,toggle);
IsToggleVehicleHavoc(vehicleid);
Float:GetVehicleHavocSpeed(vehicleid);
SetVehicleHavocSpeed(vehicleid,Float:speed);
GetVehicleHavocReload(vehicleid);
SetVehicleHavocReload(vehicleid,time);
Float:GetVehicleHavocDistance(vehicleid);
SetVehicleHavocDistance(vehicleid,Float:distance);
GetVehicleHavocKey(vehicleid);
SetVehicleHavocKey(vehicleid,key);
Float:GetVehicleHavocSpread(vehicleid);
SetVehicleHavocSpread(vehicleid,Float:spread);
GetVehicleHavocSalvo(vehicleid);
SetVehicleHavocSalvo(vehicleid,salvo);
GetVehicleHavocAmmo(vehicleid);
SetVehicleHavocAmmo(vehicleid,ammo);
Float:GetVehicleHavocDMG(vehicleid);
SetVehicleHavocDMG(vehicleid,Float:damage);
Float:GetVehicleHavocVehDMG(vehicleid);
SetVehicleHavocVehDMG(vehicleid,Float:damage);
//Functions Flare:
ToggleVehicleFlare(vehicleid,toggle);
IsToggleVehicleFlare(vehicleid);
Float:GetVehicleFlareSpeed(vehicleid);
SetVehicleFlareSpeed(vehicleid,Float:speed);
GetVehicleFlareReload(vehicleid);
SetVehicleFlareReload(vehicleid,time);
Float:GetVehicleFlareDistance(vehicleid);
SetVehicleFlareDistance(vehicleid,Float:distance);
GetVehicleFlareKey(vehicleid);
SetVehicleFlareKey(vehicleid,key);
GetVehicleFlareSalvo(vehicleid);
SetVehicleFlareSalvo(vehicleid,salvo);
GetVehicleFlareAmmo(vehicleid);
SetVehicleFlareAmmo(vehicleid,ammo);
GetVehicleFlareType(vehicleid);
SetVehicleFlareType(vehicleid,type);
//Functions Ground Bomb:
ToggleVehicleGroundBomb(vehicleid,toggle);
IsToggleVehicleGroundBomb(vehicleid);
Float:GetVehicleGroundBombSpeed(vehicleid);
SetVehicleGroundBombSpeed(vehicleid,Float:speed);
GetVehicleGroundBombReload(vehicleid);
SetVehicleGroundBombReload(vehicleid,time);
Float:GetVehicleGroundBombDistance(vehicleid);
SetVehicleGroundBombDistance(vehicleid,Float:distance);
GetVehicleGroundBombKey(vehicleid);
SetVehicleGroundBombKey(vehicleid,key);
GetVehicleGroundBombAmmo(vehicleid);
SetVehicleGroundBombAmmo(vehicleid,ammo);
Float:GetVehicleGroundBombDMG(vehicleid);
SetVehicleGroundBombDMG(vehicleid,Float:damage);
Float:GetVehicleGroundBombVehDMG(vehicleid);
SetVehicleGroundBombVehDMG(vehicleid,Float:damage);
//Functions Ground Bomb (Extended Grenade):
GetVehicleGroundBombType(vehicleid);
SetVehicleGroundBombType(vehicleid,special_weaponid);
GetVehicleGroundBombEffect(vehicleid);
SetVehicleGroundBombEffect(vehicleid,effectid);
Float:GetVehicleGroundBombEffectDMG(vehicleid);
SetVehicleGroundBombEffectDMG(vehicleid,Float:damage);
Float:GetVehicleGroundBombEffectVDMG(vehicleid);
SetVehicleGroundBombEffectVDMG(vehicleid,Float:veh_damage);
GetVehicleGroundBombEffectTime(vehicleid);
SetVehicleGroundBombEffectTime(vehicleid,seconds);
//Player Functions:
GetMiniMissileRemainingTime(playerid);
GetHeavyMissileRemainingTime(playerid);
GetRhinoMissileRemainingTime(playerid);
GetBomberMissileRemainingTime(playerid);
GetMortarMissileRemainingTime(playerid);
GetMegaMissileRemainingTime(playerid);
GetCongreveRemainingTime(playerid);
GetHavocRemainingTime(playerid);
GetGroundBombRemainingTime(playerid);
GetFlareRemainingTime(playerid);
IsVehicleMissileAimSysReady(playerid);
SetVehicleMissileAimTarget(playerid,Float:x=0.0,Float:y=0.0);
//Extended Functions:
Float:GetMissileStreamDistance();
SetMissileStreamDistance(Float:streamdistance);
DisarmVehicleMissile(vehicleid);
SetVehicleMissileDefaultConfig(vehicleid);
ToggleMissileAutoDisarm(bool:toggle);
bool:IsToggleMissileAutoDisarm();
OnVehicleShot(playerid,type);
OnVehicleMissileInit();
GetMissileRemainingTime(playerid,type);
GetVehicleMissileAmmo(vehicleid,type);
SetVehicleMissileAmmo(vehicleid,type,ammo);
//Callbacks:
OnVehicleArmed(playerid,vehicleid);
OnVehicleMissileRequestLaunch(playerid,type,vehicleid);
OnVehicleMissileLaunched(playerid,type,vehicleid);
Default control:
PHP Code:
Mini Missile - LALT
Rhino Missile - LALT
Heavy Missile - ALT GR / LCTRL / NUM0
Bomber Missile - Y
Mortar Missile - Y
Mega Missile - Y
Congreve Rocket - N
Havoc Rocket - Y
Ground Bomb - Y
Definitions:
PHP Code:
//Vehicle Missile Types:
VEHICLE_MISSILE_TYPE_MINI
VEHICLE_MISSILE_TYPE_HEAVY
VEHICLE_MISSILE_TYPE_BOMBER
VEHICLE_MISSILE_TYPE_RHINO
VEHICLE_MISSILE_TYPE_MORTAR
VEHICLE_MISSILE_TYPE_MEGA
VEHICLE_MISSILE_TYPE_CON
VEHICLE_MISSILE_TYPE_HAVOC
VEHICLE_MISSILE_TYPE_BOMB
VEHICLE_MISSILE_TYPE_FLARE
//default projectile speed
VEHICLE_MISSILE_SPEED_MINI
VEHICLE_MISSILE_SPEED_HEAVY
VEHICLE_MISSILE_SPEED_BOMBER
VEHICLE_MISSILE_SPEED_MORTAR
VEHICLE_MISSILE_SPEED_MEGA
VEHICLE_MISSILE_SPEED_CON
VEHICLE_MISSILE_SPEED_HAVOC
VEHICLE_MISSILE_SPEED_BOMB
VEHICLE_MISSILE_SPEED_FLARE
//default reload time in milisecond
VEHICLE_MISSILE_RELOAD_MINI
VEHICLE_MISSILE_RELOAD_HEAVY
VEHICLE_MISSILE_RELOAD_BOMBER
VEHICLE_MISSILE_RELOAD_RHINO
VEHICLE_MISSILE_RELOAD_MORTAR
VEHICLE_MISSILE_RELOAD_MEGA
VEHICLE_MISSILE_RELOAD_CON
VEHICLE_MISSILE_RELOAD_HAVOC
VEHICLE_MISSILE_RELOAD_BOMB
VEHICLE_MISSILE_RELOAD_FLARE
//default maximum distance that can be overcome missile
VEHICLE_MISSILE_DISTANCE_MINI
VEHICLE_MISSILE_DISTANCE_HEAVY
VEHICLE_MISSILE_DISTANCE_BOMBER
VEHICLE_MISSILE_DISTANCE_RHINO
VEHICLE_MISSILE_DISTANCE_MORTAR
VEHICLE_MISSILE_DISTANCE_MEGA
VEHICLE_MISSILE_DISTANCE_CON
VEHICLE_MISSILE_DISTANCE_HAVOC
VEHICLE_MISSILE_DISTANCE_BOMB
VEHICLE_MISSILE_DISTANCE_FLARE
//default key
VEHICLE_MISSILE_KEY_MINI
VEHICLE_MISSILE_KEY_HEAVY
VEHICLE_MISSILE_KEY_BOMBER
VEHICLE_MISSILE_KEY_RHINO
VEHICLE_MISSILE_KEY_MORTAR
VEHICLE_MISSILE_KEY_MEGA
VEHICLE_MISSILE_KEY_CON
VEHICLE_MISSILE_KEY_HAVOC
VEHICLE_MISSILE_KEY_BOMB
VEHICLE_MISSILE_KEY_FLARE
VEHICLE_MISSILE_HEIGHT_MORTAR // default arc height for Mortar Missile
VEHICLE_MISSILE_HEIGHT_MEGA // default arc height for Mega Missile
VEHICLE_MISSILE_ROTATION // default mortar/mega rotation
VEHICLE_MISSILE_SPREAD_CON // default spread for Congreve Rocket
VEHICLE_MISSILE_SALVO_CON // default salvo (number of projectiles) for Congreve Rocket
VEHICLE_MISSILE_SPREAD_HAVOC // default spread for Havoc Missile
VEHICLE_MISSILE_SALVO_HAVOC // default salvo (number of projectiles) for Havoc Missile
VEHICLE_MISSILE_SALVO_FLARE // default salvo (number of projectiles) for Flare
//infinity ammo
VEHICLE_WEAPON_AMMO_INFINITY
Weapon Vehicle Recommendation:
PHP Code:
VEHICLE_MISSILE_TYPE_MINI - Any vehicle
VEHICLE_MISSILE_TYPE_HEAVY - All air vehicles (Causes turbulence)
VEHICLE_MISSILE_TYPE_BOMBER - All air vehicles
VEHICLE_MISSILE_TYPE_RHINO - Recommended for use only RC Tiger
VEHICLE_MISSILE_TYPE_MORTAR - Any vehicle (Recomended Air Vehicle)
VEHICLE_MISSILE_TYPE_MEGA - Any vehicle (Recomended Air Vehicle)
VEHICLE_MISSILE_TYPE_CON - Hydra
VEHICLE_MISSILE_TYPE_HAVOC - Andromada
VEHICLE_MISSILE_TYPE_BOMB - Rustler
VEHICLE_MISSILE_TYPE_FLARE - Hydra
Example Code:
PHP Code:
public OnGameModeInit(){
ToggleMissileAutoDisarm(true);
return 1;
}
public OnVehicleArmed(playerid,vehicleid){
SetVehicleMiniMissileDMG(vehicleid,100.0);
SetVehicleMiniMissileVehDMG(vehicleid,500.0);
SetVehicleHeavyMissileDMG(vehicleid,200.0);
SetVehicleHeavyMissileVehDMG(vehicleid,1000.0);
SetVehicleBomberMissileDMG(vehicleid,100.0);
SetVehicleBomberMissileVehDMG(vehicleid,500.0);
SetVehicleRhinoMissileDMG(vehicleid,50.0);
SetVehicleRhinoMissileVehDMG(vehicleid,500.0);
SetVehicleMortarMissileDMG(vehicleid,100.0);
SetVehicleMortarMissileVehDMG(vehicleid,1000.0);
SetVehicleMegaMissileDMG(vehicleid,200.0);
SetVehicleMegaMissileVehDMG(vehicleid,2000.0);
SetVehicleCongreveDMG(vehicleid,50.0);
SetVehicleCongreveVehDMG(vehicleid,1500.0);
SetVehicleHavocDMG(vehicleid,500.0);
SetVehicleHavocVehDMG(vehicleid,5000.0);
SetVehicleGroundBombDMG(vehicleid,500.0);
SetVehicleGroundBombVehDMG(vehicleid,5000.0);
switch(GetVehicleModel(vehicleid)){
case 564: { //rc tiger
ToggleVehicleRhinoMissile(vehicleid,1);
}
case 553: { //nevada
ToggleVehicleBomberMissile(vehicleid,1);
}
case 592: { //andromada
ToggleVehicleBomberMissile(vehicleid,1);
SetVehicleBomberMissileSpeed(vehicleid,60.0);
SetVehicleBomberMissileReload(vehicleid,500);
}
case 520: { //hydra
ToggleVehicleBomberMissile(vehicleid,1);
SetVehicleBomberMissileSpeed(vehicleid,80.0);
SetVehicleBomberMissileReload(vehicleid,500);
ToggleVehicleHeavyMissile(vehicleid,1);
SetVehicleHeavyMissileSpeed(vehicleid,90.0);
SetVehicleHeavyMissileKey(vehicleid,KEY_CROUCH);
}
case 476: { //rustler
ToggleVehicleMiniMissile(vehicleid,1);
SetVehicleMiniMissileSpeed(vehicleid,80.0);
ToggleVehicleBomberMissile(vehicleid,1);
SetVehicleBomberMissileSpeed(vehicleid,80.0);
SetVehicleBomberMissileReload(vehicleid,500);
}
case 548, 497, 469: { //Cargobob, Police Maverik, Sparrow
ToggleVehicleMiniMissile(vehicleid,1);
ToggleVehicleBomberMissile(vehicleid,1);
}
case 512: { //Cropduster
ToggleVehicleBomberMissile(vehicleid,1);
}
case 513: { //stuntplane
ToggleVehicleBomberMissile(vehicleid,1);
}
case 519: { //shamal
ToggleVehicleMiniMissile(vehicleid,1);
SetVehicleMiniMissileSpeed(vehicleid,80.0);
}
case 432: { //rhino
ToggleVehicleMegaMissile(vehicleid,1);
SetVehicleMegaMissileSpeed(vehicleid,50.0);
SetVehicleMegaMissileHeight(vehicleid,VEHICLE_MISSILE_HEIGHT_MEGA);
SetVehicleMegaMissileDistance(vehicleid,VEHICLE_MISSILE_DISTANCE_MEGA);
SetVehicleMegaMissileAimSys(vehicleid,1);
}
}
return 1;
}
Remaining Time / Ammo detection:
PHP Code:
public OnVehicleMissileRequestLaunch(playerid,type,vehicleid){
new c_time = GetMissileRemainingTime(playerid,type);
if(c_time > 0){
new buffer[32];
format(buffer,sizeof(buffer),"Remaining Time~n~~w~%.2f second",c_time / 1000.0);
GameTextForPlayer(playerid,buffer,2500,4);
} else if(GetVehicleMissileAmmo(vehicleid,type) == 0){
new buffer[32];
format(buffer,sizeof(buffer),"No ammunition");
GameTextForPlayer(playerid,buffer,2500,4);
}
if((type == VEHICLE_MISSILE_TYPE_MORTAR && GetVehicleMortarMissileAimSys(vehicleid)) || (type == VEHICLE_MISSILE_TYPE_MEGA && GetVehicleMegaMissileAimSys(vehicleid))){
if(!IsVehicleMissileAimSysReady(playerid)){
GameTextForPlayer(playerid,"Select target in map",2500,4);
}
}
return 1;
}
public OnVehicleMissileLaunched(playerid,type,vehicleid){
new ammo = GetVehicleMissileAmmo(vehicleid,type);
if(ammo != VEHICLE_WEAPON_AMMO_INFINITY){
new buffer[32];
format(buffer,sizeof(buffer),"Vehicle Ammo~n~~w~%d",ammo);
GameTextForPlayer(playerid,buffer,2500,4);
}
return 1;
}
Advanced Mortar Control (if AimSys is disabled):
PHP Code:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys){
if(IsToggleVehicleMegaMissile(GetPlayerVehicleID(playerid))){
if(KEY_PRESSED(KEY_ANALOG_UP)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMegaMissileDistance(vid), buf[128];
val += 5.0;
if(val > 800.0) val = 800.0;
SetVehicleMegaMissileDistance(vid,val);
format(buf,sizeof buf,"Mortar Distance: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
} else if(KEY_PRESSED(KEY_ANALOG_DOWN)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMegaMissileDistance(vid), buf[128];
val -= 5.0;
if(val < 50.0) val = 50.0;
SetVehicleMegaMissileDistance(vid,val);
format(buf,sizeof buf,"Mortar Distance: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
} else if(KEY_PRESSED(KEY_ANALOG_RIGHT)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMegaMissileHeight(vid), buf[128];
val += 5.0;
if(val > 400.0) val = 400.0;
SetVehicleMegaMissileHeight(vid,val);
format(buf,sizeof buf,"Mortar Height: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
} else if(KEY_PRESSED(KEY_ANALOG_LEFT)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMegaMissileHeight(vid), buf[128];
val -= 5.0;
if(val < 25.0) val = 25.0;
SetVehicleMegaMissileHeight(vid,val);
format(buf,sizeof buf,"Mortar Height: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
}
} else if(IsToggleVehicleMortarMissile(GetPlayerVehicleID(playerid))){
if(KEY_PRESSED(KEY_ANALOG_UP)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMortarMissileDistance(vid), buf[128];
val += 5.0;
if(val > 600.0) val = 600.0;
SetVehicleMortarMissileDistance(vid,val);
format(buf,sizeof buf,"Mortar Distance: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
} else if(KEY_PRESSED(KEY_ANALOG_DOWN)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMortarMissileDistance(vid), buf[128];
val -= 5.0;
if(val < 50.0) val = 50.0;
SetVehicleMortarMissileDistance(vid,val);
format(buf,sizeof buf,"Mortar Distance: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
} else if(KEY_PRESSED(KEY_ANALOG_RIGHT)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMortarMissileHeight(vid), buf[128];
val += 5.0;
if(val > 300.0) val = 300.0;
SetVehicleMortarMissileHeight(vid,val);
format(buf,sizeof buf,"Mortar Height: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
} else if(KEY_PRESSED(KEY_ANALOG_LEFT)){
new vid = GetPlayerVehicleID(playerid), Float:val = GetVehicleMortarMissileHeight(vid), buf[128];
val -= 5.0;
if(val < 25.0) val = 25.0;
SetVehicleMortarMissileHeight(vid,val);
format(buf,sizeof buf,"Mortar Height: ~g~%.0f",val);
GameTextForPlayer(playerid,buf,1000,4);
}
}
return 1;
}
Download:
VehicleMissileCol.inc
Missile.inc Thread
3DTryg.inc Thread
ExtendedGrenade.inc Thread
ColAndreas Plugin
See also
Missile Launcher
Notice:
Filterscript not exist because filterscripts have limits.
This has been replaced by include, having automatic installation, efficient GameMode/FilterScript.
Non-Registered Users:
Bug Report
Re: Vehicle Missile Launcher -
MBilal - 16.06.2016
Well its cool awesome bud
Re: Vehicle Missile Launcher -
FuNkYTheGreat - 16.06.2016
I appreciate your work bro.
but it's an Include So why you post it in FilterScript section dude ?
Posting it at Include would be better right?
OT: Good work
Re: Vehicle Missile Launcher -
Ritzy2K - 16.06.2016
Well this is amazing.
Re: Vehicle Missile Launcher -
AbyssMorgan - 17.06.2016
Fixed ATM.inc for Missile.inc and VehicleMissile.inc, colision for foreach.
Thanks @Wizzard2H
//edit:
Added check if the player is the driver of the vehicle
Re: Vehicle Missile Launcher -
AbyssMorgan - 19.06.2016
Update v1.2:
- Added Missile.inc version control
- Added functions:
PHP Code:
GetVehicleMiniMissileDistance(vehicleid);
GetVehicleHeavyMissileDistance(vehicleid);
GetVehicleBomberMissileDistance(vehicleid);
GetVehicleRhinoMissileDistance(vehicleid);
SetVehicleMiniMissileDistance(vehicleid,Float:distance);
SetVehicleHeavyMissileDistance(vehicleid,Float:distance);
SetVehicleBomberMissileDistance(vehicleid,Float:distance);
SetVehicleRhinoMissileDistance(vehicleid,Float:distance);
//extended:
Float:GetMissileStreamDistance();
SetMissileStreamDistance(Float:streamdistance);
DisarmVehicleMissile(vehicleid);
Re: Vehicle Missile Launcher -
AbyssMorgan - 22.06.2016
Update v1.3:
Added functions:
PHP Code:
GetVehicleMiniMissileKey(vehicleid);
GetVehicleHeavyMissileKey(vehicleid);
GetVehicleBomberMissileKey(vehicleid);
GetVehicleRhinoMissileKey(vehicleid);
SetVehicleMiniMissileKey(vehicleid,key);
SetVehicleHeavyMissileKey(vehicleid,key);
SetVehicleBomberMissileKey(vehicleid,key);
SetVehicleRhinoMissileKey(vehicleid,key);
//definitions:
VEHICLE_MISSILE_KEY_MINI // default key (KEY_FIRE)
VEHICLE_MISSILE_KEY_HEAVY // default key (KEY_ACTION)
VEHICLE_MISSILE_KEY_BOMBER // default key (KEY_YES)
VEHICLE_MISSILE_KEY_RHINO // default key (KEY_FIRE)
Re: Vehicle Missile Launcher -
AbyssMorgan - 05.07.2016
Created new version for ColAndreas:
https://www.youtube.com/watch?v=HTHinI1IGhY
Re: Vehicle Missile Launcher -
AbyssMorgan - 16.07.2016
Update VehicleMissileCol v1.5.2:
- New Vehicle Weapon:
Mortar Missile (Marica Mortar)
- Added Functions:
PHP Code:
ToggleVehicleMortarMissile(vehicleid,toggle);
IsToggleVehicleMortarMissile(vehicleid);
Float:GetVehicleMortarMissileSpeed(vehicleid);
SetVehicleMortarMissileSpeed(vehicleid,Float:speed);
GetVehicleMortarMissileReload(vehicleid);
SetVehicleMortarMissileReload(vehicleid,time);
Float:GetVehicleMortarMissileDistance(vehicleid);
SetVehicleMortarMissileDistance(vehicleid,Float:distance);
GetVehicleMortarMissileKey(vehicleid);
SetVehicleMortarMissileKey(vehicleid,key);
Float:GetVehicleMortarMissileHeight(vehicleid);
SetVehicleMortarMissileHeight(vehicleid,Float:height);
- Added Definitions:
PHP Code:
VEHICLE_MISSILE_TYPE_MORTAR
VEHICLE_MISSILE_SPEED_MORTAR
VEHICLE_MISSILE_RELOAD_MORTAR
VEHICLE_MISSILE_DISTANCE_MORTAR
VEHICLE_MISSILE_KEY_MORTAR
VEHICLE_MISSILE_HEIGHT_MORTAR
Re: Vehicle Missile Launcher -
AbyssMorgan - 30.07.2016
Update VehicleMissileCol.inc v1.5.4:
- Added new Vehicle Weapon Mega Missile (Heavy Marica mortar)
Video:
https://www.youtube.com/watch?v=0FlZwi34wIA
- Added functions for Mega Missile:
PHP Code:
ToggleVehicleMegaMissile(vehicleid,toggle);
IsToggleVehicleMegaMissile(vehicleid);
Float:GetVehicleMegaMissileSpeed(vehicleid);
SetVehicleMegaMissileSpeed(vehicleid,Float:speed);
GetVehicleMegaMissileReload(vehicleid);
SetVehicleMegaMissileReload(vehicleid,time);
Float:GetVehicleMegaMissileDistance(vehicleid);
SetVehicleMegaMissileDistance(vehicleid,Float:distance);
GetVehicleMegaMissileKey(vehicleid);
SetVehicleMegaMissileKey(vehicleid,key);
Float:GetVehicleMegaMissileHeight(vehicleid);
SetVehicleMegaMissileHeight(vehicleid,Float:height);
- Added extended functions:
PHP Code:
SetVehicleMissileDefaultConfig(vehicleid);
ToggleMissileAutoDisarm(bool:toggle);
bool:IsToggleMissileAutoDisarm();
- Added Callback:
PHP Code:
OnVehicleArmed(playerid,vehicleid); //use to arm the vehicle at the right time (recommended to use ToggleMissileAutoDisarm(true);)
- Added Definitions:
PHP Code:
VEHICLE_MISSILE_TYPE_MEGA
VEHICLE_MISSILE_SPEED_MEGA // default combat speed for Mega Missile
VEHICLE_MISSILE_RELOAD_MEGA // default reload time in milisecond for Mega Missile
VEHICLE_MISSILE_DISTANCE_MEGA // default maximum distance that can be overcome rocket
VEHICLE_MISSILE_KEY_MEGA // default key (KEY_YES)
VEHICLE_MISSILE_HEIGHT_MEGA // default arc height for Mega Missile
Example Code:
PHP Code:
public OnGameModeInit(){
ToggleMissileAutoDisarm(true);
return 1;
}
public OnVehicleArmed(playerid,vehicleid){
switch(GetVehicleModel(vehicleid)){
case 564: { //rc tiger
ToggleVehicleRhinoMissile(vehicleid,1);
}
case 553: { //nevada
ToggleVehicleBomberMissile(vehicleid,1);
}
case 592: { //andromada
ToggleVehicleBomberMissile(vehicleid,1);
SetVehicleBomberMissileSpeed(vehicleid,60.0);
SetVehicleBomberMissileReload(vehicleid,500);
}
case 520: { //hydra
ToggleVehicleBomberMissile(vehicleid,1);
SetVehicleBomberMissileSpeed(vehicleid,80.0);
SetVehicleBomberMissileReload(vehicleid,500);
ToggleVehicleHeavyMissile(vehicleid,1);
SetVehicleHeavyMissileSpeed(vehicleid,90.0);
SetVehicleHeavyMissileKey(vehicleid,KEY_CROUCH);
}
case 476: { //rustler
ToggleVehicleMiniMissile(vehicleid,1);
SetVehicleMiniMissileSpeed(vehicleid,80.0);
ToggleVehicleBomberMissile(vehicleid,1);
SetVehicleBomberMissileSpeed(vehicleid,80.0);
SetVehicleBomberMissileReload(vehicleid,500);
}
case 548, 497, 469: { //Cargobob, Police Maverik, Sparrow
ToggleVehicleMiniMissile(vehicleid,1);
ToggleVehicleBomberMissile(vehicleid,1);
}
case 512: { //Cropduster
ToggleVehicleBomberMissile(vehicleid,1);
}
case 513: { //stuntplane
ToggleVehicleBomberMissile(vehicleid,1);
}
case 519: { //shamal
ToggleVehicleMiniMissile(vehicleid,1);
SetVehicleMiniMissileSpeed(vehicleid,80.0);
}
case 432: { //rhino
ToggleVehicleMegaMissile(vehicleid,1);
SetVehicleMegaMissileSpeed(vehicleid,50.0);
SetVehicleMegaMissileHeight(vehicleid,VEHICLE_MISSILE_HEIGHT_MEGA);
SetVehicleMegaMissileDistance(vehicleid,VEHICLE_MISSILE_DISTANCE_MEGA);
}
}
return 1;
}
Re: Vehicle Missile Launcher -
oMa37 - 28.09.2016
Does this work for all the vehicles? (Infernus/Bullet etc.)?
Re: Vehicle Missile Launcher -
AbyssMorgan - 28.09.2016
Quote:
Originally Posted by oMa37
Does this work for all the vehicles? (Infernus/Bullet etc.)?
|
Yes, just choose.
Re: Vehicle Missile Launcher -
timsosa09 - 29.09.2016
but where is the fs?
Re: Vehicle Missile Launcher -
AbyssMorgan - 29.09.2016
Quote:
Originally Posted by timsosa09
but where is the fs?
|
Filterscript not exist because filterscripts have
limits.
This has been replaced by include, having
automatic installation, efficient GameMode/FilterScript.
Re: Vehicle Missile Launcher -
AbyssMorgan - 14.02.2017
Update v1.6.0 (VehicleMissileCol):
- Added Congreve Rocket (Large area of destruction)
Video:
https://www.youtube.com/watch?v=Fxp-BDCQ94U
- Added functions:
PHP код:
ToggleVehicleCongreve(vehicleid,toggle);
IsToggleVehicleCongreve(vehicleid);
Float:GetVehicleCongreveSpeed(vehicleid);
SetVehicleCongreveSpeed(vehicleid,Float:speed);
GetVehicleCongreveReload(vehicleid);
SetVehicleCongreveReload(vehicleid,time);
Float:GetVehicleCongreveDistance(vehicleid);
SetVehicleCongreveDistance(vehicleid,Float:distance);
GetVehicleCongreveKey(vehicleid);
SetVehicleCongreveKey(vehicleid,key);
Float:GetVehicleCongreveSpread(vehicleid);
SetVehicleCongreveSpread(vehicleid,Float:spread);
GetVehicleCongreveSalvo(vehicleid);
SetVehicleCongreveSalvo(vehicleid,salvo);
- Added definitions:
PHP код:
VEHICLE_MISSILE_TYPE_CON
VEHICLE_MISSILE_SPEED_CON
VEHICLE_MISSILE_RELOAD_CON
VEHICLE_MISSILE_DISTANCE_CON
VEHICLE_MISSILE_KEY_CON
VEHICLE_MISSILE_SPREAD_CON
VEHICLE_MISSILE_SALVO_CON
Re: Vehicle Missile Launcher -
MehranGta - 28.03.2017
Make it able to aim on a player please.
Re: Vehicle Missile Launcher -
AbyssMorgan - 15.04.2017
Update v1.7.0:
- Added functions:
PHP код:
Float:GetVehicleMortarMissileRotation(vehicleid);
SetVehicleMortarMissileRotation(vehicleid,Float:rotation);
Float:GetVehicleMegaMissileRotation(vehicleid);
SetVehicleMegaMissileRotation(vehicleid,Float:rotation);
Video:
Vehicle Marica Mortar v2
Re: Vehicle Missile Launcher -
Inceptio - 15.04.2017
Sounds cool, I might try this. Ty m8.
Re: Vehicle Missile Launcher - Astralis - 16.04.2017
Death race style right?
Re: Vehicle Missile Launcher -
Azhar - 03.05.2017
Well Done Mate Good Job