BIS fnc respawnTickets: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Function|= Comments ____________________________________________________________________________________________ | arma3 |= Game name |0.74|= Game version |eff= global |= __...")
m (Text replacement - "[[Arma 3 " to "[[Arma 3: ")
 
(55 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function
____________________________________________________________________________________________


| arma3 |= Game name
|game1= arma3
|version1= 0.74


|0.74|= Game version
|gr1= Respawn


|eff= global |=
|eff= global
____________________________________________________________________________________________


| Manage respawn tickets used by ''[[Arma_3_Respawn#Respawn_Templates|Tickets]]'' respawn template.
|descr= Manage respawn tickets used by [[Arma 3: Respawn#Respawn Templates|Tickets]] respawn template.<br>


When player respawns, 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.
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.


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.
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.
|= Description
____________________________________________________________________________________________


| [<target>,(<tickets>,<dynamicTarget>)] spawn BIS_fnc_respawnTickets; |= Syntax
|s1= [target, tickets, dynamicTarget] call [[BIS_fnc_respawnTickets]]


|p1= '''target''': Receiver of the respawn loadout
|p1= '''target''': Receiver of the respawn tickets. Can be of type:
: [[Namespace]] - use [[missionNamespace]] to set/get global tickets available for everyone
* [[Namespace]] - use [[missionNamespace]] to set/get global tickets available for everyone
: [[Side]]
* [[Side]]
: [[Group]]
* [[Group]]
: [[Object]]|=
* [[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.
|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]].
|p3= '''dynamicTarget''': [[Boolean]] - when [[true]], set/get tickets based on the target. '''target''' must be an [[Object]].


| [[Number]] - remaining tickets after adjustment |= Return value
|r1= [[Number]] - remaining tickets after adjustment


____________________________________________________________________________________________
|s2= [] call [[BIS_fnc_respawnTickets]]
|s2= [] spawn BIS_fnc_respawnTickets; |= Syntax 2


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


|x2= Return number of global tickets
|x1= Add 5 tickets for BLUFOR:
<code><nowiki>[</nowiki>[[missionNamespace]]] call BIS_fnc_respawnTickets;</code> |=
<sqf>[west, 5] call BIS_fnc_respawnTickets;</sqf>
____________________________________________________________________________________________


| [[Arma 3 Respawn]] |= See also
|x2= Return number of global tickets:
<sqf>_globalTickets = [missionNamespace] call BIS_fnc_respawnTickets;</sqf>


|x3= Return number of player's tickets:
<sqf>_playerTickets = [player, nil, true] call BIS_fnc_respawnTickets;</sqf>
|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:Arma 3:_Functions|respawnTickets]]

Latest revision as of 10:38, 6 May 2024

Hover & click on the images for description

Description

Description:
Manage respawn tickets used by Tickets respawn template.
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. 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.
Execution:
call
Groups:
Respawn

Syntax

Syntax:
[target, tickets, dynamicTarget] call BIS_fnc_respawnTickets
Parameters:
target: Receiver of the respawn tickets. Can be of type:
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:
Number - remaining tickets after adjustment

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: Respawn BIS_fnc_addRespawnPosition BIS_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