[HELP] How to make CMD for Chat System
#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


Messages In This Thread
[HELP] How to make CMD for Chat System - by Ivander - 09.09.2013, 10:06
Re: [HELP] How to make CMD for Chat System - by benjaminjones - 09.09.2013, 10:07
Re: [HELP] How to make CMD for Chat System - by Ivander - 09.09.2013, 10:16
Re: [HELP] How to make CMD for Chat System - by Mattakil - 09.09.2013, 14:20
Re: [HELP] How to make CMD for Chat System - by Ivander - 10.09.2013, 09:20
Re: [HELP] How to make CMD for Chat System - by Dragonsaurus - 10.09.2013, 09:40

Forum Jump:


Users browsing this thread: 2 Guest(s)