Hydra G Passanger Entering
#2

You can't detect the key G.

But another key, for example H:

PHP код:
//Under OnPlayerKeyStateChange
if(newkeys KEY_CTRL_BACKEnter_Hydra(playerid);
//Outside any other callback
stock Enter_Hydra(playerid)
{
    new 
veh GetHydraInRange(playerid);
    if(!
veh) return 0;
    switch(
IsHydraSeatFree(veh))
    {
        case 
truePutPlayerInVehicle(playerid,veh,1);
    }
    return 
1;
}
stock GetHydraInRange(playerid)
{
    for(new 
i,l=GetVehiclePoolSize()+1,Float:p[3]; i<li++)
    {
        if(
GetVehicleModel(i) != 520) continue;
        
GetVehiclePos(i,p[0],p[1],p[2]);
        if(
IsPlayerInRangeOfPoint(playerid,6.5,p[0],p[1],p[2])) return i;
    }
    return 
0;
}
stock IsHydraSeatFree(veh)
{
    for(new 
i,l=GetPlayerPoolSize()+1i<li++)
    {
        if(
GetPlayerVehicleID(i) != veh) continue;
        if(
GetPlayerVehicleSeat(i) == 1) return 0;
    }
    return 
1;

Greekz
Reply


Messages In This Thread
Hydra G Passanger Entering - by FrankLucretti - 02.06.2015, 12:26
AW: Hydra G Passanger Entering - by Kaliber - 02.06.2015, 12:46
Re: AW: Hydra G Passanger Entering - by FrankLucretti - 02.06.2015, 12:54
AW: Hydra G Passanger Entering - by Kaliber - 02.06.2015, 12:59
Re: AW: Hydra G Passanger Entering - by FrankLucretti - 02.06.2015, 12:59
AW: Re: AW: Hydra G Passanger Entering - by Kaliber - 02.06.2015, 13:01
Re: Hydra G Passanger Entering - by denNorske - 05.06.2015, 15:25
Re: Hydra G Passanger Entering - by Jefff - 05.06.2015, 17:07

Forum Jump:


Users browsing this thread: 1 Guest(s)