Van egy olyan problémám, ha editeled az objektumot akkor valamiért egy objektet magára szokott tenni meglévõk objektumok közûl.
Tipp mi lehet a gond?
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
if(response == EDIT_RESPONSE_FINAL)
{
new Float:x,Float:y,Float:z,Float:rx,Float:ry,Float:rz;
GetDynamicObjectPos(objectid,x,y,z);
GetDynamicObjectRot(objectid,rx,ry,rz);
for(new i; i < sizeof(object); i++){
if(object[oObjectID] == objectid){
object[oX] = fX;
object[oY] = fY;
object[oZ] = fZ;
object[roX] = fRotX;
object[roY] = fRotY;
object[roZ] = fRotZ;
format(dquery, sizeof(dquery), \"UPDATE objects SET oX = %f, oY = %f, oZ = %f, roX = %f, roY = %f, roZ = %f WHERE ScriptID = %d\",fX,fY,fZ,fRotX,fRotY,fRotZ,object[oScriptID]);
mysql_query(dquery,0,0,1);
DestroyDynamicObject(objectid);
object[oObjectID] = CreateDynamicObject(object[oModelID], object[oX], object[oY], object[oZ], object[roX], object[roY], object[roZ]);
break;
}
}
}
if(response == EDIT_RESPONSE_CANCEL)
{
for(new i; i < sizeof(object); i++){
if(object[oObjectID] == objectid){
DestroyDynamicObject(objectid);
object[oObjectID] = CreateDynamicObject(object[oModelID], object[oX], object[oY], object[oZ], object[roX], object[roY], object[roZ]);
break;
}
}
}
return 1;
}