Hi, how to check whether the player on the machine hood
#7

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Same as above, get this include: https://sampforum.blast.hk/showthread.php?tid=486060

Then this is for general use (all vehicles):
pawn Код:
CMD:isonhood(playerid, params[])
{
    new Float:x, Float:y, Float:z, bool:found = false;
    for(new i = 1; i < MAX_VEHICLES; i ++)
    {
        GetVehicleHood(i, x, y, z);
        if(IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z))
        {
            found = true;
            break;
        }
    }

    if(found) SendClientMessage(playerid, -1, "You're by a vehicle's hood!")
    else SendClientMessage(playerid, -1, "You're NOT by a vehicle's hood!")
    return 1;
}
I totally forgot to check the vehicle id, oops!
But in your case, it isn't necessary to loop through all vehicles, just use a function that gets the nearest vehicle ID.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)