SA-MP Forums Archive
SendClientMessage To All Players In A Virtual World - 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: SendClientMessage To All Players In A Virtual World (/showthread.php?tid=215438)



SendClientMessage To All Players In A Virtual World - lewismichaelbbc - 23.01.2011

SendClientMessage To All Players In A Virtual World

This is what i would like:

pawn Код:
if(strcmp(cmd, "/stuntchat", true) == 0 || strcmp(cmd, "/sc", true) == 0)
     {
pawn Код:
if ( GetPlayerVirtualWorld( playerid ) == 5 )
        {
But, i am not too sure what the code in the command would be...

pawn Код:
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: (/sc)/stuntchat [text]");
format(string, sizeof(string), "[StuntChat] %s: %s]",PlayerName(playerid),tmp);
SendClientMessage(playerid,COLOR_YELLOW,string);
The above code does not work. would anyone be able to help me make the code??

I would like the command /stuntchat to send a message to all the people in virtual world 5.

Thank you for the help.


Re: SendClientMessage To All Players In A Virtual World - Not available - 23.01.2011

pawn Код:
format(string, sizeof(string), "[StuntChat] %s: %s]",PlayerName(playerid),tmp);
for(new i = 0; i < MAX_PLAYERS; i++)
{
    if(IsPlayerConnected(i) && GetPlayerVirtualWorld(playerid) == 5) SendClientMessage(playerid,COLOR_YELLOW,string);
}