27.03.2013, 18:49
hey all,
ok so i made this cmd:
stock:
but it doesn't send ANY message at all...
what am i doing wrong? and no i don't wanna use the streamer for this, because i need to get the NORMAL INTERIOR objects near the player, when he is for example standing on a couch in a random interior, and i do /getobject, it should say which object id it is, the x y z etc, but it doesnt...
anyone knows whats wrong with the above?
Greets
ok so i made this cmd:
pawn Код:
CMD:getobject(playerid, params[])
{
new Float:px,Float:py,Float:pz,
Float:ox,Float:oy,Float:oz,
Float:orx, Float:ory, Float:orz;
GetPlayerPos(playerid,px,py,pz);
for(new o = 0; o < 1000; o++) // 1000 is the max object limit
{
GetObjectPos(o,ox,oy,oz);
GetObjectRot(o, orx, ory, orz);
if(IsPlayerNearObject(playerid, o, 3.0))
{
new string[128];
format(string, sizeof(string), "Object id: %d, X: %f, Y: %f, Z: %f, Rx: %f, Ry: %f, Rz: %f", o, ox, oy, oz, orx, ory, orz);
SendClientMessage(playerid, COLOR_ORANGE, string);
print(string);
SaveIn("ChatLog", string);
break;
}
else SendClientMessage(playerid, COLOR_RED, "You ain't near any object");
}
return 1;
}
pawn Код:
stock IsPlayerNearObject(playerid, objectid, Float:range)
{
new Float:X, Float:Y, Float:Z;
GetObjectPos(objectid, X, Y, Z);
if(IsPlayerInRangeOfPoint(playerid, range, X, Y, Z))return true;
return false;
}
but it doesn't send ANY message at all...
what am i doing wrong? and no i don't wanna use the streamer for this, because i need to get the NORMAL INTERIOR objects near the player, when he is for example standing on a couch in a random interior, and i do /getobject, it should say which object id it is, the x y z etc, but it doesnt...
anyone knows whats wrong with the above?
Greets