From SA-MP Wiki
strval can be used to convert a string to an integer.
|const string||The string you want to convert to an integer.|
|Returns||The integer value of the string.|
new string = "250"; new iValue = strval(string); // iValue is now '250'
The following functions may be useful, as they are related to this function in one way or another.
Any functions here can also be found on the Old scripting functions page.
- strcmp: Compare two strings to see if they are the same.
- strfind: Search for a substring in a string.
- strtok: Search for a variable typed after a space.
- strdel: Delete part/all of a string.
- strins: Put a string into another string.
- strlen: Check the length of a string.
- strmid: Extract characters from a string.
- strpack: Pack a string into a destination.
- strcat: Concatenate two strings into a destination reference.