Another problem
#1

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?
Reply
#2

bump?
Reply
#3

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?
Reply
#4

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.
Reply
#5

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..
Reply
#6

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'?
Reply
#7

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

Does anyone know this?
Reply
#9

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])
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)