25.05.2012, 05:20
Quote:
Код:
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; } |
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;
}