undefined symbol "name"
#1

I am getting the following errors when I compile my script:
pawn Код:
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(272) : error 017: undefined symbol "name"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(272) : error 017: undefined symbol "value"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(273) : error 017: undefined symbol "name"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(273) : error 017: undefined symbol "value"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(274) : error 017: undefined symbol "name"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(274) : error 017: undefined symbol "value"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(274) : warning 213: tag mismatch
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(275) : error 017: undefined symbol "name"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(275) : error 017: undefined symbol "value"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(275) : warning 213: tag mismatch
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(276) : error 017: undefined symbol "name"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(276) : error 017: undefined symbol "value"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(276) : warning 213: tag mismatch
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(277) : error 017: undefined symbol "name"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(277) : error 017: undefined symbol "value"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(278) : error 017: undefined symbol "name"
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(278) : error 035: argument type mismatch (argument 2)
There is allot and that is why I only put the thread topic as the prominent error.

Here is the lines it is having problems with, ignore that it is a public, it is not supposed to be it is only like that as error messages would not show when the code was inside of a stock
pawn Код:
public LoadHouses()
{
    new file[60],houseowner[24];
    for(new i = 0; i < MAX_HOUSES;i++)
    {
        format(file,sizeof(file),"Houses/%i.ini",i);
        if(!fexist(file)) continue;
        new INI:ini = INI_Open(file);
        INI_Int("Price", HInfo[i][Price]);
        INI_Int("Owned", HInfo[i][Owned]);
        INI_Int("XPos", HInfo[i][XPos]);
        INI_Int("YPos", HInfo[i][YPos]);
        INI_Int("ZPos", HInfo[i][ZPos]);
        INI_Int("VirtualWorld", HInfo[i][VirtualWorldID]);
        INI_String("Owner", houseowner, MAX_PLAYER_NAME);
        format(HInfo[i][Owner],24,"%s",houseowner);
        HouseEnter[i]  = CreateDynamicCP(HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],1.5,HInfo[i][VirtualWorldID]);
        HouseExit[i] = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,HInfo[i][VirtualWorldID]);
        new labelstring[100];
        switch(HInfo[i][Owned])
        {
            case 0:{format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HInfo[i][Price]);}
            case 1:{format(labelstring,sizeof(labelstring),"Owned: Yes \nPrice: %i \nOwner: %s",HInfo[i][Price],HInfo[i][Owner]);}
        }
        HInfo[i][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],25.0,HInfo[i][VirtualWorldID]);
        HouseCount++;
        INI_Close(ini);
    }
    return 1;
}
P.S I am now a huge clucker
Reply
#2

put a //comment on the line with the problem
Reply
#3

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
put a //comment on the line with the problem
How will commenting out a line even help? I need to fix the issue as my house system is not working because of it
Reply
#4

He ment show us the error lines.
Reply
#5

Are "name" even used?.. Show your error line.
I think the other guy also meant that..
Reply
#6

HERE YOU HERE IS 1 i created, REP ++ if i helped u

Код:
#define MAX_HOUSES 100
Код:
//ADD SOMEWHERE with all ur other enums
enum houseInfo
{
	hLevel,
	hPrice,
	hStatus,
	hOwner[32],
	Float:hX,
	Float:hY,
	Float:hZ,
	hMoney,
	hMaterials,
	hWeed,
	hCrack,
	hGun[5],
	hGunAmmo[5],
	hPickup,
	Text3D:hText
}
new HouseInfo[MAX_HOUSES][houseInfo];
Код:
 
