Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] Question about pawn compiler

 
  • 0 Vote(s) - 0 Average
Pawn Question about pawn compiler
robertocaribbean
Offline

Burgershot Member
Posts: 27
Threads: 8
Joined: Aug 2020
Reputation: 0
Location: Argentina
#1
2021-03-07, 08:06 PM
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]
matei_
Offline

Burgershot Member
Posts: 6
Threads: 2
Joined: May 2020
Reputation: 0
Location: Romania
#2
2021-03-07, 09:00 PM
Those characters are not supported, same as the romanian characters: "ț, ș" etc.
robertocaribbean
Offline

Burgershot Member
Posts: 27
Threads: 8
Joined: Aug 2020
Reputation: 0
Location: Argentina
#3
2021-03-08, 12:58 AM (This post was last modified: 2021-03-08, 01:15 AM by robertocaribbean.)
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.
destiezk
Offline

Burgershot Member
Posts: 41
Threads: 1
Joined: Feb 2021
Reputation: 3
Location: Hungary
#4
2021-03-08, 10:34 AM (This post was last modified: 2021-03-08, 10:35 AM by destiezk.)
Nevermind. Deleted
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#5
2021-03-08, 07:55 PM
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:[email protected](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.
robertocaribbean
Offline

Burgershot Member
Posts: 27
Threads: 8
Joined: Aug 2020
Reputation: 0
Location: Argentina
#6
2021-03-08, 10:13 PM (This post was last modified: 2021-03-10, 05:15 PM by robertocaribbean.)
(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:[email protected](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:[email protected](playerid, params[])

But this has no effect, I need to wrote /[email protected] 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.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode