About OnPlayerEditDynamicObject
#1

ENG:
Hello everyone, i need some help with OnPlayerEditDynamicObject callback (incognito stremer plugin).
I don't know how to update DynamicObject's position for all players, when i hit the save icon from the GUI.
I searched all the internet, all this forum for a month, and i found nothing. I found just some topics about this callback on sa-mp.ro forum, but I still doesn't managed to solve (update object's position).
I tried some pawn code, but it did not work so I deleted it. Hope you can help me with some code/information.
Sorry for my bad english.



RO:
Salut, am nevoie de putin ajutor in legatura cu callback-ul "OnPlayerEditDynamicObject " (streamer plugin).
Nu stiu cum sa actualizez pozitia obiectelor create cu acest plugin pentru toti playerii, atunci cand apas pe iconita salvare a obiectului (acel GUI).
Caut pe internet si pe forum aici de aproximativ o luna, insa nu am gasit nimic. Am gasit doar cateva topic-uri despre collback-ul acesta pe forumul sa-mp.ro, dar inca n-am reusit sa rezolv (sa actualizez pozitia obiectelor).
Am incercat ceva in pawn, dar n-a functionat asa ca l-am sters. Sper ca ma puteti ajuta cu un cod pawn/niste informatii.
Reply
#2

no one?
Reply
#3

What are you trying to do exactly?
Reply
#4

public OnPlayerEditDynamicObject(playerid, objectid, response, Float, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
if(!IsValidDynamicObject(objectid)) return 0;
MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
if(response == EDIT_RESPONSE_FINAL)
{
//here SetDynamicObjectPos and SetDynamicObjectRot
}
return 1;
}

That's what i try to do. Actually, when i edit a dynamic object (EditDynamicObject), and when i hit save icon from samp GUI it's ok. But if i leave the place where the dynamic object is (respawn/kill/teleport on the map in other places), when i return near the object, it is not to the new position (edited), it is to it's old position. My question is: How to save dynamic object's position..
Reply
#5

sorry, bump.
Reply
#6

Really? No one?
Reply
#7

Me too.
Reply
#8

native Streamer_Update(playerid);

make a loop of players and see if they are in range od the object that needs to be updated
Reply
#9

This is what I use;
Code:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ;
	GetDynamicObjectPos(objectid, oldX, oldY, oldZ);
	GetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
        if(response == EDIT_RESPONSE_FINAL)
        {
	    SetDynamicObjectPos(objectid, x, y, z);
     	    SetDynamicObjectRot(objectid, rx, ry, rz);
        }
	if(response == EDIT_RESPONSE_CANCEL)
	{
	    SetDynamicObjectPos(objectid, oldX, oldY, oldZ);
	    SetDynamicObjectRot(objectid, oldRotX, oldRotY, oldRotZ);
	}
        return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)