Difference between revisions of "BIS fnc respawnTickets"

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
(Created page with "{{Function|= Comments ____________________________________________________________________________________________ | arma3 |= Game name |0.74|= Game version |eff= global |= __...")
Line 1: Line 1:
 
 
{{Function|= Comments
 
{{Function|= Comments
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
Line 5: Line 4:
 
| arma3 |= Game name
 
| arma3 |= Game name
  
|1.00|= Game version
+
|0.74|= Game version
 +
 
 +
|eff= global |=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| <pre>/*
+
| Manage respawn tickets used by ''[[Arma_3_Respawn#Respawn_Templates|Tickets]]'' respawn template.
  
Description:
+
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.
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 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.
0:
+
|= Description
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:
+
| [<target>,(<tickets>,<dynamicTarget>)] spawn BIS_fnc_respawnTickets; |= Syntax
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
+
|p1= '''target''': Receiver of the respawn loadout
____________________________________________________________________________________________
+
: [[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]].
  
| <!-- [] call [[BIS_fnc_respawnTickets]]; --> |= Syntax
+
| [[Number]] - remaining tickets after adjustment |= Return value
  
|p1= |= Parameter 1
+
____________________________________________________________________________________________
 +
|s2= [] spawn BIS_fnc_respawnTickets; |= Syntax 2
  
| |= Return value
+
|r2= [[Number]] - remaining tickets in all name spaces |= Return value 2
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
 +
 
 +
|x1= Add 5 tickets for BLUFOR
 +
<code><nowiki>[</nowiki>[[west]], 5] call BIS_fnc_respawnTickets;</code> |=
  
|x1= <code></code> |=  
+
|x2= Return number of global tickets
 +
<code><nowiki>[</nowiki>[[missionNamespace]]] call BIS_fnc_respawnTickets;</code> |=
 
____________________________________________________________________________________________
 
____________________________________________________________________________________________
  
| |= See also
+
| [[Arma 3 Respawn]] |= See also
  
 
}}
 
}}
Line 52: Line 54:
  
 
<h3 style="display:none">Bottom Section</h3>
 
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Respawn|{{uc:respawnTickets}}]]
+
 
[[Category:Functions|{{uc:respawnTickets}}]]
+
[[Category:Arma 3:_Functions|respawnTickets]]
[[Category:{{Name|arma3}}: Functions|{{uc:respawnTickets}}]]
 

Revision as of 07:53, 31 July 2013

Introduced with Arma 3 version0.74
  Effects of this scripting function are broadcasted over the network and happen on every computer in the network

Click on the images for descriptions

Introduced in

Game:
Arma 3
Version:
0.74

Description

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

Syntax

Syntax:
[<target>,(<tickets>,<dynamicTarget>)] spawn BIS_fnc_respawnTickets;
Parameters:
target: Receiver of the respawn loadout
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:
Number - remaining tickets after adjustment

Alternative Syntax

Syntax:
[] spawn 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 [missionNamespace] call BIS_fnc_respawnTickets;

Additional Information

Execution:
call
Multiplayer:
-
See also:
Arma 3 Respawn

Notes

Only post proven facts here. Report bugs on the feedback tracker. Use the talk page or the forums for discussions.
Add New Note | How To

Notes

Bottom Section