#Help [+REP]
the problem is ....if I move the object use editobject ,,then I save the object ... object was still in the place that I create ...
Код:
CMD:eo(playerid,params[])
{
if(IsPlayerAdmin(playerid) || mappinginfo[playerid][mlicense] == 1)
{
new i, string[MAX_PLAYERS];
if(sscanf(params,"i",i)) return SendClientMessage(playerid,X11_YELLOW,"stynx correct usage /eo [objectid]");
if(cmodelid[playerid][i] <= 0 || i >= maxobject) return SendClientMessage(playerid,X11_YELLOW,"error ! invalid objectid");
new x = cobject[playerid][i];
Streamer_Update(playerid);
EditDynamicObject(playerid, x);
MapAction[playerid] = x;
EditingMap[playerid] = EDITING_MAP_ENABLED;
format(string, sizeof(string), "+ you have choose objectid %d to edit", i);
SendClientMessage(playerid, -1, string);
if(textdiaoffja[playerid] == false)
createobjecttext(playerid,cmodelid[playerid][i],i,pnama(playerid),cposx[playerid][i],cposy[playerid][i],cposz[playerid][i],crotx[playerid][i],croty[playerid][i],crotz[playerid][i]);
}
return 1;
}
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
if(response == EDIT_RESPONSE_UPDATE) return 1;
new i, Float:oldX, Float:oldY, Float:oldZ,
Float:oldRotX, Float:oldRotY, Float:oldRotZ;
GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
if(response == EDIT_RESPONSE_FINAL)
{
if(EditingMap[playerid] == EDITING_MAP_ENABLED)
{
new g = cobject[MapAction[playerid]][i];
cposx[MapAction[playerid]][g] = x;
cposy[MapAction[playerid]][g] = y;
cposz[MapAction[playerid]][g] = z;
crotx[MapAction[playerid]][g] = rx;
croty[MapAction[playerid]][g] = ry;
crotz[MapAction[playerid]][g] = rz;
SetDynamicObjectPos(objectid, x, y, z);
SetDynamicObjectRot(objectid, rx, ry, rz);
SendClientMessage(playerid, -1, "You have edited the objectid...");
}
}
if(response == EDIT_RESPONSE_CANCEL)
{
SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
}
return 1;
}