30.11.2014, 05:42
I made this '/setlevel' command and when I set my level in game and check the .ini file I got two AdminLevel =
One at the top above [Player's Data] and one below [Player's Data] could somebody help me ?
Here's the command
The .ini file
I'm also using this Login/Register system > http://forum.sa-mp.com/showthread.ph...15#post3271515
One at the top above [Player's Data] and one below [Player's Data] could somebody help me ?
Here's the command
pawn Код:
CMD:setlevel(playerid,params[])
{
new target, level, targetName[MAX_PLAYER_NAME], adminName[MAX_PLAYER_NAME], string[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_RED,"ERROR: You must be a RCON to use this command");
if(sscanf(params,"ud",target,level)) return SendClientMessage(playerid,COLOR_GREEN,"Usage: /setlevel [playerid] [level]");
if(level > 6) return SendClientMessage(playerid,COLOR_PINK,"Levels are between 1-6!");
new INI:file = INI_Open(Path(target));
INI_WriteInt(file,"AdminLevel",pInfo[playerid][AdminLevel]);
INI_Close(file);
GetPlayerName(target, targetName, sizeof(targetName));
GetPlayerName(playerid, adminName, sizeof(adminName));
format(string,sizeof(string),"You have set %s's level to %d", targetName, level);
SendClientMessage(playerid,COLOR_GREEN,string);
format(string,sizeof(string),"%s has set your level to %d", adminName, level);
SendClientMessage(playerid,COLOR_PINK,string);
return 1;
}
Код:
AdminLevel = 0 [Player's Data] Password = :D private AdminLevel = 0 Money = 0 Scores = 0 Kills = 0 Deaths = 0