• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Question about pawn compiler
#1
Hi there,



I want to use spanish words in my gamemode, but the compiler throws error when try to compile.



Code:
CMD:veh?culo(playerid, params[]) {



? SendClientMessage(playerid, -1, "test");



? return 1;

}

This throws an error: "Invalid function or declaration" in the line where "veh?culo" word is.







Also when I want to use SendClientMessage, there is no error at compiler level but the message look weird character, instead of the character I want.



Maybe the compiler doesn't support characters like " ? "?



Code:
CMD:test(playerid, params[]) {



? SendClientMessage(playerid, -1, "veh?culo");



? return 1;



}











[Image: rUHhU8b.png]
  Reply
#2
Those characters are not supported, same as the romanian characters: "?, ?" etc.
  Reply
#3
Well, I found a partial solution..

You need to change encoding of the .pwn file. In vscode, the default encoding is "UTF-8", so I changed it to "ISO 8859-1" and fix the problem.

There is a issue, I can't use zcmd or y_commands because the compiler keeps throwing errors. But, I can use strcmp function in order to make commands without any problem.

(2021-03-07, 09:00 PM)matei_ Wrote: Those characters are not supported, same as the romanian characters: "?, ?" etc.

So, if you want to try, there is a romanian encoding (ISO 8859-16) in vscode as well.
  Reply
#4
Nevermind. Deleted
  Reply
#5
You can use y_commands, but you need to encode the command names using punycode (the same encoding that URLs use):



Code:
CMD:veh?culo(playerid, params[])



Becomes:



Code:
CMD:vehculo@9ya(playerid, params[])



If you use a website like this one: https://www.punycoder.com/ The result will be "xn--vehculo-9ya", remove the "xn--" prefix and change the "-" to "@". I keep meaning to make a site to do it for y_commands, just never got around to it.
  Reply
#6
(2021-03-08, 07:55 PM)Y_Less Wrote: You can use y_commands, but you need to encode the command names using punycode (the same encoding that URLs use):

Code:
CMD:veh?culo(playerid, params[])

Becomes:

Code:
CMD:vehculo@9ya(playerid, params[])

If you use a website like this one: https://www.punycoder.com/ The result will be "xn--vehculo-9ya", remove the "xn--" prefix and change the "-" to "@".? I keep meaning to make a site to do it for y_commands, just never got around to it.

Thank you for your response!

I tried:
Code:
CMD:vehculo@9ya(playerid, params[])

But this has no effect, I need to wrote /vehculo@9ya in game in order to work. If I wrote /veh?culo, just throws "SERVER: Unknown command"

EDIT: If you want to use a fast command processor and still use accented characters, you can use pawn.cmd. You can register aliases for a command, in that way you can make it work.
  Reply


Forum Jump: