AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Getting arguments (https://forums.alliedmods.net/showthread.php?t=10064)

Votorx 02-07-2005 11:56

Getting arguments
 
When you get an argument from a function using read_argv, how can you get numbers? I thought u can just do it just like this:

new temp[3]
read_argv(id,temp,3)
new number = str_to_num(temp)

only problem is, number = 0, always.

How can I get numbers from the argument?

Also, does ns_set_points() and ns_set_exp() actually work? If so how can I use them?

Johnny got his gun 02-07-2005 14:43

Re: Getting arguments
 
Quote:

Originally Posted by Votorx
When you get an argument from a function using read_argv, how can you get numbers? I thought u can just do it just like this:

new temp[3]
read_argv(id,temp,3)
new number = str_to_num(temp)

only problem is, number = 0, always.

How can I get numbers from the argument?

Also, does ns_set_points() and ns_set_exp() actually work? If so how can I use them?

1. Your array is size 3. At most you can read 2 characters into it to save space for the null terminator.

2. Be sure to get the right parameter # into the first parameter of read_argv(). To me it looks a little unspecified in your example.

Code:
new szFirstParameter[32] read_argv(1, szFirstParameter, 31) new iFirstParameter= str_to_num(szFirstParameter)

Votorx 02-07-2005 19:39

Wow, your right. I just realized that. Lmao, I haven't taken in arguments in such a long time I forgot how to use it.

Ty

HIM666 02-08-2005 23:57

ADSA


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

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