I have some trouble with : " OnPlayerEditObject " when i'm click to the " save " button , the object does not want to save..
I'm think normally supposed to appear a message, when i click " Save " ... but it does not appear;
Код:
public OnPlayerEditObject(playerid, playerobject, objectid, response, Float:fX, Float:fY, Float:fZ, Float:fRotX, Float:fRotY, Float:fRotZ)
{
new Float:oldX, Float:oldY, Float:oldZ, Float:oldRotX, Float:oldRotY, Float:oldRotZ;
GetObjectPos( objectid, oldX, oldY, oldZ );
GetObjectRot( objectid, oldRotX, oldRotY, oldRotZ );
/*if(!playerobject) // If this is a global object, move it for other players
{
if(!IsValidObject(objectid))
return ( 1 ) ;
MoveObject(objectid, fX, fY, fZ, 10.0, fRotX, fRotY, fRotZ);
SCMF( playerid, -1, "'%0.2f','%0.2f','%0.2f','%0.2f','%0.2f','%0.2f'", fX, fY, fZ, fRotX, fRotY, fRotZ ) ;
}*/
if ( !playerobject )
{
//if ( !IsValidObject(objectid ) ) return ( 1 ) ;
SetObjectPos( objectid, fX, fY, fZ );
SetObjectRot( objectid, fRotX, fRotY, fRotZ );
}
if ( response == EDIT_RESPONSE_FINAL )
{
SCMF( playerid, -1, "SAVED '%s','%0.2f','%0.2f','%0.2f','%0.2f','%0.2f','%0.2f'", ObjectText[ playerid ], fX, fY, fZ, fRotX, fRotY, fRotZ ) ;
// The player clicked on the save icon
// Do anything here to save the updated object position (and rotation)
gQuery[ 0 ] = EOS ;
format( gQuery, 524, "INSERT INTO `signs` VALUES(0,'%s','%0.2f','%0.2f','%0.2f','%0.2f','%0.2f','%0.2f')", ObjectText[ playerid ], fX, fY, fZ, fRotX, fRotY, fRotZ ) ;
mysql_tquery( SQL, gQuery, "", "" ) ;
}
if(response == EDIT_RESPONSE_CANCEL)
{
DestroyObject( objectid ) ;
}
return ( 1 ) ;
}