![]() |
|
[Server] Problem with OnPlayerEditDynamicObject - Printable Version +- open.mp forum (https://forum.open.mp) +-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3) +--- Forum: Support (https://forum.open.mp/forumdisplay.php?fid=12) +--- Thread: [Server] Problem with OnPlayerEditDynamicObject (/showthread.php?tid=1226) |
Problem with OnPlayerEditDynamicObject - morem - 2020-10-10 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 ... RE: Problem with OnPlayerEditDynamicObject - BoNNe - 2020-10-10 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;
}RE: Problem with OnPlayerEditDynamicObject - Expert* - 2020-10-15 Try to disable filterscripts, it might be called in FS first and one of em is blocking it. RE: Problem with OnPlayerEditDynamicObject - morem - 2020-10-16 (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 RE: Problem with OnPlayerEditDynamicObject - morem - 2020-10-16 Problem fixed. I tried put my filterscript on first in server.cfg filterscripts. and change OnPlayerEditDynamicObject in my gamemode to return 0. |