Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 13 14 15 16 17 18 Next »
Help with string.char()
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode
Help with string.char()
24-06-2015, 05:58 PM,
#1
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
Help with string.char()
Hello i have a problem with my starfall screen. Whenever i try to convert keys into string i am getting weird symbols

I am using:

hook.add( "playerbuttondown", "ButtonDown", function( ply, key )
if ( IsTyping and ply == TypingPly and NextType < time.curTime() ) then
if TypeBox == 1 then
ReceiverNameBox = ReceiverNameBox..string.char(key)
NextType = timer.curTime()+0.5
end

end

end)
At the end i want to have a normal string BUT, i am getting those weird symbols ( In the Send to line ):

[Image: D3B3BE869F47074974D67D7E2D25DFF35302AA12]

I hope someone can help me
Find
Reply
24-06-2015, 06:35 PM,
#2
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Help with string.char()
The key argument isn't a character, it's an enum the Source engine uses to pick up keys. That's why you're getting weird characters.

You need to translate from the enum to the key it represents. All the enums are stored in the input library, the ones you want are the KEY_ enums. Look in the docs tab for a list of all of them.
Find
Reply
24-06-2015, 07:05 PM,
#3
SuperPlayer Offline
TSCM Super Member
****
Posts: 234
Threads: 30
Joined: Oct 2014
RE: Help with string.char()
Ok works. Thank you!
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
Forum Jump:


Users browsing this thread:
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.