BIS fnc respawnTickets: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Text replacement - "\| *((\[\[[a-zA-Z0-9_ :\\\-\/|()]+\]\],? ?)+) * \}\}" to "|seealso= $1 }}")
(35 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
| arma3
____________________________________________________________________________________________


| arma3 |= Game name
|0.74


|1.00|= Game version
|gr1= Respawn
____________________________________________________________________________________________


| <pre>/*
|eff= global


Description:
| Manage respawn tickets used by ''[[Arma_3_Respawn#Respawn_Templates|Tickets]]'' respawn template.
Adjust number of respawn tickets. When player dies, the number is automatically decreased by 1;
When number of tickets reaches 0, player's respawn is disabled.


Parameter(s):
When player dies, number of tickets is decreased by 1. The most local tickets are always used. Example: When you first add tickets to player's side, they will be affected. If you later define tickets also to player's group, they will completely replace the side tickets.
0:
NAMESPACE, SIDE, GROUP or OBJECT - tickets space (e.g., it's possible to define two different ticket numbers for each side)
BOOL - true to return number of tickets in all spaces (used for returning value only, won't set anything)
ARRAY - return losing space from the passed list (elements can be of type NAMESPACE, SIDE, GROUP or OBJECT)
1: NUMBER - by how much will the ticket count be adjusted
2 (Optional): BOOL - true to autodetect tickets space. First param have to be an object. Used for modifying player's current tickets.


Returns:
When player runs out of the tickets, his respawn is disabled. If you use also ''EndMission'' respawn template, the mission will automatically end once tickets in all name spaces are exhausted.
NUMBER - remaining tickets after adjustment (-1 when no tickets were defined yet)
ARRAY - when array was used as an argument, returned value is [<losingSpace>,<tickets>]
*/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
| [<target>,(<tickets>,<dynamicTarget>)] call [[BIS_fnc_respawnTickets]];
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_respawnTickets]]; --> |= Syntax
|p1= '''target''': Receiver of the respawn tickets
: [[Namespace]] - use [[missionNamespace]] to set/get global tickets available for everyone
: [[Side]]
: [[Group]]
: [[Object]]
|p2= '''tickets''': [[Number]] - added respawn tickets. When missing or set to 0, number of tickets won't be affected, which means you can use the function to simply get amount of tickets.
|p3= '''dynamicTarget''': [[Boolean]] - when [[true]], set/get tickets based on the target. '''target''' must be an [[Object]].


|p1= |= Parameter 1
| [[Number]] - remaining tickets after adjustment


| |= Return value
|s2= [] [[call]] [[BIS_fnc_respawnTickets]];
____________________________________________________________________________________________


|x1= <code></code> |=
|r2= [[Number]] - remaining tickets in all name spaces
____________________________________________________________________________________________
 
|x1= Add 5 tickets for BLUFOR
<code><nowiki>[</nowiki>[[west]], 5] [[call]] [[BIS_fnc_respawnTickets]];</code>


| |= See also
|x2= Return number of global tickets
<code>globalTickets = [<nowiki/>[[missionNamespace]]] [[call]] [[BIS_fnc_respawnTickets]];</code>


|x3= Return number of player's tickets
<code><nowiki>playerTickets = [</nowiki>[[player]],[[nil]],[[true]]] [[call]] [[BIS_fnc_respawnTickets]];</code>
|seealso= [[Arma 3 Respawn]], [[BIS_fnc_addRespawnPosition]], [[BIS_fnc_removeRespawnPosition]]
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->


<!-- Note Section END -->
</dl>


<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Respawn|{{uc:respawnTickets}}]]
[[Category:Functions|{{uc:respawnTickets}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:respawnTickets}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:respawnTickets}}]]

Revision as of 01:37, 17 February 2021

Hover & click on the images for description

Description

Description:
Description needed
Execution:
call
Groups:
Respawn

Syntax

Syntax:
Syntax needed
Parameters:
target: Receiver of the respawn tickets
Namespace - use missionNamespace to set/get global tickets available for everyone
Side
Group
Object
tickets: Number - added respawn tickets. When missing or set to 0, number of tickets won't be affected, which means you can use the function to simply get amount of tickets.
dynamicTarget: Boolean - when true, set/get tickets based on the target. target must be an Object.
Return Value:
Return value needed

Alternative Syntax

Syntax:
[] call BIS_fnc_respawnTickets;
Return Value:
Number - remaining tickets in all name spaces

Examples

Example 1:
Add 5 tickets for BLUFOR [west, 5] call BIS_fnc_respawnTickets;
Example 2:
Return number of global tickets globalTickets = [missionNamespace] call BIS_fnc_respawnTickets;
Example 3:
Return number of player's tickets playerTickets = [player,nil,true] call BIS_fnc_respawnTickets;

Additional Information

See also:
Arma 3 RespawnBIS_fnc_addRespawnPositionBIS_fnc_removeRespawnPosition

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note