Quote:
Originally Posted by Kasichok
PHP код:
TreeToPlayerDistance(playerid, Float: range)
{
new Float:Distance;
new Float:tx, Float:ty, Float: tz;
for(new i = 0; i < sizeof(LumberJackTree); i++)
{
GetObjectPos(LumberJackTree[i], tx, ty, tz);
Distance = GetPlayerDistanceFromPoint(playerid, tx, ty, tz);
if(Distance < range)
{
return SendClientMessage(playerid, -1, "near tree");
}
}
return SendClientMessage(playerid, -1, "not near tree");
}
CMD:test(playerid, params[])
{
TreeToPlayerDistance(playerid, 2.0);
return 1;
}
|
Will test when home thanks