10.05.2014, 03:59
So,... CreateDynamicObject() uses CreateObjectForPlayer() and it returns objectid, that is never greater than 1000. How do I get a REAL objectid of a dynamic object? Thanks
new obj = CreateDynamicObject();
new ObjectID[10]; // 10 is the number of Objects.
ObjectID[0] = CreateDynamicObject();
ObjectID[1] = CreateDynamicObject();
ObjectID[2] = CreateDynamicObject();
//.......
Then,
CMD:gotoobject(playerid, params[])
{
new string[128], object, Pos[3];
if(sscanf(params, "d", object)) return SendClientMessage(playerid, C_WHITE, "USAGE: /gotoobject [ObjectID]");
if(object == 1) // Object ID you typed.
{
GetDynamicObjectPos(Object[0], Pos[0], Pos[1], Pos[2]); // Gets the Objects Position.
SetPlayerPos(playerid, Pos[0]-2, Pos[1], Pos[2]); // Sets the player away from the object.
}
else if(object == 2) // Object ID you typed.
{
GetDynamicObjectPos(Object[1], Pos[0], Pos[1], Pos[2]); // Gets the Objects Position.
SetPlayerPos(playerid, Pos[0]-2, Pos[1], Pos[2]); // Sets the player away from the object.
}
//.....................
return 1;
}
If you're going to use it within the script:
pawn Код:
|
Originally Posted by Lynn
There is no function such as;
GetObjectID |