/*=========================== > GENERAL CHAT < ===========================*/
new TColor[110];
new chatName[MAX_PLAYER_NAME];
GetPlayerName(playerid, chatName, sizeof(chatName));
static LastPrivmsg[MAX_PLAYERS][128];
if(strfind(LastPrivmsg[playerid], text, false) != -1) return ShowPlayerDialog(playerid, 84, DIALOG_STYLE_MSGBOX, " ", "{FF5F22}ERROR!, {FFFFFF}No escribas lo mismo repetitivamente.", "Ok", ""), 0;
strmid(LastPrivmsg[playerid], text, 0, strlen(text), sizeof(LastPrivmsg[]));
for(new i = 1; i < MAX_CHAT_LINES-1; i++) Chat[i] = Chat[i+1];
format(TColor,sizeof(TColor),"{%06x}%s {FFFFFF}(%d): {FFFFFF}%s",GetPlayerColor(playerid) >>> 8,chatName,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),TColor);
SetPlayerChatBubble(playerid,text,0xFFFFFFAA, 100.0, 10000);
/*=========================== > OWNER CHAT < ============================*/
new msg[128];
if(PlayerInfo[playerid][Level] >= 6) {
format(msg,sizeof(msg),"{ff0000}[Owner] {%06x}%s {FFFFFF}(%d): {FF0000}%s", GetPlayerColor(playerid) >>> 8, chatName, playerid, text);
SendPlayerMessageToAll(playerid, msg);
}
if(PlayerInfo[playerid][Level] >= 6)
{
// manda msg de owner
}
else
{
//se nгo manda msg normal
}
public OnPlayerText(playerid, text[])
{
new TColor[110], chatName[MAX_PLAYER_NAME];
GetPlayerName(playerid, chatName, sizeof(chatName));
static LastPrivmsg[MAX_PLAYERS][128];
if(strfind(LastPrivmsg[playerid], text, false) != -1) return ShowPlayerDialog(playerid, 84, DIALOG_STYLE_MSGBOX, " ", "{FF5F22}ERROR!, {FFFFFF}No escribas lo mismo repetitivamente.", "Ok", ""), 0;
strmid(LastPrivmsg[playerid], text, 0, strlen(text), sizeof(LastPrivmsg[]));
for(new i = 1; i < MAX_CHAT_LINES-1; i++) Chat[i] = Chat[i+1];
format(TColor, sizeof(TColor), "%s{%06x}%s {FFFFFF}(%d): {FFFFFF}%s", PlayerInfo[playerid][Level] >= 6 ? ("{ff0000}[Owner] ") : (""), GetPlayerColor(playerid) >>> 8, chatName, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), TColor);
SetPlayerChatBubble(playerid,text,0xFFFFFFAA, 100.0, 10000);
return 0;
}
PHP код:
|