An offline ban command
#9

Quote:
Originally Posted by [HiC]TheKiller
Посмотреть сообщение
pawn Код:
YCMD:offlineban(playerid, params[], help)
{
    new
        name[24]; //Name instead (string)
    if( !sscanf(params, "s[24]", name)) //Cannot be 'u' because the player is not online.
    {
        new string[32];
        format(string,sizeof(string),PATH,name);
        // Changed from TargetID -> Name. You may need to change the path
        //because you were using an integer before (TargetID wasn't a string).
        new INI:File = INI_Open(string); //Shouldn't be path, should be string.
        if(!fexist(string)) return SendClientMessage(playerid, -1, "Invalid player name."); //All good here
        INI_WriteInt(File,"Banned",1); //Just put a 1, makes it easier.
        //BanEx( TargetID, "offlineban" ); <--- No need for that :).
        SendClientMessage(playerid,-1, "You have now banned the player.."); //Sweet.
        INI_Close(File); //Closed
    }
    else
        return SendClientMessage(playerid, -1, "USAGE: /offlineban [playername]"); //Yep
    return 1; //Sweet
}
Thanks TheKiller! Once again saving my time!

Glad to see you're back!
Reply


Messages In This Thread
An offline ban command - by HydraX - 06.09.2012, 23:10
Respuesta: An offline ban command - by HydraX - 06.09.2012, 23:43
Re: An offline ban command - by [ABK]Antonio - 06.09.2012, 23:45
Respuesta: Re: An offline ban command - by HydraX - 06.09.2012, 23:49
Re: An offline ban command - by Penki4a - 07.09.2012, 01:27
Respuesta: Re: An offline ban command - by HydraX - 07.09.2012, 01:59
Re: An offline ban command - by [HiC]TheKiller - 07.09.2012, 06:50
Re : An offline ban command - by ricardo178 - 07.09.2012, 07:26
Respuesta: Re: An offline ban command - by HydraX - 07.09.2012, 20:20

Forum Jump:


Users browsing this thread: 1 Guest(s)