13.04.2018, 17:05
Could anybody give me some information on how to make quickstrings work correctly in commands?
I have made multiple quickstrings under OnPlayerText which work fine when used as chat messages, but they don't work within commands (such as /whisper, /reply, /me)
Example of the string code under OnPlayerText:
(Most people already know how to do this anyway, but feel free to use it if you want to add similar $strings in your own gamemode )
How the string appears in the chat:
How the string appears when following a command:
I have made multiple quickstrings under OnPlayerText which work fine when used as chat messages, but they don't work within commands (such as /whisper, /reply, /me)
Example of the string code under OnPlayerText:
(Most people already know how to do this anyway, but feel free to use it if you want to add similar $strings in your own gamemode )
Код:
new idx = strfind(text, "$"); if(idx != -1) { new string[144]; strcat(string, text); do { if(strcmp(string[idx], "$loc", true, 4) == 0) { strdel(string, idx, idx + 4); strins(string, PlayerInfo[playerid][pLocation], idx); continue; }
How the string appears when following a command: