SA-MP Forums Archive
Whats wrong? - 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: Whats wrong? (/showthread.php?tid=572384)



Whats wrong? - NoDi522 - 27.04.2015

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"



Re: Whats wrong? - Azula - 27.04.2015

show
BiznisInfo enum


Re: Whats wrong? - NoDi522 - 27.04.2015

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



Re: Whats wrong? - sammp - 27.04.2015

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