SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 16/02/2013, 05:00 PM   #1
kristijan250
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default [Problem]Y_ini

I have problem with y_ini It show y size do not match, or destination array is too small
Code:
/BIZ//////////
////////////////////////////////////////////////////////
#define Biz_FILE    "Biz/%d.ini"
#define IGRAC_FILE   "Igrac/%s.ini"
#define MAX_Biz 100
///////////////////////////////////////////////////////
enum Biz
{
	bProveraVlasnika,
	bVlasnik[64],
	bVrsta[35],
	bIme[60],
	Float:bUlazX,
	Float:bUlazY,
	Float:bUlazZ,
	Float:bIzlazX,
	Float:bIzlazY,
	Float:bIzlazZ,
	bLevel,
	bCena,
    bNovac,
	bInt,
	bZatvoreno,
	bVW,
};
new BizInfo[MAX_Biz][Biz];
new BizPickup[sizeof(BizInfo)];
new Text3D:BizLabel[sizeof(BizInfo)];
public OnGameModeInit()
{
//===========biz============
for(new idBiz = 0; idBiz < sizeof(BizInfo); idBiz++)
    {
        new bfile[50], string[400];
        format(bfile, sizeof(bfile), Biz_FILE, idBiz);
        if(fexist(bfile))
        {
            INI_ParseFile(bfile, "UcitajBiz", .bExtra = true, .extra = idBiz);
            if(BizInfo[idBiz][bProveraVlasnika] == 0)
	        {
        	    format(string,sizeof(string),"Biz na Prodaju!\nVrsta: %s\nCena: %d\nLevel: %d\nID Biz:%d\nZa kupovinu /kupibiz",BizInfo[idBiz][bVrsta],BizInfo[idBiz][bCena],BizInfo[idBiz][bLevel],idBiz);
        	    BizLabel[idBiz] = Create3DTextLabel(string ,0x33CCFFAA,BizInfo[idBiz][bUlazX],BizInfo[idBiz][bUlazY],BizInfo[idBiz][bUlazZ],25,0,1);
        	    BizPickup[idBiz] = CreatePickup(1273, 1, BizInfo[idBiz][bUlazX], BizInfo[idBiz][bUlazY], BizInfo[idBiz][bUlazZ]);
        	}
        	else if(BizInfo[idBiz][bProveraVlasnika] == 1)
        	{
        	    format(string,sizeof(string),"[ %s ]\nVlasnik: %s\nVrsta: %s\nLevel:%d\nCena: %d\n%d\nID Biz: %d\n'F' za ulaz u biz",BizInfo[idBiz][bIme],BizInfo[idBiz][bVlasnik],BizInfo[idBiz][bVrsta],BizInfo[idBiz][bLevel],BizInfo[idBiz][bCena],idBiz);
        	    BizLabel[idBiz] = Create3DTextLabel(string ,0x33CCFFAA,BizInfo[idBiz][bUlazX],BizInfo[idBiz][bUlazY],BizInfo[idBiz][bUlazZ],25,0,1);
        	    BizPickup[idBiz] = CreatePickup(1239, 1, BizInfo[idBiz][bUlazX], BizInfo[idBiz][bUlazY], BizInfo[idBiz][bUlazZ]);
        	}
		}
	}
return 1;
}
public OnGameModeExit()
{
   for(new k = 0; k <= MAX_Biz; k++) { SacuvajBiz(k); }
	return 1;
}

