Need some answers
#1

Hi SA-MP Community,

I want answers to these questions explain me.(No wiki links please, I read them already).

Q1).:What is sscanf? Explain its function.

Q2).:What is strtok, tmp?

Will ask more questions later.
Reply
#2

sscanf(******'s) splits a string into integers/floats/strings etc... useful with commands like
Код:
/givemoney [playerid] [amount]
strtok checks for a variable after a space. That is why it was used in commands so much. tmp is just a name of the variable after the space that was most commonly used.
Reply
#3

With sscanf we can split it in many other parts? Is it same like params?
Reply
#4

params is just the name of the command text ZCMD and YCMD uses.
Reply
#5

With sscanf we can split it in many other parts?
Reply
#6

Yes.
Reply
#7

Have you tried reading the sscanf thread? You should understand it if so.

Strtok splits strings into tokens like sscanf does but it's slower, less reliable and doesn't have as much functionality as sscanf and you also have to do additional function calls to turn the tokens into the type of data you need (ints, floats, bools).
Reply
#8

Thank you dude. +3rep to you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)