Ulysses
Ulysses Stuff => General Chat & Help and Support => Topic started by: LuaTenshi on December 04, 2011, 05:08:11 PM
-
I am trying to make a LUA, that will run on players when they spawn and check their name, if they have special characters in their name it will freeze them and ask them to change their name.
...but I noticed that Gmod handles ASCII differently, can any one provide me with the equivalents for ASCII characters 33 - 126?
This is the site, I have been using for the regular ones... http://www.asciitable.com/
I can not find one for Gmod.
-
2 things..
1. You are mixing client only and server side code in the same file. This is usually not a good idea unless you block it off with something like this..
if SERVER then
end
if CLIENT then
end
and 2. You are overwriting the GAMEMODE.PlayerSpawn function.. which could be what is causing whatever issues you are having (you didn't specify) There are other things that are done in that function such as setting the player's loadout and player model. If you override the function you need to do these manually. I would suggest hooking the playerspawn function instead of overwriting it.
-
OK, my script now works, but I noticed that Gmod handles ASCII differently, can any one provide me with the equivalents for ASCII characters 33 - 126?
This is the site, I have been using for the regular ones... http://www.asciitable.com/
I can not find one for Gmod.
Edit: I mean that some characters are converted into other characters with different ASCII codes.
-
Perhaps a Unicode table might help you? http://unicodetable.org
Ascii is, originally, American.
Unicode is meant to be used world wide, just about any language.
Valve and or Garry may have made a mosh of both, or using one over other.
Or perhaps another standard, ISO8859, which, is ASCII + (extra), and actually sounds more like what you describe.
-
"Some characters are converted into other characters with different ASCII codes" -- what? All standard Latin characters will fall under the standard ASCII table. I believe the Source engine is using UTF-8 (indistinguishable from standard ASCII for Latin characters). If you have further specific questions, I am fairly knowledgable on this subject. :)
-
blah
"Some characters are converted into other characters with different ASCII codes" -- what? All standard Latin characters will fall under the standard ASCII table. I believe the Source engine is using UTF-8 (indistinguishable from standard ASCII for Latin characters). If you have further specific questions, I am fairly knowledgable on this subject. :)
Basically, what he said :)
-
You might want to check out the following article, it helped me when I had to research character encodings: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) by Joel Spolsky (http://www.joelonsoftware.com/articles/Unicode.html)