24.10.2018, 20:42
I'm creating a settings panel for players, where they can toggle options on/off.
Lemme take an example:
I've added the option to toggle on/off join messages (The ones like Test has joined the server).
Now i have this code which shows join messages to everyone:
My question is:
How would you edit it to make this message shows just at who have "JoinMsg" setting enabled?
Player[playerid][JoinMsg] = 1; //Enabled, so they can see join message.
In short words, if a player has JoinMsg enabled and someone connects, he will see the connect message, otherwise not.
Tips are appreciated, thanks.
Lemme take an example:
I've added the option to toggle on/off join messages (The ones like Test has joined the server).
Now i have this code which shows join messages to everyone:
pawn Код:
new string[70];
switch (Player[playerid][AccountLevel])
{
case 0:
{
format(string, sizeof(string), "* %s %s has joined Los Santos Stories.", JobName(playerid), ReturnName(playerid, 0));
SCMTA(COLOR_SILVER, string);
}
case 1 .. 5:
{
format(string, sizeof(string), "* %s %s has joined Los Santos Stories. IP: %s", JobName(playerid), ReturnName(playerid, 0), ReturnPlayerIp(playerid));
SendMessageToAdmins(string, COLOR_SILVER);
}
}
How would you edit it to make this message shows just at who have "JoinMsg" setting enabled?
Player[playerid][JoinMsg] = 1; //Enabled, so they can see join message.
In short words, if a player has JoinMsg enabled and someone connects, he will see the connect message, otherwise not.
Tips are appreciated, thanks.