forward OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz);
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
print("#Custom OnPlayerEditDynamicObject was called.");
new objquery[300], pname[MAX_PLAYER_NAME], resp[MAX_PLAYERS];//[200];
format(resp, sizeof(resp), "%i", response);
SendClientMessage(playerid, -1, resp);
if(!IsValidDynamicObject(objectid))
{
print("/object invalid");
return SendClientMessage(playerid, -1, "You've selected an invalid object.");
}
if(response == 0)
{
print("#5 The player has cancelled the object insertation.");
PlayerInformation[playerid][Obj] = objectid;
ShowPlayerDialog(playerid, 6, DIALOG_STYLE_MSGBOX,"Delete Selected Object", "Would you like to delete this object from the server?\n\nYou can un-do this in the admin control panel if needed.", "YES", "NO");
}
else if(response == 1)
{
MoveDynamicObject(objectid, x, y, z, 10.0, rx, ry, rz);
IGObj[objectid][OBJX] = x;
IGObj[objectid][OBJY] = y;
IGObj[objectid][OBJZ] = z;
IGObj[objectid][OBJRX] = rx;
IGObj[objectid][OBJRY] = ry;
IGObj[objectid][OBJRZ] = rz;
GetPlayerName(playerid, pname, sizeof(pname));
print("#6 The player has clicked on the save icon in the object editor.");
if(IGObj[objectid][ID] == 0)
{
mysql_format(gMySQLConnect, objquery, sizeof(objquery), "INSERT INTO `Objects` (ObjectID, fX, fY, fZ, rX, rY, rZ) VALUES (%d, %f, %f, %f, %f, %f, %f)", IGObj[objectid][ObjID], x, y, z, rx, ry, rz);
mysql_function_query(gMySQLConnect, objquery, true, "createObject", "d", objectid);
PlayerInformation[playerid][NewOBJ] = 0;
SendClientMessage(playerid, -1, "dialog should be shown asking for a description");
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_INPUT, "Object Description", "Enter the object description below.\n\nFor example: 'Map Name + Purpose' = 'Blueberry Fence'", "Save", "Cancel");
}
else
{
mysql_format(gMySQLConnect, objquery, sizeof(objquery), "UPDATE `Objects` SET ObjectID = %d, fX = %f, fY = %f, fZ = %f, rX = %f, rY = %f, rZ = %f, utime = %i, uname = %s WHERE ID = %d", IGObj[objectid][ObjID], x, y, z, rx, ry, rz, gettime(), pname, IGObj[objectid][ID]);
mysql_function_query(gMySQLConnect, objquery, true, "EndThread", "");
print("#7 The object position will be updated.");
}
}
return 1;
}
print("#Custom OnPlayerEditDynamicObject was called.");
printf(">> Response : %i", response);
Try printing this too at start of callback
pawn Код:
|
[10:30:50] #Custom OnPlayerEditDynamicObject was called. [10:30:50] >> Response : 2 [10:30:50] #Custom OnPlayerEditDynamicObject was called. [10:30:50] >> Response : 2 [10:30:50] #Custom OnPlayerEditDynamicObject was called. [10:30:50] >> Response : 2 [10:30:51] #Custom OnPlayerEditDynamicObject was called. [10:30:51] >> Response : 2 [10:30:52] #Custom OnPlayerEditDynamicObject was called. [10:30:52] >> Response : 1 |