Problem with OnPlayerEditDynamicObject
#1

I am creating a dynamic gate system and placing them works. Opening works and the automatic closing after x seconds also works.
Now when I instantly edit the gate after creating it, it is fine. But when I restart the server and the gates are loaded by the script, I can edit them, but after clicking save, it doesn't call OnPlayerEditDynamicObject. Then if I create a new gate next to it, I can still edit it and OnPlayerEditDynamicObject is getting called. Until server restart.

This is my code:
PHP Code:
//Adding a gate:
        
ServerGates[id][GateObject] = CreateDynamicObject(ServerGates[id][GateModel], ServerGates[id][GatePosX]-1.0ServerGates[id][GatePosY]-1.0ServerGates[id][GatePosZ], ServerGates[id][GateRotX], ServerGates[id][GateRotY], ServerGates[id][GateRotZ]);
        
EditDynamicObject(playeridServerGates[id][GateObject]);
//Editing a gate uses this line
EditDynamicObject(playeridServerGates[id][GateObject]);
//Loading gates
LoadServerGates()
{
    new 
DBResult:LOAD_GATES_RESULTS;
    new 
szQuery[256], gatecount 0;
    for(new 
0;d<MAX_GATES;d++)
    {
        new 
id d;
        
format(szQuerysizeof(szQuery), "SELECT * FROM `GATES` WHERE `ID` = '%d'"id);
        
LOAD_GATES_RESULTS db_query(ZARP_DATABASEszQuery);
        if(
db_num_rows(LOAD_GATES_RESULTS))
        {
            
ServerGates[id][GateWorld] = db_get_field_assoc_int(LOAD_GATES_RESULTS"WORLD");
            
ServerGates[id][GateInterior] = db_get_field_assoc_int(LOAD_GATES_RESULTS"INTERIOR");
            
ServerGates[id][GateModel] = db_get_field_assoc_int(LOAD_GATES_RESULTS"MODELID");
            
ServerGates[id][GatePosX] = db_get_field_assoc_float(LOAD_GATES_RESULTS"POSX");
            
ServerGates[id][GatePosY] = db_get_field_assoc_float(LOAD_GATES_RESULTS"POSY");
            
ServerGates[id][GatePosZ] = db_get_field_assoc_float(LOAD_GATES_RESULTS"POSZ");
            
ServerGates[id][GateRotX] = db_get_field_assoc_float(LOAD_GATES_RESULTS"ROTX");
            
ServerGates[id][GateRotY] = db_get_field_assoc_float(LOAD_GATES_RESULTS"ROTY");
            
ServerGates[id][GateRotZ] = db_get_field_assoc_float(LOAD_GATES_RESULTS"ROTZ");
            
ServerGates[id][GateOPosX] = db_get_field_assoc_float(LOAD_GATES_RESULTS"OPOSX");
            
ServerGates[id][GateOPosY] = db_get_field_assoc_float(LOAD_GATES_RESULTS"OPOSY");
            
ServerGates[id][GateOPosZ] = db_get_field_assoc_float(LOAD_GATES_RESULTS"OPOSZ");
            
ServerGates[id][GateORotX] = db_get_field_assoc_float(LOAD_GATES_RESULTS"OROTX");
            
ServerGates[id][GateORotY] = db_get_field_assoc_float(LOAD_GATES_RESULTS"OROTY");
            
ServerGates[id][GateORotZ] = db_get_field_assoc_float(LOAD_GATES_RESULTS"OROTZ");
            
ServerGates[id][GateObject] = CreateDynamicObject(ServerGates[id][GateModel], ServerGates[id][GatePosX], ServerGates[id][GatePosY], ServerGates[id][GatePosZ], ServerGates[id][GateRotX], ServerGates[id][GateRotY], ServerGates[id][GateRotZ]);
             
gatecount++;
        }
    }
    
printf("Gates loaded: %d out of %d"gatecountMAX_GATES);
    
db_free_result(LOAD_GATES_RESULTS);
      return 
1;

What is causing this? The object is there, I can edit it's position and it even saves it position after saving but OnPlayerEditDynamicObject is not getting called.
Reply
#2

I guess you have to take a look on this

https://github.com/samp-incognito/sa...ugin/issues/31
https://github.com/samp-incognito/sa...gin/issues/262

However could you post list of plugins that's you are using (OnPlayerEditDynamicObject callback aswell)? Conflicts between sampGDK version would broke both plugins.

also what linux distribution you are using (in your vps)?

EDIT: and if possible 10 or 5 lines that's come before the second "EditDynamicObject..."
Reply
#3

Thanks for your reply. I searched a bit and stumbled onto this:
https://github.com/samp-incognito/sa...ugin/issues/17
Apparently this is caused by having a filterscript that uses streamer. It works fine after I remove the fs may anyone run into this problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)