[Beginner] [Help] /b Command
#2

pawn Код:
if(!strcmp(cmdtext, "/b", true)) //Lenght is optional, so I'd rather not use it
{
    if(!cmdtext[2] || (cmdtext[2] == '\1' && !cmdtext[3])
        return SendClientMessage(playerid, COLOR_GREY, "USAGE: /b [OOC CHAT]");
    if(cmdtext[2] != '\1')
        return SendClientMessage(playerid, COLOR_GREY, "USAGE: /b [OOC CHAT] (don't forget to put a space between /b and your message)");
    new str[128];
    GetPlayerName(playerid,str, sizeof(str));
    format(str, sizeof(str), "%s ((%s))", str, cmdtext[3]);
    SendClientMessageToAll (COLOR_WHITE, str);
    return 1;
}
Problem solved

\1 = space ' '

pawn Код:
if(!cmdtext[2] || (cmdtext[2] == '\1' && !cmdtext[3])
Is doing the same as isnull does, aka recommended to use.
Reply


Messages In This Thread
[Beginner] [Help] /b Command - by Crayon - 06.10.2010, 23:51
Re: [Beginner] [Help] /b Command - by LarzI - 06.10.2010, 23:59
Re: [Beginner] [Help] /b Command - by Crayon - 06.10.2010, 23:59
Re: [Beginner] [Help] /b Command - by zack3021 - 07.10.2010, 00:03
Re: [Beginner] [Help] /b Command - by LarzI - 07.10.2010, 00:11
Re: [Beginner] [Help] /b Command - by Crayon - 08.10.2010, 01:02
Re: [Beginner] [Help] /b Command - by TheHoodRat - 08.10.2010, 01:08
Re: [Beginner] [Help] /b Command - by Crayon - 08.10.2010, 01:18
Re: [Beginner] [Help] /b Command - by Crayon - 08.10.2010, 02:16
Re: [Beginner] [Help] /b Command - by TheHoodRat - 08.10.2010, 04:21

Forum Jump:


Users browsing this thread: 1 Guest(s)