08.07.2013, 20:57
Hi there,
I've tried this a few times now, but everytime I use the OnPlayerEditObject function and hit the save button on the pins in game nothing happens, doesn't matter if I cancel it or if I hit the save key, it doesn't work. I've tried it on different functions I tried to make but shut it down since the OnPlayerEditObject never works for me.
Just to clearify I use Incognito's streamer but not for the editing function part. What I do is to add a none streamed object and edits it, after that the object is fully edited it will remove it and add the object in a streamed one.
Any ideas what the problem is here?
Where the editobject is executed.
I've tried this a few times now, but everytime I use the OnPlayerEditObject function and hit the save button on the pins in game nothing happens, doesn't matter if I cancel it or if I hit the save key, it doesn't work. I've tried it on different functions I tried to make but shut it down since the OnPlayerEditObject never works for me.
Just to clearify I use Incognito's streamer but not for the editing function part. What I do is to add a none streamed object and edits it, after that the object is fully edited it will remove it and add the object in a streamed one.
Any ideas what the problem is here?
pawn Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ;
GetObjectPos(objectid, oldX, oldY, oldZ);
GetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, OVW, OINT;
if(!playerobject)
{
if(!IsValidObject(objectid)) return;
MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
}
if(response == EDIT_RESPONSE_FINAL)
{
new string[254];
OVW = GetPlayerVirtualWorld(playerid);
OINT = GetPlayerInterior(playerid);
GetObjectPos(objectid, OX, OY, OZ);
GetObjectRot(objectid, ORX, ORY, ORZ);
AddObjectToFile(OBJECT_FILE_NAME, OX, OY, OZ, ORX, ORY, ORZ, OVW, OINT);
SendClientMessage(playerid, 0xD8D8D8FF, "Object Placed");
CreateDynamicObject(oModel, Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ, OVW, OINT, -1, 200.0);
DestroyObject(Object1337);
}
if(response == EDIT_RESPONSE_CANCEL)
{
if(!playerobject)
{
SetObjectPos(objectid, oldX, oldY, oldZ);
SetObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
}
else
{
SetPlayerObjectPos(playerid, objectid, oldX, oldY, oldZ);
SetPlayerObjectRot(playerid, objectid, oldRotX, oldRotY, oldRotZ);
}
}
}
pawn Код:
new Float:OX, Float:OY, Float:OZ, Float:ORX, Float:ORY, Float:ORZ;
GetPlayerPos(playerid, OX, OY, OZ);
oModel = 19172;
ORX = 0.0;
ORY = 0.0;
ORZ = 0.0;
Object1337 = CreateObject(oModel, OX+2, OY, OZ, ORX, ORY, ORZ);
EditObject(playerid, Object1337);