CreateDynamicObject
#1

Hello, I would like to convert this code so that its progress: x.

Quote:

DropObject [i] = CreateDynamicObject (ItemID, X, Y, Z, RX, RY, RZ, world);

Because this does not work:

Quote:

DropObject [i] = CreateObject (ItemID, X, Y, Z, RX, RY, RZ, world);

and

Quote:

DropObject [i] = CreateDynamicObject (ItemID, X, Y, Z-1, 80.0, 0.0, 0.0, world);

Thank you in advance regards,
Reply
#2

Why would you like to change back to CreateObject when the streamer doesn't have that limit?

Anyway: https://sampwiki.blast.hk/wiki/CreateObject
The last parameter is "drawdistance" not "world". The object will be shown to all virtual worlds.
Reply
#3

I do not see how to change this code:

Код:
stock CreateItem(ItemID, Float:X, Float:Y, Float:Z,Float:RX,Float:RY,Float:RZ, world, interior)
{
 
    if(ItemID != 0)
    {
        for(new i = 0; i < sizeof(ItemInfo); i++)
        {
            if(ItemInfo[i][ItemPosX] == 0.0 && ItemInfo[i][ItemPosY] == 0.0 && ItemInfo[i][ItemPosZ] == 0.0)
            {
                ItemInfo[i][ItemModel] = ItemID;
                ItemInfo[i][ItemPosX] = X;
                ItemInfo[i][ItemPosY] = Y;
                ItemInfo[i][ItemPosZ] = Z;
                ItemInfo[i][ItemRotX] = RX;
                ItemInfo[i][ItemRotY] = RY;
                ItemInfo[i][ItemRotZ] = RZ;
                ItemInfo[i][ItemVWorld] = world;
                ItemInfo[i][ItemInterior] = interior;
                Label[i] = Create3DTextLabel("Item 'Press Y' to take it", 0x008080FF,X,Y,Z, 10.0,world, 0);
                DropObject[i] = CreateDynamicObject(ItemID, X, Y, Z,RX,RY,RZ, world);
 
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
stock DropItem(ItemID, Float:X, Float:Y, Float:Z, world, interior)
{
 
    if(ItemID != 0)
    {
        for(new i = 0; i < sizeof(ItemInfo); i++)
        {
            if(ItemInfo[i][ItemPosX] == 0.0 && ItemInfo[i][ItemPosY] == 0.0 && ItemInfo[i][ItemPosZ] == 0.0)
            {
                ItemInfo[i][ItemModel] = ItemID;
                ItemInfo[i][ItemPosX] = X;
                ItemInfo[i][ItemPosY] = Y;
                ItemInfo[i][ItemPosZ] = Z;
                ItemInfo[i][ItemVWorld] = world;
                ItemInfo[i][ItemInterior] = interior;
                Label[i] = Create3DTextLabel("Item 'Press Y' to take it", 0x008080FF,X,Y,Z, 10.0,world, 0);
                DropObject[i] = CreateDynamicObject(ItemID, X, Y, Z-1, 80.0, 0.0, 0.0, world);
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
Reply
#4

Just remove "world" and "interior" parameter from those two functions as global objects are shown to every single world/interior and in CreateDynamicObject function (to both functions) replace "world" to the drawdistance you want. For example "50.0" (the value is up to you, just don't go higher than 300.0).
Reply
#5

This does not work, it does not appear in.

Код:
stock CreateItem(ItemID, Float:X, Float:Y, Float:Z,Float:RX,Float:RY,Float:RZ, drawdistance)
{

    if(modelid != 0)
    {
        for(new i = 0; i < sizeof(ItemInfo); i++)
        {
            if(ItemInfo[i][ItemPosX] == 0.0 && ItemInfo[i][ItemPosY] == 0.0 && ItemInfo[i][ItemPosZ] == 0.0)
            {
                ItemInfo[i][ItemModel] = ItemID;
                ItemInfo[i][ItemPosX] = X;
                ItemInfo[i][ItemPosY] = Y;
                ItemInfo[i][ItemPosZ] = Z;
                ItemInfo[i][ItemRotX] = RX;
                ItemInfo[i][ItemRotY] = RY;
                ItemInfo[i][ItemRotZ] = RZ;
                ItemInfo[i][ItemVWorld] = drawdistance;
              //  ItemInfo[i][ItemInterior] = interior;
                InvLabel[i] = Create3DTextLabel("{FFFFFF}Appuie sur {2E9AFE}Y {FFFFFF}pour le prendre.", 0x008080FF,X,Y,Z, 10.0,drawdistance, 0);
                DropObject[i] = CreateObject(ItemID, X, Y, Z,RX,RY,RZ, drawdistance);
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
stock DropItem(ItemID, Float:X, Float:Y, Float:Z, drawdistance)
{

    if(ItemID != 0)
    {
        for(new i = 0; i < sizeof(ItemInfo); i++)
        {
            if(ItemInfo[i][ItemPosX] == 0.0 && ItemInfo[i][ItemPosY] == 0.0 && ItemInfo[i][ItemPosZ] == 0.0)
            {
                ItemInfo[i][ItemModel] = ItemID;
                ItemInfo[i][ItemPosX] = X;
                ItemInfo[i][ItemPosY] = Y;
                ItemInfo[i][ItemPosZ] = Z;
                ItemInfo[i][ItemVWorld] = drawdistance;
                //ItemInfo[i][ItemInterior] = interior;
                InvLabel[i] = Create3DTextLabel("{FFFFFF}Appuie sur {2E9AFE}Y {FFFFFF}pour le prendre.", 0x008080FF,X,Y,Z, 10.0,drawdistance, 0);
                DropObject[i] = CreateObject(ItemID, X, Y, Z-1, 80.0, 0.0, 0.0, drawdistance);
                return 1;
            }
        }
        return 1;
    }
    return 1;
}
Reply
#6

Help, please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)