02.09.2018, 10:21

So for over the past couple weeks of me being back, I have been hounded with a few people asking me constantly to release some of my small codes for chats etc. This will be a very short tutorial in how to explain how to make a small group chat system.
Remember you can edit this to use with whatever group you want
Step One:
Your first step may be quite easy but it is where alot of people, especially new coders get stuck. So what you want to do, is start by making a basically a public function that revolves around a string format.
Code:
forward AdminMessage(color, const string, level);
public AdminMessage(color, const string, level)
{
Code:
for(new i = 0; i < MAX_PLAYERS; i++)
{
Code:
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(i, color, string);
Code:
forward AdminMessage(color, const string, level);
public AdminMessage(color, const string, level)
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(IsPlayerAdmin(playerid))
{
SendClientMessage(i, color, string);
}
}
}
return 1;
}
Code:
new string1[256];
format(string1,sizeof(string1),"{FF0033}((Adminstrator %s: %s))", //YourRoleplayNameFunctionHere//, params);
AdminMessage(-1, string1,1);
Code:
CMD:a(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new string20[256];
if(PlayerInfo[playerid][pAdmin] >= 1)
{
if(isnull(params))
{
SendClientMessage(playerid,-1,"{FFA500}[Server]: {FFFFFF}/a [admin chat text]");
}
else
{
format(string20,sizeof(string20),"{FF0033}((Adminstrator %s: %s))", RPName(playerid), params);
AMSG(-1, string20,1);
}
}
else
{
SendClientMessage(playerid,-1,"{CC3399}[Error]: {FFFFFF}You do not have a high enough admin rank");
}
}
return 1;
}