///////////////////////////////////////////////////
forward UcitajBiz(idBiz, name[], value[]);
public UcitajBiz(idBiz, name[], value[])
{
	INI_Int("ProveraVlasnika",BizInfo[idBiz][bProveraVlasnika]);
	INI_String("Vlasnik",BizInfo[idBiz][bVlasnik],64);<---------------------Eror Line
    INI_String("Vrsta",BizInfo[idBiz][bVrsta],35);<---------------------Eror Line
    INI_String("Ime",BizInfo[idBiz][bIme],60);<---------------------Eror line
    INI_Float("UlazX",BizInfo[idBiz][bUlazX]);
    INI_Float("UlazY",BizInfo[idBiz][bUlazY]);
    INI_Float("UlazZ",BizInfo[idBiz][bUlazZ]);
    INI_Float("IzlazX",BizInfo[idBiz][bIzlazX]);
    INI_Float("IzlazY",BizInfo[idBiz][bIzlazY]);
    INI_Float("IzlazZ",BizInfo[idBiz][bIzlazZ]);
    INI_Int("Level",BizInfo[idBiz][bLevel]);
    INI_Int("Cena",BizInfo[idBiz][bCena]);
    INI_Int("Novac",BizInfo[idBiz][bNovac]);
    INI_Int("Interior",BizInfo[idBiz][bInt]);
    INI_Int("Zatvoreno",BizInfo[idBiz][bZatvoreno]);
    INI_Int("VW",BizInfo[idBiz][bVW]);
	return 1;
}
///////////////////////////////////////////////////
stock SacuvajBiz(idBiz)
{
	new bfile[128];
    format(bfile, sizeof(bfile), Biz_FILE, idBiz);
	new INI:File = INI_Open(bfile);
	INI_WriteInt(File,"ProveraVlasnika",BizInfo[idBiz][bProveraVlasnika]);
	INI_WriteString(File,"Vlasnik",BizInfo[idBiz][bVlasnik]);
	INI_WriteString(File,"Vrsta",BizInfo[idBiz][bVrsta]);
	INI_WriteString(File,"Ime",BizInfo[idBiz][bIme]);
	INI_WriteFloat(File,"UlazX",BizInfo[idBiz][bUlazX]);
	INI_WriteFloat(File,"UlazY",BizInfo[idBiz][bUlazY]);
	INI_WriteFloat(File,"UlazZ",BizInfo[idBiz][bUlazZ]);
	INI_WriteFloat(File,"IzlazX",BizInfo[idBiz][bIzlazX]);
	INI_WriteFloat(File,"IzlazY",BizInfo[idBiz][bIzlazY]);
	INI_WriteFloat(File,"IzlazZ",BizInfo[idBiz][bIzlazZ]);
	INI_WriteInt(File,"Level",BizInfo[idBiz][bLevel]);
    INI_WriteInt(File,"Cena",BizInfo[idBiz][bCena]);
    INI_WriteInt(File,"Novac",BizInfo[idBiz][bNovac]);
    INI_WriteInt(File,"Interior",BizInfo[idBiz][bInt]);
    INI_WriteInt(File,"Zatvoreno",BizInfo[idBiz][bZatvoreno]);
    INI_WriteInt(File,"VW",BizInfo[idBiz][bVW]);
	INI_Close(File);
	return 1;
}
kristijan250 is offline   Reply With Quote
Old 16/02/2013, 05:03 PM   #2
S0n1COwnsYou
Big Clucker
 
S0n1COwnsYou's Avatar
 
Join Date: Feb 2013
Posts: 93
Reputation: 1
Default Re: [Problem]Y_ini

try changing this
PHP Code:
    bVlasnik[64],
    
bVrsta[35],
    
bIme[60], 
to this
PHP Code:
    bVlasnik[65],
    
bVrsta[36],
    
bIme[61], 
__________________
...
S0n1COwnsYou is offline   Reply With Quote
Old 16/02/2013, 05:08 PM   #3
kristijan250
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default Re: [Problem]Y_ini

Sonic don't work erors are
INI_String("Vlasnik",BizInfo[idBiz][bVlasnik],64);<---------------------Eror Line
INI_String("Vrsta",BizInfo[idBiz][bVrsta],35);<---------------------Eror Line
INI_String("Ime",BizInfo[idBiz][bIme],60);<---------------------Eror line
kristijan250 is offline   Reply With Quote
Old 16/02/2013, 05:11 PM   #4
S0n1COwnsYou
Big Clucker
 
S0n1COwnsYou's Avatar
 
Join Date: Feb 2013
Posts: 93
Reputation: 1
Default Re: [Problem]Y_ini

Quote:
Originally Posted by S0n1COwnsYou View Post
try changing this
PHP Code:
    bVlasnik[64],
    
bVrsta[35],
    
bIme[60], 
to this
PHP Code:
    bVlasnik[65],
    
bVrsta[36],
    
bIme[61], 
did you try that and still giving you an error ?
__________________
...
S0n1COwnsYou is offline   Reply With Quote
Old 16/02/2013, 05:14 PM   #5
kristijan250
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default Re: [Problem]Y_ini

Quote:
Originally Posted by S0n1COwnsYou View Post
did you try that and still giving you an error ?
yes that eror gives it again
kristijan250 is offline   Reply With Quote
Old 16/02/2013, 05:20 PM   #6
S0n1COwnsYou
Big Clucker
 
S0n1COwnsYou's Avatar
 
Join Date: Feb 2013
Posts: 93
Reputation: 1
Default Re: [Problem]Y_ini

try this
PHP Code:
    INI_String("Vlasnik",BizInfo[idBiz][bVlasnik],sizeof(BizInfo[idBiz][bVlasnik]));<---------------------Eror Line
    INI_String
