Chat problem
#1

How i can fix it?...
Reply
#2

Show us OnPlayerText function.
Reply
#3

I don't have
Reply
#4

Then nothing to do. Is there .pwn file in the gamemodes folder?
Reply
#5

Yes.. tell me what i cand do... how i can add OnPlayerText function.
Reply
#6

PHP код:
public OnPlayerText(playerid,text[])
{
    return 
0;

Reply
#7

... The text is on 2 lines... how i can make it to 1 line...
Reply
#8

Put the OnPlayerText here there's no one to stole that from you -.-
Reply
#9

//================================================== ============================
// Player Text
//================================================== ============================
public OnPlayerText(playerid, text[])
{
new pChat[256], string[256], ctime, PText[256];
//--------------------------------------------------------------------------
//Anti Advertising
//--------------------------------------------------------------------------
if(GoIP(text) && !IsPlayerAdmin(playerid))
{
//----------------------------------------------------------------------
SendClientMessage(playerid, orange, "You have been {11FF00}Banned{FF9900} for advertising an IP Address!");
SendClientMessage(playerid, orange, "If you think it was an mistake, visit {11FF00}forum.etrion.ro{FF9900} for UnBan!");
//----------------------------------------------------------------------
return BanEx(playerid, "(IP Ads)");
}
//--------------------------------------------------------------------------
// Block CapsLock
//--------------------------------------------------------------------------
if(AccInfo[playerid][Caps] == 1)
{
UpperToLower(text);
}
//--------------------------------------------------------------------------
// Vip Chat
//--------------------------------------------------------------------------
if(text[0] == '*' && AccInfo[playerid][pVip] >= 3)
{
//----------------------------------------------------------------------
format(pChat, 128, "VIP Chat: {FF4400} %s: {15FF00}%s", PlayerName2(playerid),text[1]);
MessageToPlayerVIP(orange, pChat);
//----------------------------------------------------------------------
//SaveIn("ChatVipLog",pChat);
return 0;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++
if(text[0] == '#' && AccInfo[playerid][pVip] >= 3)
{
//----------------------------------------------------------------------
format(pChat, 128, "VIP Chat: {FF4400} %s: {15FF00}%s", PlayerName2(playerid),text[1]);
MessageToPlayerVIP(orange, pChat);
//----------------------------------------------------------------------
//SaveIn("ChatVipLog",pChat);
return 0;
}
//--------------------------------------------------------------------------
// Administration Chat
//--------------------------------------------------------------------------
if(text[0] == '@' && AccInfo[playerid][Level] >= 1)
{
//----------------------------------------------------------------------
format(pChat, 128, "Admin Chat: {FF4400} %s: {15FF00}%s", PlayerName2(playerid),text[1]);
MessageToAdmins(orange, pChat);
//----------------------------------------------------------------------
SaveIn("AdmChatLog", pChat);
return 0;
}
//--------------------------------------------------------------------------
//Clan's Chat
/*/--------------------------------------------------------------------------
if(text[0] == '!')
{
//----------------------------------------------------------------------
format(pChat, 128, "Clan Chat: {FF4400} %s: {15FF00}%s",PlayerName2(playerid), text[1]);
SendMessageToClanMembers(playerid, orange, pChat);
//----------------------------------------------------------------------
return 0;
}
*///--------------------------------------------------------------------------
//BRB/AFK System
//--------------------------------------------------------------------------
if(AccInfo[playerid][BRBSts] == 1)
{
GameTextForPlayer(playerid, "~w~Use ~r~/Back~w~ to return", 6000, 4);
return 0;
}
//--------------------------------------------------------------------------
//Anti-Spam
//--------------------------------------------------------------------------
if(AccInfo[playerid][pVip] < 7)
{
if(AccInfo[playerid][pVip] < 6)
{
if((gettime() - chattime[playerid]) < 3)
{
//--------------------------------------------------------------
if(gettime() - chattime[playerid] == 0) ctime = 3;
else if(gettime() - chattime[playerid] == 1) ctime = 2;
else if(gettime() - chattime[playerid] == 2) ctime = 1;
//--------------------------------------------------------------
format(string, 128 , "{FF6F00}Please wait {00FF00}%d{FF6F00} Seconds to write something again!", ctime);
SendClientMessage(playerid, orange, string);
return 0;
}
else chattime[playerid] = gettime();
}
else if(AccInfo[playerid][pVip] == 6)
{
if((gettime() - chattime[playerid]) < 2)
{
//--------------------------------------------------------------
if(gettime() - chattime[playerid] == 0) ctime = 2;
else if(gettime() - chattime[playerid] == 1) ctime = 1;
//--------------------------------------------------------------
format(string, 128 , "Please wait {00BBF6}%d{FF9900} Seconds to write something again!", ctime);
SendClientMessage(playerid, orange, string);
return 0;
}
else chattime[playerid] = gettime();
}
}
//--------------------------------------------------------------------------
//Player Muted
//--------------------------------------------------------------------------
if(AccInfo[playerid][Muted] == 1)
{
AccInfo[playerid][MuteWarnings]++;
//----------------------------------------------------------------------
if(AccInfo[playerid][MuteWarnings] < ServerInfo[MaxMuteWarnings])
{
format(string, 128, "|- ATTENTION: You are Muted! Cannot talk (Warnings: %d/%d) -|", AccInfo[playerid][MuteWarnings], ServerInfo[MaxMuteWarnings]);
SendClientMessage(playerid, red, string);
}
else
{
SendClientMessage(playerid,grey, "You have been Automatically Kicked {11FF00}(Reason: Exceeding Mute Warnings)!");
Kick(playerid);
}
return 0;
}
//--------------------------------------------------------------------------
//Send Admin & VIP in front of Admin Name
//--------------------------------------------------------------------------
//--------------------------------------------------------------------------
//Send Admin & VIP in front of Admin Name
//--------------------------------------------------------------------------

SetPlayerChatBubble(playerid, text, 0xFFFFFFAA, 200.0, 10000);
if(AccInfo[playerid][Level] > 0 && AccInfo[playerid][Hide] == 1)
{
format(PText, 256, "{FFFFFF}(%d) :%s",playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] > 0 && AccInfo[playerid][Hide] == 0 && AccInfo[playerid][Level] < 9)
{
format(PText, 256, "{FC0905}[A] (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] == 9 && AccInfo[playerid][Hide] == 0)
{
format(PText, 256, "{FC0905}[Co-OWN] (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] == 10)
{
format(PText, 256, "{FC0505}[OWN] (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] == 11)
{
format(PText, 256, "{FC0505}[D] (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] == 12)
{
format(PText, 256, "{FC0505}[Co-Founder] (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] == 13)
{
format(PText, 256, "[Founder]{99FFFF} (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] == 69)
{
format(PText, 256, "[#]{FF0000}Valoare{99FFFF} (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] == 1337)
{
format(PText, 256, "{FFFFFF}[{FF0000}#{FFFFFF}]{FF0000}Scripter {FFFFFF}(%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(IsPlayerAdmin(playerid) > 0 && AccInfo[playerid][Hide] == 0)
{
format(PText, 150, "%s%s{FF0000}[{FFFFFF}RCON{FF0000}]{15FF00} (%d):%s", playerid, text );
SendClientMessageToAll( playerid , PText );
return 0;
}
else if(AccInfo[playerid][pVip] > 0)
{
format(PText, 256, "{FFFF00}[VIP]{11FF00} (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][pVip] > 9)
{
format(PText, 256, "{FFFF00}[GOLD]{11FF00} (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][pVip] > 9)
{
format(PText, 256, "{FFFF00}[PREMIUM]{11FF00} (%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
else if(AccInfo[playerid][Level] < 1 && AccInfo[playerid][pVip] < 1)
{
format(PText, 256, "{FFFFFF}(%d) :%s", playerid, text);
SendPlayerMessageToAll(playerid, PText);
return 0;
}
//================================================== ============================
// Chat Lines (Console)
//================================================== ============================
for(new i = 1; i < MAX_CHAT_LINES-1; i++)
Chat[i] = Chat[i+1];
new ChatSTR[128];
GetPlayerName(playerid,ChatSTR,sizeof(ChatSTR));
format(ChatSTR,128,"[CHAT]%s spune: %s",ChatSTR, text[0]);
Chat[MAX_CHAT_LINES-1] = ChatSTR;
return 1;
}
Reply
#10

Код:
for(new i = 1; i < MAX_CHAT_LINES-1; i++)
Chat[i] = Chat[i+1];
new ChatSTR[128];
GetPlayerName(playerid,ChatSTR,sizeof(ChatSTR));
format(ChatSTR,128,"[CHAT]%s spune: %s",ChatSTR, text[0]);
Chat[MAX_CHAT_LINES-1] = ChatSTR;
return 0;  // << ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)