SA-MP Forums Archive
Having Problem With y_ini - 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: Having Problem With y_ini (/showthread.php?tid=632185)



Having Problem With y_ini - akib - 10.04.2017

Код:
#include <y_ini>
Код:
enum
	PlayerInfo
{
	SCORE,
	MONEY,
	KILLS,
	DEATHS,
	SKIN
};
Код:
public OnPlayerDisconnect(playerid, reason)
{
	new name[MAX_PLAYER_NAME],ini[126];
	GetPlayerName(playerid, name, sizeof(name));

	format(ini,sizeof(ini),"%s.ini",name);
	new fileToWrite[] = ini;
    
    INI:iniFile = INI_Open(fileToWrite);
    INI_SetTag(iniFile, "UserData");
    INI_WriteInt(iniFile, "some_integer", 42);
	return 1;
}
That gives
Код:
D:\GTA San Andreas \Server\pawno\include\y_ini.inc(1050) : warning 202: number of arguments does not match definition
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(78) : error 008: must be a constant expression; assumed zero
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(78) : error 036: empty statement
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(80) : warning 221: label name "INI" shadows tag name
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(80) : error 017: undefined symbol "iniFile"
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(80) : error 017: undefined symbol "fileToWrite"
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(81) : error 017: undefined symbol "iniFile"
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(82) : error 017: undefined symbol "iniFile"
D:\GTA San Andreas \Server\gamemodes\cdm.pwn(80) : warning 203: symbol is never used: "INI"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
where is the problem :/


Re: Having Problem With y_ini - Kane - 10.04.2017

I don't know shit about INI but I'm guessing:

Код:
INI:iniFile = INI_Open(fileToWrite);
    INI_SetTag(iniFile, "UserData");
    INI_WriteInt(iniFile, "some_integer", 42);
Should be INI_iniFile?


Re: Having Problem With y_ini - akib - 10.04.2017

Quote:
Originally Posted by Arthur Kane
Посмотреть сообщение
I don't know shit about INI but I'm guessing:

Код:
INI:iniFile = INI_Open(fileToWrite);
    INI_SetTag(iniFile, "UserData");
    INI_WriteInt(iniFile, "some_integer", 42);
Should be INI_iniFile?
Thanks for your reply.
I tried but not work


Re: Having Problem With y_ini - coool - 10.04.2017

Quote:
new INI:iniFile = INI_Open(fileToWrite);

You also have to define fileToWrite


Re: Having Problem With y_ini - Bolex_ - 10.04.2017

Declare your variables


Re: Having Problem With y_ini - akib - 10.04.2017

Quote:
Originally Posted by Bolex_
Посмотреть сообщение
Declare your variables
Quote:
Originally Posted by coool
Посмотреть сообщение
You also have to define fileToWrite
Problem not fixed
Can somebody code it properly? plz?


Re: Having Problem With y_ini - adri[4]Life - 10.04.2017

Just Copy/Paste This Code To Your GameMode https://sampforum.blast.hk/showthread.php?tid=273088
i Think You Won't get Any Error/warning