ini_parsefile error
#1

hey i got this error
Код:
C:\Users\xXXXX\Desktop\settime.pwn(70) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
on this code
Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
//#define FILTERSCRIPT

#include <a_samp>
#include <zcmd>
#include <sscanf2>
#include <YSI\y_ini>


#define PATH "/Users/%s.ini" //Users Path


#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
	print("\n--------------------------------------");
	print(" SetWeather & Time V1 Loaded");
	print("--------------------------------------\n");
	return 1;
}

public OnFilterScriptExit()
{
	return 1;
}

#else

enum pInfo
{
    pPass,
    pCash,
    pAdmin,
    pKills,
    pDeaths,
    pVip,
    pDJ,
	pBanned
}

new PlayerInfo[MAX_PLAYERS][pInfo];

stock UserPath(playerid)
{
	new string[128],playername[MAX_PLAYER_NAME];
	GetPlayerName(playerid,playername,sizeof(playername));
	format(string,sizeof(string),PATH,playername);
	return string;
}

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
	INI_Int("Password",PlayerInfo[playerid][pPass]);
	INI_Int("Cash",PlayerInfo[playerid][pCash]);
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
	INI_Int("Kills",PlayerInfo[playerid][pKills]);
    INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
    INI_Int("Vip",PlayerInfo[playerid][pVip]);
    INI_Int("DJ",PlayerInfo[playerid][pDJ]);
    INI_Int("Banned",PlayerInfo[playerid][pBanned]);
 	return 1;
}


main()
{
	INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
}


#endif


CMD:setmytime(playerid, params[])
{
	new time;
	if(PlayerInfo[playerid][pAdmin] == 1) return SendClientMessage(playerid, 0x0, "lol");
	if(sscanf(params, "d", time))
	{

	    SendClientMessage(playerid, 0x0, "lol");

	}
	return 1;
}
this is the line
Код:
main()
{
	INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid); <--- the line
}
and can someone explain how to use this parsefile tq
Reply
#2

There is no such variable in function main(). You should probably write this line in public OnPlayerConnect:
PHP код:
public OnPlayerConnect(playerid)
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
return 
1;

I haven't actually work with YSI ini, but here is an official wiki page link to the description of INI_ParseFile function: https://sampwiki.blast.hk/wiki/YSI:INI#...g_.3D_false.29
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)