SA-MP Forums Archive
help plz - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: help plz (/showthread.php?tid=612415)



help plz - Tmw9s - 17.07.2016

how to get, when the player launches a missile(Hydra)

my english is not very good


Re: help plz - Dayrion - 17.07.2016

Check if the player is in a vehicle with the hydra modиle and when he fire during his fly with OnPlayerKeyStateChange(playerid, newkeys, oldkeys).
(My english isn't better. xD )


Re: help plz - iKarim - 17.07.2016

the only way is, adding checks in OnPlayerKeyStateChange like that:

PHP код:
public OnPlayerKeyStateChange(playeridnewkeysoldkeys)
{
    new 
veh;
    if( ( 
veh GetPlayerVehicleID(playerid) ) )
    {
        if( 
GetVehicleModel(veh) == 520 )
        {
                if( ( ( ( 
newkeys & ( KEY_FIRE) ) == ( KEY_FIRE ) && ( ( oldkeys & ( KEY_FIRE ) ) != ( KEY_FIRE ) ) ) ) )
                {
                    
// player fired a missle with a hydra. NOT ACCURATE, NOT TESTED.
                
}
        }
    }
    return 
true;