Object position Doesn't save
#1

When i create a object and edit it. after editing that object i go far from it and when i come back near to it its position is changed back to old once not which i edited..

Command:
PHP код:
CMD:editobj(playeridparams[])
{
    new 
string[128], idx;
    if(!
IsPlayerConnected(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
PlayerInfo[playerid][pMapper] < 1) return SendClientMessage(playeridCOLOR_GREY"You are not authorized to use this command.");
    if(!
mDuty[playerid]) return SendClientMessage(playeridCOLOR_GREY"You are not on Mapper Duty.");
    if(
sscanf(params"i"idx)) return SendClientMessage(playeridCOLOR_WHITE"[Usage]: /editobj [objectid]");
    if(!
ObjInfo[idx][oModel]) return SendClientMessage(playeridCOLOR_GREY"Invalid object id.");
    
oEdit[playerid] = 1;
    
oEditID[playerid] = idx;
    
GetDynamicObjectPos(ObjInfo[idx][obj], oPos[playerid][0], oPos[playerid][1], oPos[playerid][2]);
    
GetDynamicObjectRot(ObjInfo[idx][obj], oRot[playerid][0], oRot[playerid][1], oRot[playerid][2]);
    
EditDynamicObject(playeridObjInfo[idx][obj]);
    
format(stringsizeof(string), " You are now editing object ID %d's position."idx);
    
SendClientMessage(playeridCOLOR_WHITEstring);
    
format(stringsizeof(string), "MapperWarn: %s is editting object ID %d's position.)"GetPlayerNameEx(playerid), idx);
    
SendMapperMessage(COLOR_GREEN1string);
    
SetDynamicObjectPos(playeridObjInfo[idx][oX], ObjInfo[idx][oY], ObjInfo[idx][oZ]);
    
SetDynamicObjectRot(playeridObjInfo[idx][oRX], ObjInfo[idx][oRY], ObjInfo[idx][oRZ]);
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)