SendClientMessage To All Players In A Virtual World
#1

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.
Reply
#2

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);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)