13.07.2010, 22:27
Well, I wanted to make 2 lines whenever I write a long text, I tried to do that, but it shows a text messed up..., but when I write short text, it looks fine. dunno why, take atleast one look on it, plz and thx
Код:
if(strcmp(cmd, "/d", true) == 0) { new string[256]; if(IsPlayerConnected(playerid)) { if(IsLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_WHITE, "You are not logged in yet."); return 1; } GetPlayerName(playerid, sendername, sizeof(sendername)); new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, " USAGE: /r [radio transmission]"); return 1; } if(strlen(cmdtext) > 50) { new string2[120]; format(string,120,"[GOV]%s:%s...", sendername,cmdtext[50]); strdel(cmdtext,50,strlen(cmdtext)); format(string2,120,"... %s",cmdtext[4]); SendClientMessageToAll(COLOR_DEPART_RADIO,string); SendClientMessageToAll(COLOR_DEPART_RADIO,string2); } else { format(string,120,"[GOV]%s: %s", sendername,cmdtext[4]); SendClientMessageToAll(COLOR_DEPART_RADIO,string); } } return 1; }