Scripting/Squirrel/Functions/Misc/IsNum
From VC-MP Wiki
This function returns whether the string is a number
Syntax
bool IsNum( string text )
Arguments
- text - This is the string to check
Example
This example tells the player if their input is a number when they type '/c numbertest 123'
function onPlayerCommand( player, cmd, text ) { if ( cmd == "numbertest" ) { if ( IsNum( text ) ) MessagePlayer( text + " is a number!", player ); else MessagePlayer( text + " is NOT a number!", player ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Related Functions
- Message
- MessagePlayer
- MessageAllExcept
- PrivMessage
- PrivMessageAll
- ClientMessage
- ClientMessageToAll
- Announce
- AnnounceAll
- SendPlayerMessage
- KickPlayer
- BanPlayer
- BanIP
- UnbanIP
- GetWeaponName
- GetWeaponID
- GetDistrictName
- GetSkinName
- GetTickCount
- GetTime
- GetFullTime
- IsNum
- BindKey
- UnbindKey
- CallFunc
- InPoly
- DistanceFromPoint
- ReloadScripts
