10.08.2010, 07:03
I have a command for CLAN CHAT BUT DON'T WORK:
My clan tag is [DSR]
Please help me
pawn Код:
if(strcmp(cmd, "/c", true) == 0 || strcmp(cmd, "/clanchat", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/c)lanchat [testo]");
return 1;
}
format(string, sizeof(string), "*** [CLANCHAT] %s *** %s",sendername, result);
SendClanMessage(playerid, string);
printf("ClanChat %s: %s", sendername, result);
}
return 1;
}
Please help me