Get dynamic objectid!
#1

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

If you're going to use it within the script:
pawn Код:
new obj = CreateDynamicObject();
Reply
#3

There is no function such as;
GetObjectID so you have to do it yourself.
Such as;
pawn Код:
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;
}
Reply
#4

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
If you're going to use it within the script:
pawn Код:
new obj = CreateDynamicObject();
Nah, this objectid can be as great as you wish. But there is never more than 1000 player objects streamed, so... how do I get REAL objectid, this one is fake.

Quote:
Originally Posted by Lynn
There is no function such as;
GetObjectID
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)