Whats wrong?
#1

Hey... Whats wrong ?

PHP код:
    new INI:bFile INI_Open(BiznisPath(playerid));
    
INI_SetTag(bFile,"data");
    
INI_WriteInt(bFile,"Ime",BiznisInfo[MAX_BIZNISA][Name]);
    
INI_WriteInt(bFile,"Owner",BiznisInfo[MAX_BIZNISA][Owner]);
    
INI_WriteInt(bFile,"Pozicija",BiznisInfo[MAX_BIZNISA][Pozicija]);
    
INI_WriteInt(bFile,"Interijer",BiznisInfo[MAX_BIZNISA][Interijer]);
    
INI_WriteInt(bFile,"Zakljucan",BiznisInfo[MAX_BIZNISA][Zakljucan]);
    
INI_WriteInt(bFile,"Cijena",BiznisInfo[MAX_BIZNISA][Cijena]);
    
INI_Close(bFile); 
6 Errors:

PHP код:
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1586) : error 032: array index out of bounds (variable "BiznisInfo")
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1587) : error 032: array index out of bounds (variable "BiznisInfo")
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1588) : error 032: array index out of bounds (variable "BiznisInfo")
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1589) : error 032: array index out of bounds (variable "BiznisInfo")
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1590) : error 032: array index out of bounds (variable "BiznisInfo")
C:\Users\Dino Covic\Desktop\SAMP Server\gamemodes\Server_Skripta.pwn(1591) : error 032: array index out of bounds (variable "BiznisInfo"
Reply
#2

show
BiznisInfo enum
Reply
#3

PHP код:
enum bInfo
{
    
Name[128],
    
Owner[MAX_PLAYER_NAME],
    
Pozicija[3],
    
Interijer[10],
    
Zakljucan,
    
Cijena
};
new 
BiznisInfo[MAX_BIZNISA][bInfo]; 
Reply
#4

Your problem is in the loading of the businesses.

Something like this should be more applicable:

pawn Код:
for(new i = 0; i != MAX_BIZNISA; i++)
    {
            new INI:bFile = INI_Open(BiznisPath(playerid));
            INI_SetTag(bFile,"data");
            INI_WriteInt(bFile,"Ime",BiznisInfo[i][Name]);
            INI_WriteInt(bFile,"Owner",BiznisInfo[i][Owner]);
            INI_WriteInt(bFile,"Pozicija",BiznisInfo[i][Pozicija]);
            INI_WriteInt(bFile,"Interijer",BiznisInfo[i][Interijer]);
            INI_WriteInt(bFile,"Zakljucan",BiznisInfo[i][Zakljucan]);
            INI_WriteInt(bFile,"Cijena",BiznisInfo[i][Cijena]);
            INI_Close(bFile);  
    }
Like I said, SOMETHING like this should work. Not entirely sure if that will since I don't know how you have coded anything

// edit

Might not work - but follow that style of template and adjust as you see fit
Reply


Forum Jump:


Users browsing this thread: