Having Problem With y_ini
#1

Код:
#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 :/
Reply
#2

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?
Reply
#3

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
Reply
#4

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

You also have to define fileToWrite
Reply
#5

Declare your variables
Reply
#6

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?
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)