/o help?
#6

If I were you, I would consider using SSCANF(2) and ZCMD. This is the command using SSCANF(2), but not ZCMD.

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp("/o", cmdtext, true, 2))
    {
        new message, string[128], sendername[24];
        if(sscanf(params, "s[105]", message)) return SendClientMessage(playerid, COLOR_WHITE, "SYNTAX: /o [message]");
        GetPlayerName(playerid, sendername, sizeof(sendername));
        format(str, sizeof(str), "OOC %s: %s", sendername, message);
        SendPlayerMessageToAll(playerid, str);
        return 1;
    }
    return 0;
}
It should work for you.

EDIT: I am so used to working with ZCMD that the command I provided for you will not work with STRCMP. I'll see what I can do, as I don't use STRCMP. I would recommend that you use ZCMD and convert your STRCMP commands to ZCMD as "OnPlayerCommandText" will cause a compatibility issue.
Reply


Messages In This Thread
/o help? - by Luis- - 07.10.2010, 16:41
Re: /o help? - by miokie - 07.10.2010, 17:22
Re: /o help? - by Scenario - 07.10.2010, 17:31
Re: /o help? - by Luis- - 07.10.2010, 18:32
Re: /o help? - by Mike_Peterson - 07.10.2010, 19:06
Re: /o help? - by Scenario - 07.10.2010, 21:00

Forum Jump:


Users browsing this thread: 1 Guest(s)