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

Two IDs in one function


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iNvectus
Member
Join Date: Sep 2014
Location: Bulgaria
Old 04-17-2017 , 08:38   Two IDs in one function
Reply With Quote #1

Greetings.I have more of a question than needing help in certain code.The question is: How can I get two ids of two players in one function.Example: To make a duel/battle/fight/challenge come true I need two IDs, right? Uncle Google couldn't help me so far, so I guess you guys could help me.
iNvectus is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-17-2017 , 08:46   Re: Two IDs in one function
Reply With Quote #2

You can add as many parameters as you want to your custom function.
__________________
HamletEagle is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 04-17-2017 , 08:50   Re: Two IDs in one function
Reply With Quote #3

As an example:

PHP Code:
// Set the same health to two different users.
my_functionid1id2 health)
{
    
set_user_healthid1health );
    
set_user_healthid2health )

The idea of using more parameters require just to USE THEM

P.S.: Ask Uncle Google if he knows about plugins who already do that.
__________________
Project: Among Us

Last edited by Craxor; 04-17-2017 at 08:53.
Craxor is offline
Send a message via ICQ to Craxor
eyal282
Veteran Member
Join Date: Aug 2011
Old 04-20-2017 , 10:37   Re: Two IDs in one function
Reply With Quote #4

Create a variable of Partner of a player.

new Partner[33];
--------
Set Partner[id] to -1 if he has no partner ( no duel takes place ).
--------
Set Partner[id] = target;
Set Partner[target] = id;

Do that if they have a duel.

---------

If it's like a JailBreak Last Request where there is only 1 duel at the time, create two integers of Guard and Prisoner

Do:
Guard = ID of guard.
Prisoner = ID of prisoner.
eyal282 is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-20-2017 , 13:29   Re: Two IDs in one function
Reply With Quote #5

Why -1? 0 works fine.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
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 08:11.


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