[HELP]Recreating object
#2

You should split the code like this:

PHP код:
new kobject[8];
new 
robject[8];
public 
OnGameModeInit()
{
    
LoadKObjects();
    
LoadRObjects();
    return 
1;
}
stock LoadKObjects()
{
    
kobject[0] = CreateObject(186481942.1256, -2670.865719.361990.00000.00000.0000); 
    
kobject[1] = CreateObject(186481943.7292, -2671.914518.193090.00000.00000.0000); 
    
kobject[2] = CreateObject(186481935.0146, -2691.612319.26670.00000.00000.0000); 
    
kobject[3] = CreateObject(186481933.1440, -2691.943320.44280.00000.00000.0000); 
    
kobject[4] = CreateObject(186481934.9956, -2680.374719.21330.00000.00000.0000); 
    
kobject[5] = CreateObject(186481952.2093, -2685.646227.93370.00000.000090.0000);
    
kobject[6] = CreateObject(186481954.0262, -2677.513419.73250.00000.000090.0000);
    
kobject[7] = CreateObject(186481949.2596, -2677.558119.72130.00000.000090.0000);
}
stock LoadRObjects()
{
    
robject[0] = CreateObject(186471942.1256, -2670.865719.361990.00000.00000.0000); 
    
robject[1] = CreateObject(186471943.7292, -2671.914518.193090.00000.00000.0000); 
    
robject[2] = CreateObject(186471935.0146, -2691.612319.26670.00000.00000.0000); 
    
robject[3] = CreateObject(186471933.1440, -2691.943320.44280.00000.00000.0000);
    
robject[4] = CreateObject(186471934.9956, -2680.374719.21330.00000.00000.0000); 
    
robject[5] = CreateObject(186471952.2093, -2685.646227.93370.00000.000090.0000); 
    
robject[6] = CreateObject(186471954.0262, -2677.513419.73250.00000.000090.0000); 
    
robject[7] = CreateObject(186471949.2596, -2677.558119.72130.00000.000090.0000); 
}
forward csere();
public 
csere(){
    if(!
szin){
        
szin=1;
        for(new 
ii<8i++) DestroyObject(kobject[i]);
        
LoadRObjects();
    }
    else if (
szin){
        
szin=0;
        for(new 
ii<8i++) DestroyObject(robject[i]);
        
LoadKObjects();
    }

Reply


Messages In This Thread
[HELP]Recreating object - by Davi52 - 05.12.2018, 07:19
Re: [HELP]Recreating object - by Kaliber - 05.12.2018, 07:32

Forum Jump:


Users browsing this thread: 1 Guest(s)