18.12.2016, 07:05
Quote:
Thanks a lot, it fixed it.
Does anyone know whether there is a way in which like if a player types /blahslkdjasdkasd or any other big wrong command, it only shows some characters of it and change it to like /blahsikl.... and with dots at the end? [pawn] public OnPlayerCommandPerformed(playerid, cmdtext[], success) { if(!success) { new str[75]; format(str,sizeof(str),"The Command ~y~%s ~w~does not exist, To see all commands use ~y~/cmds",cmdtext); PlayerTextDrawSetString(playerid,wrongcmd[playerid],str); PlayerTextDrawShow(playerid,wrongcmd[playerid]); SetTimerEx("HideWrongTD", 6000, false, "i", playerid); } return 1; }/pawn] |
Код:
new str[90]; if(strlen(cmdtext) > 20) { strmid(str, cmdtext, 0, 20); strcat(str, "..."); } else strcat(str, cmdtext); format(str,sizeof(str),"The Command ~y~%s ~w~does not exist, To see all commands use ~y~/cmds", str);