/createobject isn't working properly.
#1

Hey all,

I have this command that use to work perfectly, now all of a sudden it only creates the object and doesn't engage in the EditObject function.


pawn Код:
CMD:createobject(playerid,params[])
{
    if(pData[playerid][pAdmin] >=4)
    {
        new ObjectID,Float:Pos[6];
        if(sscanf(params, "d",ObjectID)) return SendClientMessage(playerid, COLOR_GREY,"Usage: /Createobject [Object ID]");
        {
            for(new i = 0; i < MAX_OBJECTS; i++)
            {
                if(oData[i][oSpawned] == 0)
                {
                    new string[128];
                    GetPlayerPos(playerid, Pos[0],Pos[1],Pos[2]);
                    Pos[3] = 0; Pos[4] = 0; Pos[5] = 0;
                    oData[i][ObjectType] = CreateDynamicObject(ObjectID,Pos[0],Pos[1],Pos[2],Pos[3],Pos[4],Pos[5],GetPlayerVirtualWorld(playerid),GetPlayerInterior(playerid),-1);
                    format(string, 128,"Object Created: %d (ID: %d)",ObjectID,i);
                    SendClientMessage(playerid, COLOR_GREY,string);
                    oData[i][ObjectModel] = ObjectID;
                    pData[playerid][EditingaObject] = 1;
                    pData[playerid][EditingObject] = i;
                    oData[i][oSpawned] = 1;
                    EditObject(playerid, oData[i][ObjectType]);
                    break;

                }
            }
        }
    }
    else { ReturnError(playerid); }
    return 1;
}


What could be causing it? For that reason, my command /editobject won't work but work with my ones that already exist on the server.


I am guessing CreateDynamicObject is setting ObjectType to maybe the total dynamic objects?
Reply
#2

EditDynamicObject...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)