SA-MP Forums Archive
Global chat help! - 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: Global chat help! (/showthread.php?tid=115294)



Global chat help! - Mystique - 23.12.2009

Hello, I'm having trouble with my /o chat. When I write /o hi it says (([OOC Global] Richard_Wright: ))
It should be (([OOC Global] Richard_Wright: hi))

This is my command

Code:
if(!strcmp(cmdtext, "/o", true, 2)) 
  {
    if(!cmdtext[2])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /o [message]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "(([OOC Global] %s: %s))", str, cmdtext[18]);
    SendClientMessageToAll(COLOR_RED, str);
    return 1;
		}



Re: Global chat help! - Kurence - 23.12.2009

Try this:
Code:
if(!strcmp(cmdtext, "/o", true, 2)) 
  {
    if(!cmdtext[2])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /o [message]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "(([OOC Global] %s: %s))", str, cmdtext[3]);
    SendClientMessageToAll(COLOR_RED, str);
    return 1;
		}
Or something like that.


Re: Global chat help! - Mystique - 23.12.2009

Thanks, but why is it cmdtext[3] instead of cmdtext[18]?