Admin system problem
#1

Um... I already do a register/login system. But when i do /setlevel [id]. The %s.ini file looks like this :S

Код:
Admin = 3
[data]
Password = 731514188
Cash = 0
Admin = 0
Kills = 0
Deaths = 0
Score = 0
What is wrong??

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;
}
Pls help
Thanks!
Reply


Messages In This Thread
Admin system problem - by Deaglez - 04.11.2012, 12:58
AW: Admin system problem - by Skimmer - 04.11.2012, 13:00
Re: Admin system problem - by Tigerkiller - 04.11.2012, 13:03
Re: Admin system problem - by s4kuL - 04.11.2012, 13:04
Re: Admin system problem - by Deaglez - 04.11.2012, 13:08
Re: Admin system problem - by s4kuL - 04.11.2012, 13:11
Re: Admin system problem - by Deaglez - 04.11.2012, 13:16
Re: Admin system problem - by tyler12 - 04.11.2012, 13:32

Forum Jump:


Users browsing this thread: 2 Guest(s)