26.08.2009, 17:51
https://sampwiki.blast.hk/wiki/Dcmd
https://sampwiki.blast.hk/wiki/Sscanf
https://sampwiki.blast.hk/wiki/Fast_Commands
OnPlayerCommandText()
Somewhere in your source (not in a function)
https://sampwiki.blast.hk/wiki/Sscanf
https://sampwiki.blast.hk/wiki/Fast_Commands
OnPlayerCommandText()
pawn Код:
dcmd(o,1,cmdtext);
pawn Код:
dcmd_o(playerid, params[])
{
new txt[128], string[128];
if (sscanf(params,"s", txt)) return SendClientMessage(playerid, 0xFFFFFFAA, "USAGE: /o [text]");
if (strlen(txt) > 128) return SendClientMessage(playerid, 0xFFFFFFAA, "WARNING: Your input cannot be longer then 128 characters.");
format(string, sizeof(string), "OOC: %s: %s", GetPlayerNameEx(playerid), txt);
SendClientMessageToAll(COLOR_BLUE,string);
return 1;
}

