How to make a function return 2 values ?
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:
Any other way to return 2 values will be fine. -edit- I'm about to try somthing like : Code:
|
Re: How to make a function return 2 values ?
Simple...Something like ?
Code:
stock get_user_hp_ap(index) |
Re: How to make a function return 2 values ?
Thanks, i tried something like this but it crashed my listenserver, but i may have made an error somewhere else...
|
Re: How to make a function return 2 values ?
Oh, np, if not working i will think at something else... :)
|
Re: How to make a function return 2 values ?
Something like should work :
Code:
|
Re: How to make a function return 2 values ?
Oh yeah lol, i think arkshine is right :s
|
Re: How to make a function return 2 values ?
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) |
Re: How to make a function return 2 values ?
Thanks, now it works like a charm.
|
| All times are GMT -4. The time now is 01:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.