13.04.2010, 13:06
Hey,i have problem with /o chat,its that everyone sees the chat
but if i write /o,it will show Fog: /o
and if i write more /o lalala
it wont show anything
heres the code
but if i write /o,it will show Fog: /o
and if i write more /o lalala
it wont show anything
heres the code
Код:
if(strcmp(cmdtext, "/o", true) == 0)
{
new idx;
new string[256];
new sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new resultZ[64];
while ((idx < length) && ((idx - offset) < (sizeof(resultZ) - 1)))
{
resultZ[idx - offset] = cmdtext[idx];
idx++;
}
resultZ[idx - offset] = EOS;
if(!strlen(resultZ))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /o [ooc chat]");
return 1;
}
{
format(string, sizeof(string), "%s", resultZ);
SendPlayerMessageToAll(playerid, string);
printf("%s", string);
return 1;
}
}

