• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Server] Problem with OnPlayerEditDynamicObject
#1
Hey,

It does not call back anything.



Code:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)

{

printf("test");

}





After click on the save or cancel button, nothing happens.

Version :?*** Streamer Plugin v2.9.4 by Incognito loaded ***

Please help me about this ...
  Reply
#2
Salut, make sure you do everything right. I will leave you an example below.

Code:
new test_object[MAX_PLAYERS]; //a global variable

public OnPlayerConnect(playerid) {

test_object[playerid]=0;

return 1;

}

public OnPlayerDisconnect(playerid, reason) {

if(test_object[playerid]) DestroyDynamicObject(test_object[playerid]);

return 1;

}

CMD:testobj(playerid, params[]) {

new idobject;

if(sscanf(params, "i", idobject)) return SendClientMessage(playerid, COLOR_GREY, "Syntax:{FFFFFF} /editobj <id object>");

new Float:x, Float:y, Float:z;

GetPlayerPos(playerid, x, y, z);

if(test_object[playerid] != 0) return SendClientMessage(playerid, COLOR_AWARNING, "You already edit a object.");

//create a object putting a objectid aleatory (eg: /testobj 2943)

test_object[playerid] = CreateDynamicObject(idobject, x, y, z, 0, 0, 0);

EditDynamicObject(playerid, test_object[playerid]);

return 1;

}

public OnPlayerEditDynamicObject(playerid, STREAMER_TAG_OBJECT objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) {

switch(response) {

case EDIT_RESPONSE_CANCEL, EDIT_RESPONSE_FINAL: SendClientMessage(playerid, -1, "the function works");

}

return 1;

}
My discord:?BoNNe#3552

  Reply
#3
Try to disable filterscripts, it might be called in FS first and one of em is blocking it.
  Reply
#4
(2020-10-10, 06:10 PM)BoNNe Wrote: Salut, make sure you do everything right. I will leave you an example below.

I try it but not working ...



(2020-10-15, 01:15 PM)Expert* Wrote: Try to disable filterscripts, it might be called in FS first and one of em is blocking it.

My?OnPlayerEditDynamicObject is in filterscript not in gamemode
  Reply
#5
Problem fixed.
I tried put my filterscript on first in server.cfg filterscripts.
and
change OnPlayerEditDynamicObject in my gamemode to return 0.
  Reply


Forum Jump: