AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   determine numeric value (https://forums.alliedmods.net/showthread.php?t=213629)

hypheni 04-17-2013 05:12

determine numeric value
 
In C it is pretty simple with few API calls but I'm not sure how to check the same in Pawn. I want to check integer numbers in a user chat. I'm thinking of checking ASCII of char and match accordingly.

Can anyone provide any samples ?

Podarok 04-17-2013 10:12

Re: determine numeric value
 
Use if equali or containi. Or if it doesnt work, contact layka_LUBII

fysiks 04-18-2013 00:09

Re: determine numeric value
 
Maybe you should provide us with examples of what you mean. There is already a function to convert a number string to a number: str_to_num() and str_to_float().

hypheni 04-19-2013 03:15

Re: determine numeric value
 
<Player 1> : I'm new to counter strike 1.6. My age is 12 year

On above text I like to check whether there is more than 2 numeric values in the string. Should I loop through all element and check with some api call and increase my counter ?

Leon M. 04-19-2013 07:51

Re: determine numeric value
 
Take a look at the regular expression. http://www.amxmodx.org/funcwiki.php?go=module&id=17


All times are GMT -4. The time now is 10:56.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.