05.05.2013, 22:33
(
Последний раз редактировалось Squirrel; 05.05.2013 в 23:54.
)
Quote:
No problem... It won't be targetname specifically you'll need to construct the file path string based on targetname I don't have your Path() stock so I have no idea what that would be beyond assumptions.
|
#define UserPath "Users/%s.ini"
EDIT: My bad!
Код:
stock Path(playerid) { new str[128],name[MAX_PLAYER_NAME]; GetPlayerName(playerid,name,sizeof(name)); format(str,sizeof(str),UserPath,name); return str; }
With this:
Код:
CMD:banofflineplayer(playerid, params[]) { new targetname[24], filestring[79]; if(PlayerInfo[playerid][pAdminLevel] >= 5) { if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, -1, "Correct Usage: /banofflineplayer [Player's Name]"); format(filestring, sizeof(filestring), "Users/%s.ini", targetname); if(!fexist(filestring)) return SendClientMessage(playerid, -1, "Error: The player name you have chosen was not found in our system."); else { new INI:file = INI_Open(Path(targetname)); INI_SetTag(file, "Player's Data"); INI_WriteInt(file, "Banned", 1); INI_Close(file); new done[128]; format(done, sizeof(done), "You have banned %s", targetname); SendClientMessage(playerid,-1 , done); } } return 1; }
Код:
argument type mismatch (argument 1)