Graffiti system - Object doesn't update other player - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Graffiti system - Object doesn't update other player (
/showthread.php?tid=531789)
Graffiti system - Object doesn't update other player -
Erik3333 - 14.08.2014
Hi!
I've a graffiti system with streamer, but when I click on save icon after moving, it doesn't update other players, it stays the location where I created it.
What's the problem?
This is the save and close:
Код:
if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL)
{
if(pGraff[playerid][pgSpraying] > 0)
{
new g = pGraff[playerid][pgSpraying];
MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
Graff[g][X] = x;
Graff[g][Y] = y;
Graff[g][Z] = z;
Graff[g][RotX] = rx;
Graff[g][RotY] = ry;
Graff[g][RotZ] = rz;
pGraff[playerid][pgSpraying] = 0;
}
}
Re: Graffiti system - Object doesn't update other player -
babecka - 14.08.2014
https://sampwiki.blast.hk/wiki/OnPlayerEditObject
Take a look at the example.
Re: Graffiti system - Object doesn't update other player -
Erik3333 - 14.08.2014
But I think, MoveDynamicObject must be working...
Re: Graffiti system - Object doesn't update other player -
Pottus - 14.08.2014
Set the position if you want to work don't move the object and expect results.
Re: Graffiti system - Object doesn't update other player -
Erik3333 - 14.08.2014
Now:
Код:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
if(response == EDIT_RESPONSE_UPDATE)
{
if(pGraff[playerid][pgSpraying] > 0)
{
MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
}
}
if(response == EDIT_RESPONSE_FINAL || response == EDIT_RESPONSE_CANCEL)
{
if(pGraff[playerid][pgSpraying] > 0)
{
new g = pGraff[playerid][pgSpraying];
SetDynamicObjectPos(objectid, x, y, z);
SetDynamicObjectRot(objectid, rx, ry, rz);
Graff[g][X] = x;
Graff[g][Y] = y;
Graff[g][Z] = z;
Graff[g][RotX] = rx;
Graff[g][RotY] = ry;
Graff[g][RotZ] = rz;
pGraff[playerid][pgSpraying] = 0;
}
}
}
It works! The fault was in gamemode with another object moving function.