IsPlayerInBoat?
#5

And I tryed something too:
PHP код:
IsPlayerOnAnyBoat(playerid)
{
    
/*
        @ Returns:
                    -1 -> if player is not on a boat
                    the boat id -> if player is on that boat
    */
    #define X (0)
    #define Y (1)
    #define Z (2)
    
new Float:vCoords[3], vmodel;
    for(new 
1vmax AmountOfVehicles(); vmaxv++)
    {
        if((
vmodel GetVehicleModel(v)) == 472 || vmodel == 473 || vmodel == 493 || vmodel == 595 ||
        
vmodel == 484 || vmodel == 430 || vmodel == 453 || vmodel == 452 || vmodel == 446 || vmodel == 454)
        {
            
GetPlayerPos(vvCoords[X], vCoords[Y], vCoords[Z]);
            if(
IsPlayerInRangeOfPoint(playerid3.0vCoords[X], vCoords[Y], vCoords[Z]))
            {
                return 
v;
            }
        }
    }
    
#undef X, Y, Z
    
return -1;
}
AmountOfVehicles()
{
    new 
VCount;
    for(new 
1MAX_VEHICLESi++) if(GetVehicleModel(i) != 0VCount++;
    return 
VCount;

Reply


Messages In This Thread
IsPlayerInBoat? - by Gh0sT_ - 23.07.2011, 09:36
Re: IsPlayerInBoat? - by MoroDan - 23.07.2011, 09:41
Re: IsPlayerInBoat? - by Gh0sT_ - 23.07.2011, 09:46
Re: IsPlayerInBoat? - by [HiC]TheKiller - 23.07.2011, 09:49
Re: IsPlayerInBoat? - by MoroDan - 23.07.2011, 09:50
Re: IsPlayerInBoat? - by Gh0sT_ - 23.07.2011, 10:28
Re: IsPlayerInBoat? - by MoroDan - 23.07.2011, 11:05
Re: IsPlayerInBoat? - by Gh0sT_ - 23.07.2011, 11:37
Re: IsPlayerInBoat? - by MoroDan - 23.07.2011, 11:50
Re: IsPlayerInBoat? - by Gh0sT_ - 23.07.2011, 12:05

Forum Jump:


Users browsing this thread: 2 Guest(s)