To do that for everyone you just use a global variable
Код:
CMD:disableallooc(playerid,params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,urcolor,"You're not admin!");
if(ooc == 0) return SendClientMessage(playerid,urcolor,"The ooc chat is already disabled!");
ooc = 0;
SendClientMessage(playerid,urcolor,"You disabled the ooc chat!");
return 1;
}
Код:
CMD:O(OC)(playerid, params[])
{
if(ooc == 0) return SendClientMessage(playerid,urcolor,"The ooc chat is not enabled);
new msg[128];
new string[100];
if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid, -1, "{0000CD}[SERVER]: {FFFFFF}/o [Message]");
format(string,sizeof(string),"(( %s says: %s )) ", GetPlayerNameEx(playerid), msg);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}
If you wanna do for a specific player you could use an array
Код:
new ooc[MAX_PLAYERS];
OnPlayerConnect
It enables the ooc for the player when he connects
Код:
CMD: disableooc(playerid,params[])
{
new ID;
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,urcolor,"You're not admin!");
if(ooc[ID] == 0) return SendClientMessage(playerid,urcolor,"This player doesn't have the ooc chat enabled!");
if(sscanf(params,"d",ID)) return SendClientMessage(playerid,urcolor,"Usage /disableooc [id]");
ooc[ID] = 0;
return 1;
}
Код:
CMD:O(OC)(playerid, params[])
{
new msg[128];
new string[100];
if(ooc[playerid] == 0) return SendClientMessage(playerid,urcolor,"Your ooc chat has been disabled!");
if(sscanf(params,"s[128]",msg)) return SendClientMessage(playerid, -1, "{0000CD}[SERVER]: {FFFFFF}/o [Message]");
format(string,sizeof(string),"(( %s says: %s )) ", GetPlayerNameEx(playerid), msg);
SendClientMessageToAll(COLOR_WHITE, string);
return 1;
}