27.10.2013, 13:54
Okay I make it work somehow with your help guys but now there is the problem when I write /b or /d or /c or any command that does not exist it will write "/(s)hout [local chat]" here is the command
How ti fix it ? :/
pawn Код:
if(strcmp(cmd, "/shout", true) == 0 || strcmp(cmd, "/s", true) == 0)
{
if(IsPlayerConnected(playerid))
{
GetPlayerName(playerid, Name, sizeof(Name));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[256];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid,COLOR_LIGHTGREEN, "(/s)hout [local chat]");
return 1;
}
if(Masked[playerid] == 1) format(Str, sizeof(Str), "* Stranger shouts: %s",result);
else format(Str, sizeof(Str), "%s shouts: %s!",Name,result);
SendClientMessage(playerid,COLOR_LIGHTGREEN, Str);
//ProxDetector(30.0, playerid, Str,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA,0x33CCFFAA);
printf("- /shout: %s", Str);
}
return 1;
}