Objectid [+REP]
#1

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;
  	}
Reply
#2

paste the code for IsPlayerNearObject(playerid);
Reply
#3

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);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)