15.01.2016, 16:47
(
Последний раз редактировалось BornHuman; 16.01.2016 в 18:03.
)
Running 0.3.7
OnPlayerEditObject is not a callback in my gamemode.
Running latest streamer
If you're wondering:
is the code where I use EditDynamicObject
OnPlayerEditObject is not a callback in my gamemode.
Running latest streamer
PHP код:
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;
}
PHP код:
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;
}