05.04.2015, 20:49
Hi, how to check whether the player on the machine hood
CMD:isonhood(playerid, params[])
{
new Float:posX, Float:posY, Float:posZ;
GetVehicleHood(vehicleid, posX, poxY, posZ);
if(IsPlayerInRangeOfPoint(playerid, 3.0, posX, poxY, posZ));
print("player is on hood of vehicle");
return 1;
}
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;
}
Same as above, get this include: https://sampforum.blast.hk/showthread.php?tid=486060
Then this is for general use (all vehicles): pawn Код:
|
In order to use this, you need this include.
pawn Код:
|