Vehicle position.
#1

xxxx
Reply
#2

It's pretty simple.

pawn Код:
stock IsPlayerNearVehicle(playerid, vehicleid, Float:radius)
{
    new Float:x, Float:y, Float:z;
    GetVehiclePos(vehicleid, x, y, z);
    if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
    {
        return 1;
    }
    return 0;
}

new idveh,
    counter = 0;

for(new vehid = 1; vehid != MAX_VEHICLES; vehid++)
{
    new dist = if(IsPlayerNearVehicle(playerid, vehid, 5.0);
    if(dist)
    {
        idveh = vehid;
        counter++;
    }
}

if(counter == 0)
{
    counter = 0;
      return SendClientMessage(playerid, COLOR_ERREUR, "No vйhicle loan you.");
}
else if(counter > 1)
{
    counter = 0;
    return SendClientMessage(playerid, COLOR_ERREUR, "Too many vehicles you ready.");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)