Command is not saving the coordinates of objects
#1

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

A PVar doesn't save anything by itself.
It's just a global variable that you can use with multiple scripts at once.
They don't save to disc.

I don't see any saving functions in that code either.
Reply
#3

Quote:
Originally Posted by PowerPC603
View Post
A PVar doesn't save anything by itself.
It's just a global variable that you can use with multiple scripts at once.
They don't save to disc.

I don't see any saving functions in that code either.
So how I save its coordinates ?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)