Author Topic: Chatcolor command  (Read 675 times)

0 Members and 1 Guest are viewing this topic.

Offline Life

  • Banned
  • *
  • Posts: 25
  • Country: fo
  • Respect: +2/-0
  • Gender: Male
  • Best Firefighter, Worker Of The Month
    • View Profile
  • MCNR name: [L]ife
  • Discord name: [L]ife#2488
Chatcolor command
« on: March 12, 2023, 11:19:23 am »
Hello today im gonna give you a simple chatcolor command that anyone can use.

// Color definitions
#define COLOR_WHITE     0xFFFFFFFF
#define COLOR_BLACK     0xFF000000
#define COLOR_RED       0xFFFF0000
#define COLOR_GREEN     0xFF00FF00
#define COLOR_BLUE      0xFF0000FF
#define COLOR_YELLOW    0xFFFFFF00
#define COLOR_ORANGE    0xFFFFA500
#define COLOR_PURPLE    0xFF800080
#define COLOR_PINK      0xFFFFC0CB
#define COLOR_CLAN      0xFF00FFFF

// Include definitions
#include <a_samp>
#include <sscanf2>
#include <zcmd>


#define COLOR_COMMAND "/color"
#define COLOR_USAGE "/color [color code] - Changes your chat color to the specified code."

// Chat color command
CMD:color(playerid, params[])
{
    new color = strval(params);

    if(!color || color < 0 || color > 9)
    {
        SendClientMessage(playerid, COLOR_RED, "Usage: %s", COLOR_USAGE);
        return 1;
    }

    SetPlayerChatBubbleColor(playerid, color);
    SendClientMessage(playerid, COLOR_GREEN, "Your chat color has been changed to %d.", color);
    return 1;
}

Offline Mido

  • *
  • Posts: 538
  • Country: ma
  • Respect: +9/-22
  • Gender: Male
    • View Profile
  • MCNR name: Mido
  • Discord name: justmido
Re: Chatcolor command
« Reply #1 on: June 01, 2023, 09:21:10 pm »
Pretty easy, but nice stuff.