Chat with range:
#2

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(w,1,cmdtext)
    return 0;
}
dcmd_w(playerid,params[])
{
    new Pname[28];
    GetPlayerName(playerid,Pname,sizeof(Pname));
    new string[128];
    if(!strlen(params))
    {
        SendClientMessage(playerid,COLOR_ERROR,"USAGE: /w (msg)");
        return 1;
    }
    format(string, sizeof(string), "[WHISPER] %s(%d): %s",Pname(playerid),playerid,params);
    printf("%s", string);
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerConnected(i) && GetDistanceBetweenPlayers(playerid,i) < 10)
        {
            format(string, sizeof(string), "[WHISPER] %s(%d): %s",Pname(playerid),playerid,params);
            SendClientMessage(i,COLOR_YELLOW,string);
        }
    }
    return 1;
}
Its just a example try it.
Reply


Messages In This Thread
Chat with range: - by LostGaming2014 - 23.03.2014, 03:45
Re: Chat with range: - by HitterHitman - 23.03.2014, 03:54
Re: Chat with range: - by ChristianIvann09 - 23.03.2014, 03:56
Re: Chat with range: - by Hanuman - 23.03.2014, 04:33
Re: Chat with range: - by GShock - 23.03.2014, 04:35

Forum Jump:


Users browsing this thread: 1 Guest(s)