07.10.2010, 21:00
If I were you, I would consider using SSCANF(2) and ZCMD. This is the command using SSCANF(2), but not ZCMD.
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.
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;
}
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.