problem with /o chat - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problem with /o chat (
/showthread.php?tid=141427)
problem with /o chat -
WardenCS - 13.04.2010
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
Код:
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;
}
}
Re: problem with /o chat -
VirSpectorX - 13.04.2010
Try changing this:
pawn Код:
SendPlayerMessageToAll(playerid, string);
To:
pawn Код:
SendClientMessageToAll(playerid, string);
Re: problem with /o chat -
biltong - 13.04.2010
Just a suggestion, but you could also get rid of that command and use a starting character like "!" or "~" at the beginning of your message, then use OnPlayerText to send that to everyone. Much easier IMO.
Re: problem with /o chat -
WardenCS - 13.04.2010
this wont work
and to biltong:
thanks for suggestion :P