mxINI
#4

Quote:
Originally Posted by pozitiv4eg
View Post
Уже наверное год не работал с файлами и тут затупок...
PHP Code:
        case 2:
        {
            new 
name[MAX_PLAYER_NAME];
            new 
string[128];
            
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
            
format(string,sizeof(string),"%s.ini",name);
            
ini_createFile(string);
            
RegisterPlayer(playerid,inputtext);
        } 
PHP Code:
public RegisterPlayer(playerid,password[])
{
    new 
name[MAX_PLAYER_NAME];
    new 
string[128];
    
GetPlayerName(playerid,name,MAX_PLAYER_NAME);
    
format(string,sizeof(string),"%s.ini",name);
     new 
iniFile ini_openFile (string);
    
ini_setString(iniFile,"password",password);
    
ini_closeFile(iniFile);
    return 
true;

Файлик не создается. Помогите =(
Так будет лучше:
pawn Code:
case 2:
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, MAX_PLAYER_NAME);
    RegisterPlayer(playerid, name, inputtext);
}
pawn Code:
stock RegisterPlayer(playerid, name[], password[])
{
    new string[MAX_PLAYER_NAME + 5];
    format(string, sizeof(string), "%s.ini", name);
    new iniFile = ini_createFile(string);
    ini_setString(iniFile, "password", password);
    ini_closeFile(iniFile);
}
Reply


Messages In This Thread
mxINI - by pozitiv4eg - 09.11.2013, 15:27
Re: mxINI - by Mutha_X - 09.11.2013, 20:23
Re: mxINI - by Nadim - 16.11.2013, 14:04
Re: mxINI - by ZiGGi - 17.11.2013, 08:50

Forum Jump:


Users browsing this thread: 1 Guest(s)