27.11.2012, 21:55
Is there any way to find out how many indexes some object have? With some function, i don't want to look at map editor for each object...
Any smart solution?
Any smart solution?
CMD:onear(playerid, params[])
{
if(IsPlayerAdmin(playerid)) //Some sort of check
{
SendClientMessage(playerid, COLOR_TWRED, "______________________");
SendClientMessage(playerid, COLOR_TWRED, "Listing all nearby objects");
SendClientMessage(playerid, COLOR_TWRED, "______________________");
new Float:X,Float:Y,Float:Z, Float:OX, Float:OY, Float:OZ;
new str[128];
GetPlayerPos(playerid, X,Y,Z);
for (new i = 0; i < MAX_OBJECTS; i++)
{
GetObjectPos(i, OX, OY, OZ);
if(IsPlayerInRangeOfPoint(playerid, 30.0, OX, OY, OZ))
{
format(str, 128, "Object (%i) is %f far away from you.", i, GetDistance(X, Y, Z, OX, OY, OZ));
SendClientMessageEx(playerid, COLOR_WHITE, str);
}
}
return 1;
}
return SendClientMessage(playerid, COLOR_WHITE, "You are not authorized to use this command.");
}