30.12.2009, 18:42
I seem to have this irritating problem, when people writes a long /me it just cuts the rest off if the sentence the person wrote is too long, how can i make so it just continues? Like it makes 2 lines if he has such a long /me
here is the code :
Thanks, it works
Would be cooler if it skipped down one line and continued writing so it wouldn't fill the half screen but its awesome, thanks !
here is the code :
Код:
if(strcmp(cmd, "/me", true) == 0) { if(IsPlayerConnected(playerid)) { 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] /me [action]"); return 1; } if(PlayerInfo[playerid][pMaskuse] == 1) { format(string, sizeof(string), "Stranger %s", result); } else { format(string, sizeof(string), "%s %s", GetPlayerNameEx(playerid), result); } ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } return 1; }
Would be cooler if it skipped down one line and continued writing so it wouldn't fill the half screen but its awesome, thanks !