Raised This Month: $ Target: $400
 0% 

How to make a function return 2 values ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-24-2007 , 12:35   How to make a function return 2 values ?
Reply With Quote #1

Hi,

I would like to make a function like get_user_weapon.

For example get_user_hp(id, ap) , no matter if ap is optional or not.

Code:
// in whatever function in the plugin new ap, hp = get_user_hp(id, ap) get_user_hp(id, ap) {     // suppose the player has 100HP, 75HP     // how can it return hp and also apply 75 to the var ap ? }

Any other way to return 2 values will be fine.


-edit-
I'm about to try somthing like :
Code:
get_user_hp(id, & ap) {     // suppose the player has 100HP, 75HP     // how can it return hp and also apply 75 to the var ap ?     ap = 75     return 100 }

Last edited by ConnorMcLeod; 10-24-2007 at 12:48.
ConnorMcLeod 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