("Vrsta",BizInfo[idBiz][bVrsta],sizeof(BizInfo[idBiz][bVrsta]));<---------------------Eror Line
    INI_String
("Ime",BizInfo[idBiz][bIme],sizeof(BizInfo[idBiz][bIme]));<---------------------Eror line 
__________________
...
S0n1COwnsYou is offline   Reply With Quote
Old 16/02/2013, 05:26 PM   #7
kristijan250
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default Re: [Problem]Y_ini

Quote:
Originally Posted by S0n1COwnsYou View Post
try this
PHP Code:
    INI_String("Vlasnik",BizInfo[idBiz][bVlasnik],sizeof(BizInfo[idBiz][bVlasnik]));<---------------------Eror Line
    INI_String
("Vrsta",BizInfo[idBiz][bVrsta],sizeof(BizInfo[idBiz][bVrsta]));<---------------------Eror Line
    INI_String
("Ime",BizInfo[idBiz][bIme],sizeof(BizInfo[idBiz][bIme]));<---------------------Eror line 
Again same errors
kristijan250 is offline   Reply With Quote
Old 16/02/2013, 05:31 PM   #8
S0n1COwnsYou
Big Clucker
 
S0n1COwnsYou's Avatar
 
Join Date: Feb 2013
Posts: 93
Reputation: 1
Default Re: [Problem]Y_ini

are you sure ur enum look like this:
PHP Code:
enum Biz
{
    
bProveraVlasnika,
    
bVlasnik[65],
    
bVrsta[36],
    
bIme[61],
    
Float:bUlazX,
    
Float:bUlazY,
    
Float:bUlazZ,
    
Float:bIzlazX,
    
Float:bIzlazY,
    
Float:bIzlazZ,
    
bLevel,
    
bCena,
        
bNovac,
    
bInt,
    
bZatvoreno,
    
bVW,
}; 
__________________
...
S0n1COwnsYou is offline   Reply With Quote
Old 16/02/2013, 05:34 PM   #9
kristijan250
Little Clucker
 
Join Date: Sep 2012
Posts: 19
Reputation: 0
Default Re: [Problem]Y_ini

Code:
enum Biz
{
	bProveraVlasnika,
	bVlasnik[64],
	bVrsta[36],
	bIme[61],
	Float:bUlazX,
	Float:bUlazY,
	Float:bUlazZ,
	Float:bIzlazX,
	Float:bIzlazY,
	Float:bIzlazZ,
	bLevel,
	bCena,
        bNovac,
	bInt,
	bZatvoreno,
	bVW,
};
Here are
kristijan250 is offline   Reply With Quote
Old 16/02/2013, 05:36 PM   #10
S0n1COwnsYou
Big Clucker
 
S0n1COwnsYou's Avatar
 
Join Date: Feb 2013
Posts: 93
Reputation: 1
Default Re: [Problem]Y_ini

Change This:
PHP Code:
enum Biz
{
    
bProveraVlasnika,
    
bVlasnik[64],
    
bVrsta[36],
    
bIme[61],
    
Float:bUlazX,
    
Float:bUlazY,
    
Float:bUlazZ,
    
Float:bIzlazX,
    
Float:bIzlazY,
    
Float:bIzlazZ,
    
bLevel,
    
bCena,
        
bNovac,
    
bInt,
    
bZatvoreno,
    
bVW,
}; 
To This:
PHP Code:
enum Biz
{
    
bProveraVlasnika,
    
bVlasnik[65],
    
bVrsta[36],
    
bIme[61],
    
Float:bUlazX,
    
Float:bUlazY,
    
Float:bUlazZ,
    
Float:bIzlazX,
    
Float:bIzlazY,
    
Float:bIzlazZ,
    
bLevel,
    
bCena,
        
bNovac,
    
bInt,
    
bZatvoreno,
    
bVW,
}; 
__________________
...

Last edited by S0n1COwnsYou; 16/02/2013 at 06:15 PM.
S0n1COwnsYou is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Y_ini Problem Gangster-rocks Scripting Help 9 02/01/2013 07:29 PM
y_ini problem aqu Scripting Help 0 11/06/2012 05:36 PM
Problem with Y_ini(Big Problem with this Include+MV Panel) ServerScripter Scripting Help 2 04/09/2011 10:30 PM
Y_INI Problem Doom8890 Help Archive 1 13/06/2011 11:36 AM
Y_ini problem tbedy Help Archive 11 03/06/2011 11:41 AM


All times are GMT. The time now is 05:11 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.