Objects disappear!
#1

Hello, i've done a in game mapping system but theres a problem, a mapper can edit the object and save it but when he clicks save the object disappear but it exists in the mysql, also if i restart the server i will see the object right where the mapper placed it. Just it doesnt show up when you click save, somehow it disappear.
Reply
#2

Show the codes when you are saving it
Reply
#3

try reloading the object on save.
Reply
#4

Quote:
Originally Posted by Puff
Посмотреть сообщение
try reloading the object on save.
I do reload the object

PHP код:
                       mysql_format(connectqueryBuffersizeof(queryBuffer), "INSERT INTO objects VALUES(null, %d, %d, '%e', %d, '%f', '%f', '%f', '%f', '%f', '%f', %d, %d, 0, 0)"objectidobjectsArray[PlayerInfo[playerid][pSelected]][oModel], objectsArray[PlayerInfo[playerid][pSelected]][oName], objectsArray[PlayerInfo[playerid][pSelected]][oPrice], xyzrxryrzPlayerInfo[playerid][pWorld]);
                        
mysql_tquery(connectqueryBuffer"""");
                        
mysql_tquery(connect"SELECT * FROM objects WHERE id = LAST_INSERT_ID()""OnQueryFinish""ii"THREAD_LOAD_OBJECTSPlayerInfo[playerid][pWorld]);
 
                        
Reloadobjects(objectid); 
PHP код:
Reloadobject(objectid)
{
    if(
IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectidE_OBJECT_TYPE) == E_OBJECT_MAPPING)
    {
        new
            
id Streamer_GetExtraInt(objectidE_OBJECT_INDEX_ID);
        
DeleteMappingObject(objectid);
        
mysql_format(connectqueryBuffersizeof(queryBuffer), "SELECT * FROM objects WHERE id = %i"id);
        
mysql_tquery(connectqueryBuffer"OnQueryFinish""ii"THREAD_LOAD_OBJECTS);
    }

Reply
#5

Show me where this is defined:

PHP код:
Reloadobjects(objectid); 
Reply
#6

PHP код:
    switch(PlayerInfo[playerid][pEditType])
    {
        case 
EDIT_OBJECT_PREVIEW:
        {
            if(
response != EDIT_RESPONSE_UPDATE)
            {
                
DestroyDynamicObject(PlayerInfo[playerid][pEditObject]);
                
PlayerInfo[playerid][pEditObject] = INVALID_OBJECT_ID;
                
PlayerInfo[playerid][pEditType] = 0;
                if(
response == EDIT_RESPONSE_FINAL)
                {
                
                    new
                        
string[16];
                    
mysql_format(connectqueryBuffersizeof(queryBuffer), "INSERT INTO objects VALUES(null, %d, %d, '%e', %d, '%f', '%f', '%f', '%f', '%f', '%f', %d, %d, 0, 0)"objectidobjectsArray[PlayerInfo[playerid][pSelected]][oModel], objectsArray[PlayerInfo[playerid][pSelected]][oName], objectsArray[PlayerInfo[playerid][pSelected]][oPrice], xyzrxryrzPlayerInfo[playerid][pWorld]);
                    
mysql_tquery(connectqueryBuffer"""");
                    
mysql_tquery(connect"SELECT * FROM objects WHERE id = LAST_INSERT_ID()""OnQueryFinish""ii"THREAD_LOAD_OBJECTS);
//hereee
                    
Reloadobjects(objectid);
                    if(!
strcmp(objectsArray[PlayerInfo[playerid][pSelected]][oCategory], "Doors & Gates"))
                    {
                        
SendClientMessage(playeridCOLOR_WHITE"You can use /door to control your door and /lock to unlock or lock it.");
                    }
                }
                }
                else if(
response == EDIT_RESPONSE_CANCEL)
                {
                    
ShowDialogToPlayer(playeridDIALOG_BUIDOBJECT2);
                }
            }
        } 
under OnPlayerEditDynamicObject
Reply
#7

Is kinda weird dude because when i restart the server the objects are there saved in the same position you save..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)