Quantcast
Channel: SA-MP Forums - Filterscripts
Viewing all articles
Browse latest Browse all 595

[FilterScript] Vehicle Parachute

$
0
0
Vehicle Parachute
So, I was fetching around the forms and I only found on vehicle parachute system which was a lot complicated so I have made my own and I liked to share it with you hope you like it
PHP Code:

#include <a_samp>
#include <streamer>
#include <zcmd>
new vpara[MAX_PLAYERS];
new 
para[MAX_VEHICLES];
public 
OnPlayerSpawn(playerid)
{
      
vpara[playerid]=0;//use this onplayerconnect too to avoid bugs
}
public 
OnPlayerExitVehicle(playeridvehicleid)
{
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        
vpara[playerid]=0;
        
DestroyDynamicObject(para[vehicleid]);
    }
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
                if(
vpara[playerid]==1)
        {
            if(
IsPlayerInAnyVehicle(playerid))
            {
                if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    static 
vidFloat:xFloat:yFloat:z;
                    
vid GetPlayerVehicleID(playerid);
                    
GetVehicleVelocity(vid,x,y,z);
                    
SetVehicleVelocity(vid,x,y,-0.2);
                }
            }
        }
                return 
1;
}
CMD:vpara(playeridparams[])
{
    if(!
IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1"EREOR: You Must Be In Vehicle To Use That Command.");
    new 
vid GetPlayerVehicleID(playerid);
    if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(
vpara[playerid]==0)
        {
            
para[vid] = CreateDynamicObject(18849,0.0,0.0,-6000.0,0.0,0.0,0.0,GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid));
            
SendClientMessage(playerid, -1"~Parachute Attached.");
            switch(
random(5))
            {
                case 
0: {

                    
SetDynamicObjectMaterial(para[vid],0,18841,"MickyTextures","Smileyface2",0x00000000);

                    
SetDynamicObjectMaterial(para[vid],2,10412,"hotel1","carpet_red_256",0x00FFFFFF);

                }
                case 
1: {

                    
SetDynamicObjectMaterial(para[vid],0,18841,"MickyTextures","red032",0x00000000);

                    
SetDynamicObjectMaterial(para[vid],2,10412,"hotel1","carpet_red_256",0x00FFFFFF);

                }
                case 
2: {

                    
SetDynamicObjectMaterial(para[vid],0,18841,"MickyTextures","ws_gayflag1",0x00000000);

                    
SetDynamicObjectMaterial(para[vid],2,10412,"hotel1","carpet_red_256",0x00FFFFFF);

                }
                case 
3: {

                    
SetDynamicObjectMaterial(para[vid],0,18841,"MickyTextures","waterclear256",0x00000000);

                    
SetDynamicObjectMaterial(para[vid],2,10412,"hotel1","carpet_red_256",0x00FFFFFF);

                }
                case 
4: {

                    
SetDynamicObjectMaterial(para[vid],2,10412,"hotel1","carpet_red_256",0x00FFFFFF);

                }
            }
            new 
Float:x,Float:y,Float:z;
            
GetVehicleModelInfo(GetVehicleModel(vid),VEHICLE_MODEL_INFO_SIZE,x,y,z);
            
/= 2.0;
            
AttachDynamicObjectToVehicle(para[vid],vid,0.0,0.0,z+6.0,0.0,0.0,90.0);
            
vpara[playerid] = 1;
            return 
1;
        }
        if(
vpara[playerid]==1)
        {
            
SendClientMessage(playerid, -1"~Parachute Removed.");
            
DestroyDynamicObject(para[vid]);
            
vpara[playerid]=0;
            return 
1;
        }
    }
    return 
1;


Credits
Me[Creating This]
Hope You Like It!
Edited I forgot to add something

Viewing all articles
Browse latest Browse all 595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>