open.mp forum
[Pawn] Question about pawn compiler - Printable Version

+ open.mp forum (https://forum.open.mp)
-- Forum: SA-MP (https://forum.open.mp/forumdisplay.php?fid=3)
--- Forum: Pawn Scripting (https://forum.open.mp/forumdisplay.php?fid=10)
--- Thread: [Pawn] Question about pawn compiler (/showthread.php?tid=1739)



Question about pawn compiler - robertocaribbean - 2021-03-07

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]


RE: Question about pawn compiler - matei_ - 2021-03-07

Those characters are not supported, same as the romanian characters: "?, ?" etc.


RE: Question about pawn compiler - robertocaribbean - 2021-03-08

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.


RE: Question about pawn compiler - destiezk - 2021-03-08

Nevermind. Deleted


RE: Question about pawn compiler - Y_Less - 2021-03-08

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.


RE: Question about pawn compiler - robertocaribbean - 2021-03-08

(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.