22.08.2011, 09:10
Code:
new MsgStr[128]; stock SendMessageToAll(text[]) { for(new i = 0; i < MAX_PLAYERS; i++) { if(Player[i][pLoggedIn] == 1) { if(strlen(text) >= 128) { new FirstString[128], SecondString[128]; strmid(FirstString, text, 0, 124); strmid(SecondString, text, 124, 248); format(MsgStr, sizeof(MsgStr), "%s...", FirstString); SendClientMessage(i, -1, MsgStr); format(MsgStr, sizeof(MsgStr), "...%s", SecondString); SendClientMessage(i, -1, MsgStr); } else { SendClientMessage(i, -1, text); } } } return 1; } public OnPlayerText(playerid, text[]) { if(Player[playerid][pLoggedIn] == 0) { SendErrorMessage(playerid, "You MUST complete the tutorial before you can send or recieve any messages!"); } else { format(MsgStr, sizeof(MsgStr), ""#Yellow"["#Orange"World"#Yellow"]["#White"%s "#Orange"%s"#Yellow"("#Orange"%d"#Yellow")]: "#Orange"%s", \ Player[playerid][pTitle], Player[playerid][pRoleplayName], playerid, text); SendMessageToAll(MsgStr); } return 0; }
I compiled and no errors...
I go in-game and test by typing "BlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahBlahB lahBlahBlahBlahBlah"
What I get when I test in-game...
"[World][Player Elbert_Hutchinson(0)]: BlahBlahBlahBlah"
And nothing else even though I obviously posted a bigger message than that...