28.02.2013, 14:55
This is the code I am using to create a username.ini file
All it is doing is making a new file, and writing "username=[USERNAME]" in it, however, i get the follwing error
If I comment out line 250, it will create the file, but obviously, not write anything because I did not tell it to.
pawn Код:
new string[128];
new directory[128];
new name[MAX_PLAYER_NAME+1];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "scriptfiles/users/%s.ini", name);
format(directory, sizeof(directory), "users/%s.ini", name);
if(!fexist(string))
{
new INI: newFile = INI_Open (directory);
INI_WriteInt(newFile, "username", name);
INI_Close(newFile);
} else {
SendClientMessage(playerid, COLOR_LIGHTBLUE, "Your account is registered.");
}
pawn Код:
F:\SAMP\gamemodes\naterp.pwn(250) : error 035: argument type mismatch (argument 3)