SA-MP Forums Archive
Another 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: Another problem (/showthread.php?tid=618715)



Another problem - Micko123 - 09.10.2016

I had problem with saving pickups but i fixed it. Now i have problem with loading them.. It won't load then when player spawn. here is loading
PHP код:
public OnGameModeInit()
{
    for(new 
0MAX_PICKUPAp++)
    {
        new 
piFile[50];
        
format(piFilesizeof(piFile), PICKUPI_FILEp);
        if(
fexist(piFile))
        {
            
INI_ParseFile(piFile"UcitajPickupe", .bExtra true, .extra p);
            
PickupInfo[pickid][pPickup] = CreateDynamicPickup(PICKUP_IDPICKUP_TYPEPickupInfo[pickid][pX], PickupInfo[pickid][pY], PickupInfo[pickid][pZ]);
            
pickupi ++;
        }
    }
    return 
1;
}
forward UcitajPickupe(name[], value[]);
public 
UcitajPickupe(name[], value[])
{
    
INI_Float("X"PickupInfo[pickid][pX]);
    
INI_Float("Y"PickupInfo[pickid][pY]);
    
INI_Float("Z"PickupInfo[pickid][pZ]);
    return 
1;

Any ideas?


Re: Another problem - Micko123 - 09.10.2016

bump?


Re: Another problem - Threshold - 09.10.2016

Well, your function parameters are incorrect. I suggest you go and take another look at the y_ini tutorial to see what you did wrong.

Are you sure this even compiles properly?


Re: Another problem - Quinncell - 09.10.2016

I am guessing this is the function for loading the pickups?

Код:
forward UcitajPickupe(name[], value[]); 
public UcitajPickupe(name[], value[]) 
{ 
    INI_Float("X", PickupInfo[pickid][pX]); 
    INI_Float("Y", PickupInfo[pickid][pY]); 
    INI_Float("Z", PickupInfo[pickid][pZ]); 
    return 1; 
}
If it is, it's wrong.

I suggest you do what @Threshold said and take another look at the Y_ini tutorial.Perhaps the one you followed was wrong.
Also stop bumping threads every 5 mints, that's not allowed!You can bump it every 24h.


Re: Another problem - Micko123 - 09.10.2016

Can someone explain me what is problem??

I debugged it and it load pickups when i start server.exe but it won't create them in game..


Re: Another problem - Threshold - 09.10.2016

How does it even compile?
PHP код:
forward UcitajPickupe(name[], value[]); 
public 
UcitajPickupe(name[], value[]) 

    
INI_Float("X"PickupInfo[pickid][pX]); 
    
INI_Float("Y"PickupInfo[pickid][pY]); 
    
INI_Float("Z"PickupInfo[pickid][pZ]); 
    return 
1

Where have you even defined 'pickid'?


Re: Another problem - Micko123 - 09.10.2016

Here
PHP код:
enum piInfo
{
    
pPickup,
    
Float:pX,
    
Float:pY,
    
Float:pZ
}
new 
PickupInfo[MAX_PICKUPA][piInfo];
new 
pickid



Re: Another problem - Micko123 - 09.10.2016

Does anyone know this?


Re: Another problem - Stinged - 09.10.2016

First of all, don't bump before 24 hours.

How did you ever think this was going to work?
'pickid' is always 0, so every time you read a new file, you're setting the values of idx:0 (PickupInfo[MAX_PICKUPA])