Raised This Month: $ Target: $400
 0% 

How to make a function return 2 values ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 10-24-2007 , 16:49   Re: How to make a function return 2 values ?
Reply With Quote #7

Arkshine is wrong. Unlike arrays, simple cells are passed by value, so you have to explicitly pass them by reference.

Code:
getHPAndAP(user, &hp, &ap)
{
	hp = get_user_health(user);
	ap = get_user_armor(user);
}

mainFunction(id)
{
	new hp, ap;
	getHPAndAP(id, hp, ap);
	
	//...
}
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
 



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:12.


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