15.07.2011, 14:17
pawn Код:
if(!strcmp(cmdtext, "/toggleooc", true,10))
{
if(!IsPlayerAdmin(playerid))//or whatever your admin variable is
{
SendClientMessage(playerid, 0xFFFFFFFF, "You are not an admin");
return 1;
}
if(ToggleOOC == 1)
{
ToggleOOC = 0;
SendClientMessageToAll(playerid, 0xFFFFFFFF, "Global OOC chat has been disabled");
}
else
{
ToggleOOC = 1;
SendClientMessageToAll(playerid, 0xFFFFFFFF, "Global OOC chat has been enabled");
}
return 1;
}
pawn Код:
if(!strcmp(cmdtext, "/ooc", true,4)){
if(ToggleOOC == 0)
{
SendClientMessage(playerid, 0xFFFFFFFF, "Global OOC chat has been disabled");
return 1;
}
if(!strlen(cmdtext[4])) SendClientMessage(playerid, 0xffffffff, "USAGE: /ooc [text]");
else {
new tmp[192];
GetPlayerName(playerid,tmp,24);
format(tmp,192,"((OOC - %s: %s))",tmp,cmdtext[5]);
SendClientMessageToAll(0xFFFFFFAA,tmp);
print(tmp);
}
return 1;
}