how i make ooc off?
#1

pawn Код:
COMMAND:o(playerid, params[])
{
    new sendername[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "Use /o [message]");
    format(string, sizeof(string), "OOC-%s:%s", sendername, params);
    ProxDetector(9999999999999999999.0, playerid, string, BLUE);
    return 1;
}
how i make ooc off when Isplayeradmin type in /oocoff
Reply
#2

Код:
CMD:oocoff(playerid, params[])
{
	if(IsPlayerAdmin(playerid))
	{
		if (!oocoff)
		{
			oocoff = 1;
			BroadCast(COLOR_GRAD2, "   OOC chat channel disabled by an Admin!");
		}
		else
		{
			oocon = 0;
			BroadCast(COLOR_GRAD2, "   OOC chat channel enabled by an Admin!");
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
Reply
#3

Quote:
Originally Posted by sampmark05
Посмотреть сообщение
Код:
CMD:oocoff(playerid, params[])
{
	if(IsPlayerAdmin(playerid))
	{
		if (!oocoff)
		{
			oocoff = 1;
			BroadCast(COLOR_GRAD2, "   OOC chat channel disabled by an Admin!");
		}
		else
		{
			oocon = 0;
			BroadCast(COLOR_GRAD2, "   OOC chat channel enabled by an Admin!");
		}
	}
	else
	{
		SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
	}
	return 1;
}
AGAIN you post incomplete code.



On topic.


Why are you using the ProxDetector function with a radius of 999999999999999999999999999999999? (exaggeration) You could just use SendClientMessageToAll, and using the proxdetector with that radius is a waste of cpu.

To disable an OOC chat.
pawn Код:
new
    OOC = 0; // ooc is off
CMD:ooc(playerid, params[])
{
    if(OOC == 0) return SendClientMessage(playerid, -1, "The OOC chat has been disabled.");
    // blah blah
   
CMD:enableocc(playerid, params[])
{
    if(OOC == 0) // if it's turned off
    {
        OOC = 1; // then turn it on
        SendClientMessage(playerid, -1, "OOC chat has been enabled");
    }
    else if(OOC == 1) // if it's on
    {
        OOC = 0; // then turn it off
        SendClientMessage(playerid, -1, "OOC chat has been enabled");
    }
    return 1;
}
Hope you understand.
Reply
#4

Top of your code:
pawn Код:
new bool:OOCStatus;
OnGameModeInit/OnFilterScriptInit:
pawn Код:
OOCStatus = true;
OOC Command:
pawn Код:
COMMAND:o(playerid, params[])
{
    if (!OOCStatus && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xAFAFAFAA, "The OOC chat is off.");
    new sendername[MAX_PLAYER_NAME];
    new string[256];
    GetPlayerName(playerid, sendername, sizeof(sendername));
    if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "Use /o [message]");
    format(string, sizeof(string), "OOC-%s:%s", sendername, params);
    SendClientMessageToAll(BLUE, string);
    return 1;
}
/togooc command:
pawn Код:
CMD:togooc(playerid)
{
    if (!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFF5959AA, "You are not allowed to use this command!");
    if (OOCStatus)
    {
        OOCStatus = false;
        SendClientMessageToAll(0xFF9900AA, "The admin has disabled the OOC chat.");
    }
    else
    {
        OOCStatus = true;
        SendClientMessageToAll(0xFF9900AA, "The admin has enabled the OOC chat.");
    }
    return 1;
}
Reply
#5

thisi s solved now. thank!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)