ADD AT THE BOTTOM, LOAD HOUSE (WHEN GM START) SAVE GM (WHEN GM CLOSES)
stock LoadHouse()
{
	new binfo[21][32];
	new string[256];
	new File:file = fopen("houses.cfg", io_read);
	if(file)
	{
	    new idx = 1;
		while(idx < MAX_HOUSES)
		{
		    fread(file, string);
		    split(string, binfo, '|');
		    HouseInfo[idx][hLevel] = strval(binfo[0]);
		    HouseInfo[idx][hPrice] = strval(binfo[1]);
		    HouseInfo[idx][hStatus] = strval(binfo[2]);
		    format(HouseInfo[idx][hOwner], 32, "%s", binfo[3]);
		    HouseInfo[idx][hX] = floatstr(binfo[4]);
		    HouseInfo[idx][hY] = floatstr(binfo[5]);
		    HouseInfo[idx][hZ] = floatstr(binfo[6]);
		    HouseInfo[idx][hMoney] = strval(binfo[7]);
		    HouseInfo[idx][hMaterials] = strval(binfo[8]);
		    HouseInfo[idx][hWeed] = strval(binfo[9]);
		    HouseInfo[idx][hCrack] = strval(binfo[10]);
			HouseInfo[idx][hGun][0] = strval(binfo[11]);
			HouseInfo[idx][hGunAmmo][0] = strval(binfo[12]);
			HouseInfo[idx][hGun][1] = strval(binfo[13]);
			HouseInfo[idx][hGunAmmo][1] = strval(binfo[14]);
			HouseInfo[idx][hGun][2] = strval(binfo[15]);
			HouseInfo[idx][hGunAmmo][2] = strval(binfo[16]);
			HouseInfo[idx][hGun][3] = strval(binfo[17]);
			HouseInfo[idx][hGunAmmo][3] = strval(binfo[18]);
			HouseInfo[idx][hGun][4] = strval(binfo[19]);
			HouseInfo[idx][hGunAmmo][4] = strval(binfo[20]);
			if(HouseInfo[idx][hLevel])
			{
			    HouseInfo[idx][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ], 0);
                if(!strcmp("The State", HouseInfo[idx][hOwner])) format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], HouseInfo[idx][hPrice]);
				else format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: %s", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], RHS(idx));
				HouseInfo[idx][hText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]+0.3, 15);

			}
			idx++;
	    }
	}
	print("Houses loaded successfully.");
	return 1;
}

stock SaveHouse()
{
	new idx = 1, File:file;
	new string[256];
	while(idx < MAX_HOUSES)
	{
	    format(string, sizeof(string), "%d|%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
	    HouseInfo[idx][hLevel],
	    HouseInfo[idx][hPrice],
	    HouseInfo[idx][hStatus],
	    HouseInfo[idx][hOwner],
	    HouseInfo[idx][hX],
	    HouseInfo[idx][hY],
	    HouseInfo[idx][hZ],
	    HouseInfo[idx][hMoney],
	    HouseInfo[idx][hMaterials],
	    HouseInfo[idx][hWeed],
	    HouseInfo[idx][hCrack],
		HouseInfo[idx][hGun][0],
		HouseInfo[idx][hGunAmmo][0],
		HouseInfo[idx][hGun][1],
		HouseInfo[idx][hGunAmmo][1],
		HouseInfo[idx][hGun][2],
		HouseInfo[idx][hGunAmmo][2],
		HouseInfo[idx][hGun][3],
		HouseInfo[idx][hGunAmmo][3],
		HouseInfo[idx][hGun][4],
		HouseInfo[idx][hGunAmmo][4]
		);
	    if(idx == 1)
	    {
	        file = fopen("houses.cfg", io_write);
	    }
	    else
	    {
	    	file = fopen("houses.cfg", io_append);
	    }
		fwrite(file, string);
		fclose(file);
		idx++;
	}
	print("Houses saved successfully.");
}
Reply
#7

272 Line:
pawn Код:
INI_Int("Price", HInfo[i][Price]);
273 Line:
pawn Код:
INI_Int("Owned", HInfo[i][Owned]);
274 Line:
pawn Код:
INI_Int("XPos", HInfo[i][XPos]);
275 Line:
pawn Код:
INI_Int("YPos", HInfo[i][YPos]);
276 Line:
pawn Код:
INI_Int("ZPos", HInfo[i][ZPos]);
277 Line:
pawn Код:
INI_Int("VirtualWorld", HInfo[i][VirtualWorldID]);
278 Line:
pawn Код:
INI_String("Owner", houseowner, MAX_PLAYER_NAME);
These are the lines in question, and you are right name and values is not used however it is something to do with Y_INI
Reply
#8

