[FilterScript] Chat Bot
#6

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Same or My work! GrannyBot!
pawn Код:
COMMAND:grannybot(playerid, params[])
    {
        if(IsPlayerConnected(playerid))
        {
            if(PlayerInfo[playerid][pAdmin] >= 1)
            {
                new result[128],string[128];
                if(sscanf(params, "s[128]",result)) return SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /grannybot(/gb) [Bot Message]");
                format(string, sizeof(string), "* GrannyBot: %s **", result);
                SendClientMessageToAll(0x66a2ff97, string);
            }
        }
        return 1;
    }
It doesn't need sscanf for this and check if the playerid is conencted because if player isn't connected of course he/she can't use the comamnd
Much easier:
pawn Код:
CMD:grannybot( playerid, params[ ] )
{
    new string[ 128 ];
    if( PlayerInfo[ playerid ][ pAdmin ] < 1) return SendClientMessage( playerid, -1, "You are not Admin!" );
    if( isnull( params ) ) return SendClientMessage( playerid, COLOR_GRAD2, "USAGE: /grannybot(/gb) [Bot Message]" );
    format( string, sizeof( string ), "* GrannyBot: %s **", params );
    SendClientMessageToAll( 0x66a2ff97, string );
    return 1;
}

CMD:gb( playerid, params[ ] )
{
    return cmd_grannybot( playerid, params );
}
Reply


Messages In This Thread
Chat Bot - by JungleBook - 05.02.2012, 16:33
Re: Chat Bot - by Scenario - 05.02.2012, 16:36
Re: Chat Bot - by JungleBook - 05.02.2012, 16:42
Respuesta: Chat Bot - by [Nikk] - 07.02.2012, 03:23
Re: Respuesta: Chat Bot - by Ballu Miaa - 07.02.2012, 04:25
Re: Respuesta: Chat Bot - by Konstantinos - 07.02.2012, 10:41
Re: Respuesta: Chat Bot - by Ballu Miaa - 07.02.2012, 14:07
Re: Chat Bot - by Shadow_ - 08.02.2012, 18:18
Re: Chat Bot - by KingHual - 08.02.2012, 18:24
Re: Chat Bot - by JungleBook - 08.02.2012, 18:43

Forum Jump:


Users browsing this thread: 1 Guest(s)