Objectid [+REP] - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Objectid [+REP] (
/showthread.php?tid=486076)
Objectid [+REP] -
Antoniohl - 06.01.2014
Hey Guys i'm using U:RP script i have a little problem actually when i map in game, everything is good but it's hard to find the object/model id The CMD shows only one object/model id, so i wanna make/objectsaround // which will show objects of 2 meters radius
of X,Y,Z position.
I mean it will catch objects of X.Y.Z 2 meters radius.
here is the code
Код:
if(strcmp(cmd, "/objectid", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] < 1339 && !IsAMapper(playerid)) return SendClientMessage(playerid,GREY,"You're not authorized to use this command.");
new house = IsPlayerNearObject(playerid);
if(house == -1) return SendClientMessage(playerid,GREY, " You must be near the object you wish to check the ID of.");
format(string, sizeof(string), "* Object ID: %d - Model ID: %d",house,ObjectInfo[house][objModel]);
SendClientMessage(playerid, LIGHTBLUE, string);
return 1;
}
Re: Objectid [+REP] -
[LCK]Chris - 07.01.2014
paste the code for IsPlayerNearObject(playerid);
Re: Objectid [+REP] -
AIped - 07.01.2014
Its not exactly isplayernearobject but this should do... just get the players position and use the same floats
pawn Код:
stock IsObjectInRangeOfPoint(objectid, Float:range, Float:x, Float:y, Float:z)
{
new
Float:px,
Float:py,
Float:pz;
GetObjectPos(objectid, px, py, pz);
px -= x;
py -= y;
pz -= z;
return ((px * px) + (py * py) + (pz * pz)) < (range * range);
}