Quote:
Originally Posted by trapstar2020
Посмотреть сообщение
HERE YOU HERE IS 1 i created, REP ++ if i helped u

Код:
#define MAX_HOUSES 100
Код:
//ADD SOMEWHERE with all ur other enums
enum houseInfo
{
	hLevel,
	hPrice,
	hStatus,
	hOwner[32],
	Float:hX,
	Float:hY,
	Float:hZ,
	hMoney,
	hMaterials,
	hWeed,
	hCrack,
	hGun[5],
	hGunAmmo[5],
	hPickup,
	Text3D:hText
}
new HouseInfo[MAX_HOUSES][houseInfo];
Код:
 
ADD AT THE BOTTOM, LOAD HOUSE (WHEN GM START) SAVE GM (WHEN GM CLOSES)
stock LoadHouse()
{
	new binfo[21][32];
	new string[256];
	new File:file = fopen("houses.cfg", io_read);
	if(file)
	{
	    new idx = 1;
		while(idx < MAX_HOUSES)
		{
		    fread(file, string);
		    split(string, binfo, '|');
		    HouseInfo[idx][hLevel] = strval(binfo[0]);
		    HouseInfo[idx][hPrice] = strval(binfo[1]);
		    HouseInfo[idx][hStatus] = strval(binfo[2]);
		    format(HouseInfo[idx][hOwner], 32, "%s", binfo[3]);
		    HouseInfo[idx][hX] = floatstr(binfo[4]);
		    HouseInfo[idx][hY] = floatstr(binfo[5]);
		    HouseInfo[idx][hZ] = floatstr(binfo[6]);
		    HouseInfo[idx][hMoney] = strval(binfo[7]);
		    HouseInfo[idx][hMaterials] = strval(binfo[8]);
		    HouseInfo[idx][hWeed] = strval(binfo[9]);
		    HouseInfo[idx][hCrack] = strval(binfo[10]);
			HouseInfo[idx][hGun][0] = strval(binfo[11]);
			HouseInfo[idx][hGunAmmo][0] = strval(binfo[12]);
			HouseInfo[idx][hGun][1] = strval(binfo[13]);
			HouseInfo[idx][hGunAmmo][1] = strval(binfo[14]);
			HouseInfo[idx][hGun][2] = strval(binfo[15]);
			HouseInfo[idx][hGunAmmo][2] = strval(binfo[16]);
			HouseInfo[idx][hGun][3] = strval(binfo[17]);
			HouseInfo[idx][hGunAmmo][3] = strval(binfo[18]);
			HouseInfo[idx][hGun][4] = strval(binfo[19]);
			HouseInfo[idx][hGunAmmo][4] = strval(binfo[20]);
			if(HouseInfo[idx][hLevel])
			{
			    HouseInfo[idx][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ], 0);
                if(!strcmp("The State", HouseInfo[idx][hOwner])) format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: For Sale\nPrice: $%d", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], HouseInfo[idx][hPrice]);
				else format(string, sizeof(string), "ID: %d\nHouse (Lvl: %d)\nOwner: %s\nStatus: %s", idx, HouseInfo[idx][hLevel], HouseInfo[idx][hOwner], RHS(idx));
				HouseInfo[idx][hText] = CreateDynamic3DTextLabel(string, COLOR_WHITE, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ]+0.3, 15);

			}
			idx++;
	    }
	}
	print("Houses loaded successfully.");
	return 1;
}

