Raised This Month: $51 Target: $400
 12% 

get data from other function.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alex2001
Member
Join Date: May 2019
Old 06-06-2019 , 17:34   get data from other function.
Reply With Quote #1

hi i want to know how can i use a value from other function.
for example

public void GetDataMysql() {
Get name from database;
Get password from database;
}

public void other(){
create a hud and display name(from database)
}


this is just an example..
alex2001 is offline
farawayf
Senior Member
Join Date: Jan 2019
Old 06-06-2019 , 17:50   Re: get data from other function.
Reply With Quote #2

global array
farawayf is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-07-2019 , 01:15   Re: get data from other function.
Reply With Quote #3

Change other to take arguments and then call it with the data you retrieved.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
alex2001
Member
Join Date: May 2019
Old 06-07-2019 , 04:52   Re: get data from other function.
Reply With Quote #4

example?i dont unterstand
alex2001 is offline
Nexd
BANNED
Join Date: Dec 2013
Location: Hungary
Old 06-07-2019 , 05:28   Re: get data from other function.
Reply With Quote #5

in general
PHP Code:
Something() {
    
int something 5;
    
other(something);


other(int number){
        
PrintToChatAll("%i"number); 


Last edited by Nexd; 06-07-2019 at 05:29.
Nexd is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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