Banning offline player
#6

Quote:
Originally Posted by [uL]Pottus
Посмотреть сообщение
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.
Hmmm well I dont have any stock for it, just this
#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;
}
I still dont understand how to do it.

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;
}
I get
Код:
argument type mismatch (argument 1)
Reply


Messages In This Thread
Banning offline player - by Squirrel - 05.05.2013, 22:23
Re: Banning offline player - by Pottus - 05.05.2013, 22:26
AW: Banning offline player - by Squirrel - 05.05.2013, 22:27
Re: Banning offline player - by ryansheilds - 05.05.2013, 22:29
Re: Banning offline player - by Pottus - 05.05.2013, 22:29
AW: Re: Banning offline player - by Squirrel - 05.05.2013, 22:33

Forum Jump:


Users browsing this thread: 2 Guest(s)