public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
if(response == EDIT_RESPONSE_FINAL)
{
print("is this even being called?");
if(GetPVarInt(playerid, "EditingAGate") == 1)
{
Gates[objectid][GateX] = x;
Gates[objectid][GateY] = y;
Gates[objectid][GateZ] = z;
Gates[objectid][GateRX] = rx;
Gates[objectid][GateRY] = ry;
Gates[objectid][GateRZ] = rz;
DestroyDynamicObject(Gates[objectid][GateID]);
Gates[objectid][GateID] = CreateDynamicObject(Gates[objectid][GateModel], Gates[objectid][GateX], Gates[objectid][GateY], Gates[objectid][GateZ], Gates[objectid][GateVW], Gates[objectid][GateInt], 0, -1, -1, -1, 150.0);
SetPVarInt(playerid, "EditingAGate", 0);
SaveGate(objectid);
print("yes?");
}
if(GetPVarInt(playerid, "EditingAGate") == 2)
{
Gates[objectid][GateXM] = x;
Gates[objectid][GateYM] = y;
Gates[objectid][GateZM] = z;
Gates[objectid][GateRXM] = rx;
Gates[objectid][GateRYM] = ry;
Gates[objectid][GateRZM] = rz;
DestroyDynamicObject(Gates[objectid][GateID]);
Gates[objectid][GateID] = CreateDynamicObject(Gates[objectid][GateModel], Gates[objectid][GateX], Gates[objectid][GateY], Gates[objectid][GateZ], Gates[objectid][GateVW], Gates[objectid][GateInt], 0, -1, -1, -1, 150.0);
SetPVarInt(playerid, "EditingAGate", 0);
SaveGate(objectid);
print("ok wtf");
}
}
return 1;
}
else if(strcmp(Usage, "SpawnPosition", true) == 0)
{
DestroyDynamicObject(Gates[id][GateID]);
Gates[id][GateID] = CreateDynamicObject(Gates[id][GateModel], Gates[id][GateX], Gates[id][GateY], Gates[id][GateZ], Gates[id][GateVW], Gates[id][GateInt], 0, -1, -1, -1, 150.0);
EditDynamicObject(playerid, Gates[id][GateID]);
SetPVarInt(playerid, "EditingAGate", 1);
return 1;
}
else if(strcmp(Usage, "MovePosition", true) == 0)
{
DestroyDynamicObject(Gates[id][GateID]);
Gates[id][GateID] = CreateDynamicObject(Gates[id][GateModel], Gates[id][GateX], Gates[id][GateY], Gates[id][GateZ], Gates[id][GateVW], Gates[id][GateInt], 0, -1, -1, -1, 150.0);
EditDynamicObject(playerid, Gates[id][GateID]);
SetPVarInt(playerid, "EditingAGate", 2);
return 1;
}
Wrongfully hooking a callback is one of the reasons your callback is not getting called at all, redownload includes that might have hooked this callback (or just re-download them all), that will help.
And btw put your "is this even being called" at first line without any checks, to see if it actually does, not under response final. |
This probably isn't the case, but it might be because you don't have a OnPlayerEditDynamicObject in your filterscript (or have one that returns 0) try adding it with a simple return 1 or remove it in fs if you have it, see if it helps.
|
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) // calling fix, don't remove.
{
// make sure it doesn't return anything
}
CallRemoteFunction("OnPlayerEditGate", "iddffffff", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
forward OnPlayerEditGate(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
public OnPlayerEditGate(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
// also should not return anything
}
CallLocalFunction("OnPlayerEditDynamicObject", "iddffffff", playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);