SA-MP Forums Archive
Load problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Load problem (/showthread.php?tid=602284)



Load problem - N0FeaR - 05.03.2016

this wont load when i start the server

PHP код:
stock LoadGates()
{
    for(new 
0SCRIPT_MAXGATESg++)
    {
        new 
fsave[40], string[128];
        
format(fsave50"gates/%d.ini"g);
        if(
DOF2_GetInt(stringfsave) != 0)
         {
            
format(fsave50"Model");
            
//DOF2_GetInt(string,fsave,GateInfo[g][gModel]);
            
GateInfo[g][gModel] = DOF2_GetInt(string,fsave);
            
format(fsave50"CX");
            
GateInfo[g][gCX] = DOF2_GetFloat(string,fsave);
            
format(fsave50"CY");
            
GateInfo[g][gCY] = DOF2_GetFloat(string,fsave);
            
format(fsave50"CZ");
            
GateInfo[g][gCZ] = DOF2_GetFloat(string,fsave);
            
format(fsave50"CRX");
            
GateInfo[g][gCRX] = DOF2_GetFloat(string,fsave);
            
format(fsave50"CRY");
            
GateInfo[g][gCRY] = DOF2_GetFloat(string,fsave);
            
format(fsave50"CRZ");
             
GateInfo[g][gCRZ] = DOF2_GetFloat(string,fsave);
            
format(fsave50"OX");
             
GateInfo[g][gOX] = DOF2_GetFloat(string,fsave);
            
format(fsave50"OY");
             
GateInfo[g][gOY] = DOF2_GetFloat(string,fsave);
            
format(fsave50"OZ");
             
GateInfo[g][gOZ] = DOF2_GetFloat(string,fsave);
            
format(fsave50"ORX");
             
GateInfo[g][gORX] = DOF2_GetFloat(string,fsave);
            
format(fsave50"ORY");
            
GateInfo[g][gORY] = DOF2_GetFloat(string,fsave);
            
format(fsave50"ORZ");
            
GateInfo[g][gORZ] = DOF2_GetFloat(string,fsave);
            
format(fsave50"Password");
              
GateInfo[g][gPassword] = DOF2_GetInt(string,fsave);
            
format(fsave50"Speed");
              
GateInfo[g][gSpeed] = DOF2_GetInt(string,fsave);
            
GateInfo[g][gGate] = CreateDynamicObject(GateInfo[g][gModel], GateInfo[g][gCX], GateInfo[g][gCY], GateInfo[g][gCZ], GateInfo[g][gCRX], GateInfo[g][gCRY], GateInfo[g][gCRZ]);
        }
    }




Re: Load problem - xEF - 05.03.2016

Maybe it's related on an issue on your 'if' variables, check them again.
Where this code is placed on the gamemode?


Re: Load problem - N0FeaR - 05.03.2016

Quote:
Originally Posted by xEF
Посмотреть сообщение
Maybe it's related on an issue on your 'if' variables, check them again.
Where this code is placed on the gamemode?
No its not, i had at ongamemodeint and i moved it to there all the other stock.


Re: Load problem - xEF - 05.03.2016

So if variables 'if' are not the problem creators, watching the code the only thing that i can say it's that are so much lines that save a value, in the stock, you should think on an 'else' structure in order to avoid bugs.
Or maybe where the stock is declaired to get loaded, it's bad.

Correct me if i am bad.


Re: Load problem - jlalt - 05.03.2016

Change this
PHP код:
format(fsave50"gates/%d.ini"g); 
        if(
DOF2_GetInt(stringfsave) != 0
         { 
to
PHP код:
format(string50"gates/%d.ini"g); 
        if(
fexist(string)) 
         { 



Re: Load problem - N0FeaR - 05.03.2016

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Change this
PHP код:
format(fsave50"gates/%d.ini"g); 
        if(
DOF2_GetInt(stringfsave) != 0
         { 
to
PHP код:
format(string50"gates/%d.ini"g); 
        if(
fexist(string)) 
         { 
Thank you, now its working!