SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts

Reply
 
Thread Tools Display Modes
Old 16/06/2016, 06:35 PM   #1
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,238
Reputation: 312
Cool Vehicle Missile Launcher

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 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);

//Player Functions:
GetMiniMissileRemainingTime(playerid);
GetHeavyMissileRemainingTime(playerid);
GetRhinoMissileRemainingTime(playerid);
GetBomberMissileRemainingTime(playerid);
GetMortarMissileRemainingTime(playerid);
GetMegaMissileRemainingTime(playerid);
GetCongreveRemainingTime(playerid);
GetHavocRemainingTime(playerid);
GetGroundBombRemainingTime(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 

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

//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

//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

//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

//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_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

//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 
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 
548497469: { //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(playeridnewkeysoldkeys){
    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.0val 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.0val 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.0val 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.0val 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.0val 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.0val 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.0val 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.0val 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
3DTryg.inc Thread
ColAndreas Plugin Thread

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

Last edited by AbyssMorgan; 10/09/2017 at 10:17 PM. Reason: Update v1.9.0
AbyssMorgan is online now   Reply With Quote
Old 16/06/2016, 06:58 PM   #2
MBilal
Gangsta
 
MBilal's Avatar
 
Join Date: May 2013
Location: Pakistan
Posts: 793
Reputation: 53
Default Re: Vehicle Missile Launcher

Well its cool awesome bud
MBilal is offline   Reply With Quote
Old 16/06/2016, 07:17 PM   #3
FuNkYTheGreat
Huge Clucker
 
FuNkYTheGreat's Avatar
 
Join Date: Jun 2016
Location: Pakistan.
Posts: 259
Reputation: 91
Default Re: Vehicle Missile Launcher

I Appreciate your Work bro.
but it's a Include So why you post it in FilterScript section man ?
Post it at Include Section.
FuNkYTheGreat is offline   Reply With Quote
Old 16/06/2016, 07:43 PM   #4
Ritzy
High-roller
 
Ritzy's Avatar
 
Join Date: Jun 2014
Location: GPS failed.
Posts: 1,465
Reputation: 107
Default Re: Vehicle Missile Launcher

Well this is amazing.
Ritzy is online now   Reply With Quote
Old 17/06/2016, 06:59 AM   #5
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,238
Reputation: 312
Default Re: Vehicle Missile Launcher

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

Last edited by AbyssMorgan; 17/06/2016 at 02:43 PM.
AbyssMorgan is online now   Reply With Quote
Old 19/06/2016, 09:39 PM   #6
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,238
Reputation: 312
Default Re: Vehicle Missile Launcher

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); 
AbyssMorgan is online now   Reply With Quote
Old 22/06/2016, 07:33 PM   #7
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,238
Reputation: 312
Default Re: Vehicle Missile Launcher

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) 
AbyssMorgan is online now   Reply With Quote
Old 05/07/2016, 08:18 AM   #8
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,238
Reputation: 312
Default Re: Vehicle Missile Launcher

Created new version for ColAndreas:
https://www.youtube.com/watch?v=HTHinI1IGhY

Last edited by AbyssMorgan; 16/09/2017 at 08:45 AM.
AbyssMorgan is online now   Reply With Quote
Old 16/07/2016, 08:56 AM   #9
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,238
Reputation: 312
Default Re: Vehicle Missile Launcher

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 
AbyssMorgan is online now   Reply With Quote
Old 30/07/2016, 07:10 PM   #10
AbyssMorgan
High-roller
 
AbyssMorgan's Avatar
 
Join Date: Apr 2015
Location: Poland
Posts: 1,238
Reputation: 312
Default Re: Vehicle Missile Launcher

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 
548497469: { //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

AbyssMorgan is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A51 Missile Kwarde Screenshots and Videos 9 27/06/2011 09:00 PM
"Slight homing", make a missile "Slightly!" home a vehicle. Donya Help Archive 4 11/06/2011 10:20 PM
What is the pickup id of a Rocket luncher??? Exterminator Help Archive 5 02/11/2010 07:59 PM


All times are GMT. The time now is 02:21 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.