04.11.2012, 12:58
Um... I already do a register/login system. But when i do /setlevel [id]. The %s.ini file looks like this :S
What is wrong??
Here is the setlevel thingy:
Pls help
Thanks!
Код:
Admin = 3 [data] Password = 731514188 Cash = 0 Admin = 0 Kills = 0 Deaths = 0 Score = 0
Here is the setlevel thingy:
pawn Код:
CMD:setlevel(playerid, params[])
{
new id, level;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1,"SERVER: You must be an admin.");
if(!IsPlayerConnected(playerid)) return SendClientMessage(playerid, -1, "SERVER: Player not connected.");
if(id == playerid) return SendClientMessage(playerid, -1, "SERVER: You cant set yourself an admin. Use /setadmin.");
if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, -1, "Usage: /setlevel [id] [level]");
if(level > 5) return SendClientMessage(playerid, -1, "SERVER: Level is too high. [0/5]");
new INI:File = INI_Open(UserPath(id));
INI_WriteInt(File,"Admin",level); // Is this the problem ???
INI_Close(File);
return 1;
}
Thanks!