AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   read_argv: Not working (https://forums.alliedmods.net/showthread.php?t=11393)

burcyril10 03-18-2005 03:22

read_argv: Not working
 
This is taken from my whole code
Code:
new rlvl //Declare the var read_argv(1,"rlvl",1) //Set its value do_wr(rlvl) //Pass it to my function

The function always gets 0, no matter what I type in console.....HELP!

Johnny got his gun 03-18-2005 04:56

Code:
new rlvl[16] //Declare the string read_argv(1, rlvl, 15) //Set its value do_wr(rlvl) //Pass it to my function

Note that rlvl is a string and if you intend to receive it in do_wr that one has to take a string as a parameter, like this...

Code:
do_wr(thestring[]) { /* bla bla bla */ }

XxAvalanchexX 03-18-2005 13:49

Alternatively, keep the do_wr function the same and use this code:

Code:
new rlvl[16] //Declare the string read_argv(1, rlvl, 15) //Set its value do_wr(str_to_num(rlvl)) //Pass it to my function

burcyril10 03-18-2005 17:54

I had acualy worked it out just before going to bed but thanks Avalanche cause i wasn't sure if you could do that so i used an intermediate variable


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

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