AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Using "num_to_str" wrong (https://forums.alliedmods.net/showthread.php?t=162234)

bibu 07-16-2011 15:00

Using "num_to_str" wrong
 
What am I doing wrong?

PHP Code:

    new random_number random_num1);
    
    new 
number_holder];
    
    
num_to_strrandom_numbernumber_holder);
    
    
engclient_cmdiPlayer"joinclass"random_number ); 


abdul-rehman 07-16-2011 15:03

Re: Using "num_to_str" wrong
 
Are you getting a compilation error or what is the problem exactly?

bibu 07-16-2011 15:07

Re: Using "num_to_str" wrong
 
Yes, still tag mismatch.

fysiks 07-16-2011 15:11

Re: Using "num_to_str" wrong
 
You have to use the string there.

Arkshine 07-16-2011 15:13

Re: Using "num_to_str" wrong
 
Tip: purpose of num_to_str.

bibu 07-16-2011 15:41

Re: Using "num_to_str" wrong
 
Quote:

Originally Posted by fysiks (Post 1512021)
You have to use the string there.

I am trying that.

@Arkshine:

I know, but the number needs to be as a string.

fysiks 07-16-2011 16:08

Re: Using "num_to_str" wrong
 
Quote:

Originally Posted by bibu (Post 1512038)
@Arkshine:

I know, but the number needs to be as a string.

He's just saying that you use num_to_str() for a reason but you never use the string that you created with it.

EDIT: Typo, thanks Kreation.

Kreation 07-16-2011 16:12

Re: Using "num_to_str" wrong
 
Quote:

Originally Posted by fysiks (Post 1512055)
num_to_str()

:3

bibu 07-16-2011 17:13

Re: Using "num_to_str" wrong
 
Quote:

Originally Posted by fysiks (Post 1512055)
but you never use the string that you created with it.

Hmm, how to use it then?

fysiks 07-16-2011 17:25

Re: Using "num_to_str" wrong
 
Code:
    new random_number = random_num( 1, 4 );         new number_holder[ 2 ];         num_to_str( random_number, number_holder, 1 );         engclient_cmd( iPlayer, "joinclass", number_holder );


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

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