2021-02-20, 01:27 PM
Code:
new Gl_Privados[MAX_PLAYERS];
CMD:toggl(playerid, params[]) {
? ? if (!Gl_Privados[playerid]) {
? ? ? ? Gl_Privados[playerid] = 1;
? ? ? ? SendClientMessage(playerid, 2, "GL Off");
? ? } else if (Gl_Privados[playerid]) {
? ? ? ? Gl_Privados[playerid] = 0;
? ? ? ? SendClientMessage(playerid, 2, "GL on");
? ? }
? ? return 1;
}
Code:
CMD:gl(playerid, params[])
{
? ? new Text[132], string[128], PlayerName[MAX_PLAYER_NAME];
? ? if(sscanf(params, "s[132]", Text))
? ? {
? ? ? ? SendClientMessage(playerid, -1, "{D41818}[COMANDO]{AFAFAF} /gl <texto>");
? ? }
? ? else
? ? {
? ? ? ? if (Gl_Privados[playerid] == 1) return SendClientMessage(playerid, -1, "{D41818}[ERROR]{AFAFAF} you have blocked the /gl");
? ? ? ? GetPlayerName(playerid, PlayerName, sizeof(PlayerName)); // storing player name first in the PlayerName variable
? ? ? ? foreach(new i : Player)
? ? ? ? {
? ? ? ? if (Gl_Privados[playerid] == 0)
? ? ? ? {
? ? ? ? SendClientMessage(i, 0xFFFFFF00, string);
? ? ? ? }
? ? ? ? if (Gl_Privados[playerid] == 1)
? ? ? ? {
? ? ? ? }
? ? ? ? }
? ? ? ? format(string, sizeof(string), "{D41818}[ID:%d - %s]:{AFAFAF} %s",playerid, PlayerName, Text);
? ? ? ? SendClientMessageToAll(0xFFFFFF00, string);
? ? }
? ? return 1;
}
i have a bug with this, when I disable /gl (send message to all players) I get messages from players anyway