[HELP] How to make CMD for Chat System
#1

Hey Guys,
I need some help here.
I want make Chat system like /report CMD
example:
Player: /am Hello Admin (This show to all administrator online)
Admin: /amsg 1 Hello Player ( Player was using ID 1 will got this message)

How to make that ? im confused how to make this CMD.
Please Reply if you got something can help me ok
Reply
#2

ZCMD?
Reply
#3

Quote:
Originally Posted by benjaminjones
Посмотреть сообщение
ZCMD?
Yes ZCMD. How ?
Reply
#4

pawn Код:
CMD:report(playerid, params)
    {
    new string[128],
    reportmessage[100];
    if(strlen(reportmessage)>=100)return SCM(pid, COLRED, "[Server]{F0F0F0}: Max report length is 100.");
    else
        {
        format(string, sizeof(string), "[Report %s {%d}]: %s", GetName(playerid), playerid, reportmessage);
        foreach (new i : Player)
            {
            if(PlayerInfo[i] [pAdmin] >=1)
                {
                SCM(i, COLPURPLE, string);
                SCM(pid, COLPURPLE, "Your message has been sent to online admins!");
                return 1;
                }
            }
        }
    return 1;
    }
Something like this?
Reply
#5

Quote:
Originally Posted by Mattakil
Посмотреть сообщение
pawn Код:
CMD:report(playerid, params)
    {
    new string[128],
    reportmessage[100];
    if(strlen(reportmessage)>=100)return SCM(pid, COLRED, "[Server]{F0F0F0}: Max report length is 100.");
    else
        {
        format(string, sizeof(string), "[Report %s {%d}]: %s", GetName(playerid), playerid, reportmessage);
        foreach (new i : Player)
            {
            if(PlayerInfo[i] [pAdmin] >=1)
                {
                SCM(i, COLPURPLE, string);
                SCM(pid, COLPURPLE, "Your message has been sent to online admins!");
                return 1;
                }
            }
        }
    return 1;
    }
Something like this?
Yes but different , so if player want to talk about Marketplace items etc , he can talk to admin via CMD:am and admin can reply using CMD:amsg
Can you help me ?
Reply
#6

pawn Код:
CMD:am(playerid, params)
{
    new string[128];
    if(sacanf(params, "s[128]", string) return SCM(playerid, COLRED, "[Usage]{F0F0F0}: /am [message]");
    format(string, sizeof(string), "[Message from %s (%d)]: %s", GetName(playerid), playerid, string);
    foreach(new i : Player)
    {
        if(PlayerInfo[i] [pAdmin] >=1) SCM(i, COLPURPLE, string);
    }
    SCM(playerid, COLPURPLE, "Your message has been sent to online admins!");
    return 1;
}
CMD:amsg(playerid, params)
{
    if(PlayerInfo[playerid][pAdmin] >= 1)
    {
        new player1, string[128];
        if(sacanf(params, "us[128]", player1, string) return SCM(playerid, COLRED, "[Usage]{F0F0F0}: /amsg [Player ID] [message]");
        if(!IsPlayerConnected(player1)) return SCM(playerid, COLRED, "[Server]{F0F0F0}: This player is not connected!");
        format(string, sizeof(string), "[Message from Admin %s (%d)]: %s", GetName(playerid), playerid, string);
        SCM(player1, COLPURPLE, string);
        SCM(playerid, COLPURPLE, "Your message has been sent to online admins!");
    }
    else SCM(playerid, COLPURPLE, "You are not authorized to use this command!");
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)