30.11.2009, 12:02
Hi, i have rcon chat off command, but now i need command who turns on chat, can someone can share it? ;>
OnGameModeinit: DisableChat = false; public OnPlayerText(playerid, text[]) { if(DisableChat == true) return 0; if(!strcmp(cmdtext,"/offchat",true,7)) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,COLOR_LRED, "You are not administrator"); for(new i; i < MAX_PLAYERS; i++) DisableChat = true; new string[256]; format(string, sizeof(string), "Chat is turned off"); SendClientMessageToAll(COLOR_GOLDEN, string); return 1; }
new bool: EnableChat = true;
public OnPlayerText(playerid, text[])
{
if(EnableChat == false) return 0;
return 1;
}
command(chat, playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_WHITE, "You are not an administrator!");
switch(EnableChat)
{
case false:
{
EnableChat = true;
SendClientMessageToAll(COLOR_GOLDEN, "INFO: Chat is turned on.");
}
case true:
{
EnableChat = false;
SendClientMessageToAll(COLOR_GOLDEN, "INFO: Chat is turned off.");
}
}
return 1;
}