Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] How to convert string to int?

 
  • 0 Vote(s) - 0 Average
Pawn How to convert string to int?
ViktorNas
Offline

Burgershot Member
Posts: 2
Threads: 1
Joined: Jul 2021
Reputation: 0
Location: Cykagrad
#1
2021-07-04, 02:10 AM
Please tell me if there is any function that does this or how I could make a function that does this.
Radical
Offline

Burgershot Member
Posts: 148
Threads: 21
Joined: Dec 2020
Reputation: 16
#2
2021-07-04, 04:14 AM
https://open.mp/en/docs/scripting/functions/strval
ViktorNas
Offline

Burgershot Member
Posts: 2
Threads: 1
Joined: Jul 2021
Reputation: 0
Location: Cykagrad
#3
2021-07-04, 07:21 PM
Thanks dude.
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#4
2021-07-04, 07:52 PM
sscanf is better, it has better error returns and deals with separators.
Pinch
Offline

Burgershot Member
Posts: 391
Threads: 19
Joined: Apr 2019
Reputation: 22
Location: Belgrade, Serbia
#5
2021-07-05, 04:36 AM
(2021-07-04, 07:52 PM)Y_Less Wrote: sscanf is better, it has better error returns and deals with separators.
Good, you could create a (where not to) use sscanf tutorial tho, it's really not needed when only a single number is in question.. (simply isnumeric > value = strval)
Using Pawn.CMD?
If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
« 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