SA-MP Forums Archive
/createobject isn't working properly. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: /createobject isn't working properly. (/showthread.php?tid=613579)



/createobject isn't working properly. - Shockey HD - 29.07.2016

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?


Re: /createobject isn't working properly. - Threshold - 29.07.2016

EditDynamicObject...