07.07.2012, 20:50
(
Последний раз редактировалось SnG.Scot_MisCuDI; 08.07.2012 в 21:26.
)
When doing OnPlayerSelectObject, than making it call the EditObject, it doesnt show the object moving for any player besides the player editing. Even after clicking save.
Code im using (from samp wiki)
And im adding this into GarObject so theyre might be an issue with that
UPDATED CODE: STILL NOT WORKING
Code im using (from samp wiki)
And im adding this into GarObject so theyre might be an issue with that
UPDATED CODE: STILL NOT WORKING
pawn Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
new o = Objects[playerid][objectid];
new Float:oX, Float:oY, Float:oZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ, Float:rX, Float:rY, Float:rZ;
GetObjectPos(o, oX, oY, oZ);
GetObjectRot(o, oldRotX, oldRotY, oldRotZ);
if(ObjectCreator[Objects[playerid][objectid]] == playerid)
{
if(!playerobject) // If this is a global object, move it for other players
{
if(!IsValidObject(objectid)) return;
GetObjectPos(o, X, Y, Z);
SetObjectPos(o, X, Y, Z);
}
if(response == EDIT_RESPONSE_FINAL)
{
// The player clicked on the save icon
// Do anything here to save the updated object position (and rotation)
GetObjectPos(o, X, Y, Z);
SetObjectPos(o, X, Y, Z);
SetObjectRot(o, rX, rY, rZ);
}
if(response == EDIT_RESPONSE_CANCEL)
{
//The player cancelled, so put the object back to it's old position
if(!playerobject) //Object is not a playerobject
{
SetObjectPos(o, oX, oY, oZ);
SetObjectRot(o, oldRotX, oldRotY, oldRotZ);
}
else
{
SetPlayerObjectPos(playerid, o, oX, oY, oZ);
SetPlayerObjectRot(playerid, o, oldRotX, oldRotY, oldRotZ);
}
}
}
}
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:fY, Float:fZ)
{
if(type == SELECT_OBJECT_GLOBAL_OBJECT)
{
EditObject(playerid, objectid);
}
else
{
EditPlayerObject(playerid, objectid);
}
return 1;
}
pawn Код:
dcmd_select(playerid, params[])
{
#pragma unused params
new objectid;
if(ObjectCreator[Objects[playerid][objectid]] == playerid)
{
SelectObject(playerid);
}
else
{
SendClientMessage(playerid, COLOUR_SYSTEM, "This isnt your object!");
return 0;
}
return 1;
}