AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] Why do "get_user" functions reflect value and not return value? (https://forums.alliedmods.net/showthread.php?t=110423)

unSeen 11-29-2009 12:24

[HELP] Why do "get_user" functions reflect value and not return value?
 
Hey everyone,
I wonder why the developers made the "get_user" functions as a void functions.

I mean why they've done:
(for example)
new szUserNick[33]
get_user_name(id, szUserName, 32)

and not:
new szUserNick[33]
szUserNick = get_user_name(id, 32)

anyone has any idea?

Thanks in advanced,
unSeen.

ConnorMcLeod 11-29-2009 12:51

Re: [HELP] Why do "get_user" functions reflect value and not return value?
 
When the native fills a string, in most of cases the return value is the length of the string.

Arkshine 11-29-2009 13:05

Re: [HELP] Why do "get_user" functions reflect value and not return value?
 
Quote:

and not:
new szUserNick[33]
szUserNick = get_user_name(id, 32)
Probably because it can't work like that.

AfteR. 11-29-2009 17:24

Re: [HELP] Why do "get_user" functions reflect value and not return value?
 
PHP Code:

new szUserNick[33]
get_user_name(idszUserName32

isnt it

PHP Code:

new szUserNick[32]
get_user_name(idszUserName31

?

addicted2sex 11-29-2009 18:39

Re: [HELP] Why do "get_user" functions reflect value and not return value?
 
Quote:

Originally Posted by AfteR. (Post 1002417)
PHP Code:

new szUserNick[33]
get_user_name(idszUserName32

isnt it

PHP Code:

new szUserNick[32]
get_user_name(idszUserName31

?


lol ...

fysiks 11-29-2009 19:24

Re: [HELP] Why do "get_user" functions reflect value and not return value?
 
Quote:

Originally Posted by AfteR. (Post 1002417)
PHP Code:

new szUserNick[33]
get_user_name(idszUserName32

isnt it

PHP Code:

new szUserNick[32]
get_user_name(idszUserName31

?

Doesn't really matter which as long as the number in the function is one less than the dimension of the array.


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

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