Help with create a command for distance
#1

I need a code to limit VehicleSpawn, over the 15.0 distance from another car.
Reply
#2

OK, I guess you could do something like;
pawn Код:
stock IsPlayerNearAnyVehicle( playerid, Float:distance )
{
    new Float:x, Float:y, Float:z;
    for( new i; i < MAX_VEHICLES; i ++ )
    {
        if ( GetVehicleModel( i ) )
        {
            GetVehiclePos( i, x, y, z );
            if( GetPlayerDistanceFromPoint( playerid, x, y, z) <= distance )
                return 1;
   
        }
    }
    return 0;
}
Reply
#3

one question.
Where should I introduce a distance.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)