AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Re-using Variables (https://forums.alliedmods.net/showthread.php?t=85961)

Drak 02-18-2009 13:15

Re-using Variables
 
If I did something like this. In this order.
Code:
new Temp[33]        get_user_name(id,Temp,32); client_print(id,print_chat,"Your name is: %s",Temp);         get_user_name(SomeOtherID,Temp,32); client_print(id,print_chat,"Your name is: %s",Temp);

Is there any chance that it could display the same name twice?

Arkshine 02-18-2009 13:22

Re: Re-using Variables
 
No, it won't happen.

Drak 02-18-2009 13:25

Re: Re-using Variables
 
Thank you.

Brad 02-18-2009 13:28

Re: Re-using Variables
 
Having said that, "temp" is a TERRIBLE name for a variable. I'm hoping it was just a poor choice of random variable name to be used in the example. Variable names should always describe the type of data it holds.

BOYSplayCS 02-18-2009 17:01

Re: Re-using Variables
 
I second that Brad, or you'll end up with something like The Specialists.

BOYSplayCS 02-18-2009 17:02

Re: Re-using Variables
 
Oh, I have another question, sorry for the double-post.

Is the reason it doesn't work because you can only use ONE VARIABLE NAME in one function?

Arkshine 02-18-2009 18:02

Re: Re-using Variables
 
Not sure to fully understand what's your problem exactly.


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

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