22.12.2014, 09:48
I've found other topics on how to split lines barely, but it doesn't match what i want, it's always different and they dont explain it, so i have no idea how to edit it to fit into my script...
Basically what i want is that if a player makes a too long chat line, instead of cutting it off, then sending another message with the rest of the message.
Ethically:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ..-
-.. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
(But without making 3 lines or more, max 2.)
This is some of my OnPlayerText (I dont think the rest is required.)
Basically what i want is that if a player makes a too long chat line, instead of cutting it off, then sending another message with the rest of the message.
Ethically:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ..-
-.. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
(But without making 3 lines or more, max 2.)
This is some of my OnPlayerText (I dont think the rest is required.)
pawn Code:
public OnPlayerText(playerid, text[])
{
if(USE_ANTI_SPAM == true)
{
if(pMuted[playerid] == true)
{
SendClientMessage(playerid, COLOR_RED, "{539600}[ANTI-CHEAT]{74D400} You have been muted for spamming the chat.");
return 0;
}
new AnimR = random(1);
if(AnimR == 0 && !IsPlayerInAnyVehicle(playerid) || !gPlayerUsingLoopingAnim[playerid] || !IsPlayerCuffed(playerid))
//if(gPlayerUsingLoopingAnim[playerid]) return;
//if(IsPlayerCuffed(playerid)) return;
{
ApplyAnimation(playerid, "PED", "IDLE_CHAT", 4.0, 1, 0, 0, 1, 1);
SetTimerEx("SpeakAnim", strlen(text)*200, false, "i", playerid);
}
else if(AnimR == 1 && !IsPlayerInAnyVehicle(playerid))
{
ApplyAnimation(playerid, "PED", "Idle_Chat_02", 4.0, 1, 0, 0, 1, 1);
SetTimerEx("SpeakAnim", strlen(text)*100, false, "i", playerid);
}
/*new Length = strlen(text);
new aTime = Length*400;
//ApplyAnimation(playerid,"PED","factalk",4.1,0, 0, 0, 0, aTime);
ApplyAnimation(playerid, "PED", "IDLE_CHAT",4.1,0,0,0,1,aTime);*/
//--
pLineCount[playerid]++;
SetTimerEx("LineCountReset", 2000, 0, "i", playerid);
if(pLineCount[playerid] >= MAX_MESSAGES)
{
pMuted[playerid] = true;
SetTimerEx("Unmute", 20000, 0, "i", playerid);
}
}
//if (IsAfterLifing[playerid] == 1) { return 0; }
if(PlayerInfo[playerid][pMute] == 1)
{
SendClientMessage(playerid, COLOR_GREY, "You cannot speak, you have been muted.");
return 0;
}
// Anti Adv
if(AntiAdv(playerid, text)) return 0;
// The Rest
new string[128];
// Normal Calling
if(BeingCalled[playerid] == 2 || Calling[playerid] == 2 || Call911[playerid])
{
if(strlen(PlayerInfo[playerid][pAccent])) format(string, sizeof(string), "[Cellphone] [%s Accent]: %s", PlayerInfo[playerid][pAccent], text);
else format(string, sizeof(string), "[Cellphone]: %s", text);
SendCopMessage(COLOR_RADAR, string);
SendRCSDMessage(COLOR_RADAR, string);
SendFBIMessage(COLOR_RADAR, string);
SendSWATMessage(COLOR_RADAR, string);
if(!Call911[playerid])
{
if(BeingCalled[playerid] == 2) SendClientMessage(Caller[playerid], COLOR_YELLOW, string);
else if(Calling[playerid] == 2) SendClientMessage(Called[playerid], COLOR_YELLOW, string);
}
}
else if(Live[playerid])
{
if(IsNewsVehicle(GetPlayerVehicleID(playerid)))
{
format(string, sizeof(string), "** (Live News): %s: %s", RPN(playerid), text);
SendClientMessageToAll(COLOR_LIGHTGREEN, string);
}
}
else
{
if(strlen(PlayerInfo[playerid][pAccent])) format(string, sizeof(string), "%s [%s Accent] says: %s", RPN(playerid), PlayerInfo[playerid][pAccent], text);
else format(string, sizeof(string), "%s says: %s", RPN(playerid), text);
SetPlayerChatBubble(playerid,string,COLOR_WHITE,15.0,4000);