04.01.2014, 10:05
When I do /editor which uses 0.3e samp editor and after I finish editing objects and when i re-spawn or restart the server then that object goes to its default position. Here is the code
Code:
if(strcmp(cmd, "/editor", true) == 0) { if (PlayerInfo[playerid][pAdmin] >= 1339 || IsAMapper(playerid)) { tmp = strtok(cmdtext, idx); if (!strlen(tmp)) return SyntaxMessage(playerid, "/editor [objectid] (uses the new 0.3e SA:MP object editor)"); new objectid = strval(tmp); if (objectid < 1 || objectid > MAX_DYNAMIC_OBJECTS) { format(string, sizeof(string), "Object cannot be below 1 or above %d.", MAX_DYNAMIC_OBJECTS); return SendClientMessage(playerid, GREY, string); } if(!ObjectIDTaken[objectid]) return SendClientMessage(playerid, GREY, "ID not taken."); EditDynamicObject(playerid, ObjectInfo[objectid][objID]); //CallRemoteFunction("OnPlayerEditDynamicObject", "iiiffffff", playerid, ObjectInfo[objectid][objID], 2, ObjectInfo[objectid][objX], ObjectInfo[objectid][objY], ObjectInfo[objectid][objZ], ObjectInfo[objectid][objRX], ObjectInfo[objectid][objRY], ObjectInfo[objectid][objRZ]); format(string, sizeof(string), "You're now editing object %d.", objectid); SendClientMessage(playerid, GREY, string); SetPVarInt(playerid, "ObjectEditor", objectid); DeletePVar(playerid, "FacGateEditor"); DeletePVar(playerid, "FamGateEditor"); DeletePVar(playerid, "GateEditor"); DeletePVar(playerid, "EditingMovePos"); DeletePVar(playerid, "EditingButtonPos"); DeletePVar(playerid, "ButtonID"); return 1; } return 1; }