Need help with a ((Local OOC: )) Chat
#1

Hey i want to create a chat like you type /l TEXT , ((Local OOC: Santox14 : Test)) , how can i make it? i searched for it but cant find a tutorial for it , can someone help me ? , im using zcmd,sscanf
Reply
#2

pawn Код:
CMD:l(playerid,params[])
{
    new n[24],string[128];
    GetPlayerName(playerid,n,24);
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        if(IsPlayerInRangeOfPoint(i,10,x,y,z))
        {
            format(string,128,"(( %s: %s ))",n,params);
        SendClientMessage(i,0xFFFFFFFF,string);
        return 1;
        }
    }
    return 1;
}
Reply
#3

pawn Код:
CMD:b(playerid,params[])
{
    if(PlayerInfo[playerid][pMuted] == 1)
    {
        SCM(playerid, COLOR_RED,"You can't speak you have been silenced");
        return 1;
    }
    if(isnull(params)) return SCM(playerid, COLOR_GREY,"/b [local ooc chat]");
    new sendername[MAX_PLAYER_NAME], string[128];
    GetPlayerName(playerid,sendername,sizeof(sendername));
    sendername[strfind(sendername,"_")] = ' ';
    format(string, sizeof(string), "%s Says: (( %s ))", sendername, params);
    ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    return 1;
}
Reply
#4

thank you
Reply
#5

no command /l , auto say EX : Push T and say direct in Local Chat !
So ...
Reply
#6

here this is what you do
Reply
#7

how do you put it so the code show up right away?
Reply
#8

pawn Код:
public OnPlayerText(playerid, text[])
{
    format(string, sizeof(string), "%s : %s", sendername, text);
    ProxDetector(20.0, playerid,string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
    SetPlayerChatBubble(playerid,text,COLOR_WHITE,20.0,5000);
    return 0;
}
or

pawn Код:
public SendAllFormattedText(playerid, const str[], define)
{
    new tmpbuf[256];
    format(tmpbuf, sizeof(tmpbuf), str, define);
    SendClientMessageToAll(0xFFFF00AA, tmpbuf);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)