stock SaveHouse()
{
	new idx = 1, File:file;
	new string[256];
	while(idx < MAX_HOUSES)
	{
	    format(string, sizeof(string), "%d|%d|%d|%s|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\r\n",
	    HouseInfo[idx][hLevel],
	    HouseInfo[idx][hPrice],
	    HouseInfo[idx][hStatus],
	    HouseInfo[idx][hOwner],
	    HouseInfo[idx][hX],
	    HouseInfo[idx][hY],
	    HouseInfo[idx][hZ],
	    HouseInfo[idx][hMoney],
	    HouseInfo[idx][hMaterials],
	    HouseInfo[idx][hWeed],
	    HouseInfo[idx][hCrack],
		HouseInfo[idx][hGun][0],
		HouseInfo[idx][hGunAmmo][0],
		HouseInfo[idx][hGun][1],
		HouseInfo[idx][hGunAmmo][1],
		HouseInfo[idx][hGun][2],
		HouseInfo[idx][hGunAmmo][2],
		HouseInfo[idx][hGun][3],
		HouseInfo[idx][hGunAmmo][3],
		HouseInfo[idx][hGun][4],
		HouseInfo[idx][hGunAmmo][4]
		);
	    if(idx == 1)
	    {
	        file = fopen("houses.cfg", io_write);
	    }
	    else
	    {
	    	file = fopen("houses.cfg", io_append);
	    }
		fwrite(file, string);
		fclose(file);
		idx++;
	}
	print("Houses saved successfully.");
}
I'm not even going to read that seeing as a) you are begging me to REP+ you and also how will I learn anything by you pasting in a script?
Reply
#9

Quote:
Originally Posted by ******
Посмотреть сообщение
Have you read the y_ini tutorial? If not do so - it explains loading in great detail.
Yea I was reading it however I was not sure where I was going :S I don't suppose you could push me in the right direction ******
Reply
#10

Quote:
Originally Posted by ******
Посмотреть сообщение
Well first I suggest you finish reading it - and don't try skip sections.
To follow up I read it and saw how stupid I was (Should have read my load user data function first before being stupid!) ^^ however I am not sure if I am using this right as I am getting the following errors:
pawn Код:
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(271) : warning 213: tag mismatch
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(272) : warning 213: tag mismatch
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(273) : warning 213: tag mismatch
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(275) : error 035: argument type mismatch (argument 2)
Y:\Documents\SpectralRP\gamemodes\spectralrp.pwn(288) : error 035: argument type mismatch (argument 1)
And here is the changes that I made to the code, I'm not sure if it will read the houses on server startup though :S
pawn Код:
INI:ini[housedata](name[], value[])
{
    new houseowner[24];
    for(new i = 0; i < MAX_HOUSES;i++)
    {
        INI_Int("Price",HInfo[i][Price]);
        INI_Int("Owned",HInfo[i][Owned]);
        INI_Int("XPos",HInfo[i][XPos]);
        INI_Int("YPos",HInfo[i][YPos]);
        INI_Int("ZPos",HInfo[i][ZPos]);
        INI_Int("VirtualWorld",HInfo[i][VirtualWorldID]);
        INI_String("Owner", houseowner, sizeof(houseowner));
    }
    return 1;
}
public LoadHouses()
{
    new file[60],houseowner[24];
    for(new i = 0; i < MAX_HOUSES;i++)
    {
        format(file,sizeof(file),"Houses/%i.ini",i);
        if(!fexist(file)) continue;
        new INI:ini = INI_Open(file);
        format(HInfo[i][Owner],24,"%s",houseowner);
        INI_Load(ini);
        HouseEnter[i]  = CreateDynamicCP(HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],1.5,HInfo[i][VirtualWorldID]);
        HouseExit[i] = CreateDynamicCP(443.9237,509.4609,1001.4195,1.5,HInfo[i][VirtualWorldID]);
        new labelstring[100];
        switch(HInfo[i][Owned])
        {
            case 0:{format(labelstring,sizeof(labelstring),"Owned: No \nPrice: %i",HInfo[i][Price]);}
            case 1:{format(labelstring,sizeof(labelstring),"Owned: Yes \nPrice: %i \nOwner: %s",HInfo[i][Price],HInfo[i][Owner]);}
        }
        HInfo[i][HouseLabel] = Create3DTextLabel(labelstring,0xFF0000FF,HInfo[i][XPos],HInfo[i][YPos],HInfo[i][ZPos],25.0,HInfo[i][VirtualWorldID]);
        HouseCount++;
        INI_Close(ini);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)