AMXX-BG.INFO jctf.inc Raw include

jctf.inc

Original include source with line numbers.

Back Download .inc
1 #if defined _jctf_included
2 #endinput
3 #endif
4
5 #define _jctf_included
6 #define _jctf_version 1.26
7 #pragma library jctf
8
9 /*
10 These are parsed in the iEvent var of the jctf_flag() forward.
11 */
12 enum
13 {
14 /* Event | Forward variables used by event | Description of event */
15 FLAG_STOLEN = 0, /* iPlayer, iFlagTeam | iPlayer got iFlagTeam's flag from their base */
16 FLAG_PICKED, /* iPlayer, iFlagTeam | iPlayer picked iFlagTeam's flag from the ground */
17 FLAG_DROPPED, /* iPlayer, iFlagTeam | iPlayer dropped the iFlagTeam's flag by dying, disconnecting or manually */
18 FLAG_MANUALDROP, /* iPlayer, iFlagTeam | iPlayer dropped the iFlagTeam's flag manually (using /dropflag) */
19 FLAG_RETURNED, /* iPlayer, iFlagTeam, bAssist | iPlayer (bAssist ? "assisted on returning" : "returned") the iFlagTeam's flag */
20 FLAG_CAPTURED, /* iPlayer, iFlagTeam, bAssist | iPlayer (bAssist ? "assisted on capturing" : "captured") the iFlagTeam's flag */
21 FLAG_AUTORETURN, /* iFlagTeam | iFlagTeam's flag was automatically returned */
22 FLAG_ADMINRETURN /* iPlayer, iFlagTeam | iFlagTeam's flag was returned by admin iPlayer using the command */
23 };
24
25 /**
26 * This forward triggers when a team's flag changes status.
27 * This forward also triggers, for example, when a flag is captured, for the
28 * capturing player and also for the assisting ones, each having bAssist true/false acordingly.
29 *
30 * @param iEvent The event triggered (list above)
31 * @param iPlayer Index of player
32 * @param iFlagTeam The flag's team
33 * @param bool:bAssist Is true if the iPlayer is an assisting player for iEvent, false if not.
34 * @noreturn
35 */
36 forward jctf_flag(iEvent, iPlayer, iFlagTeam, bool:bAssist);
37
38 /**
39 * This native returns the player's team
40 * NOTE: It doesn't check if player is actually a player, you could get plugin errors if you use it wrong.
41 *
42 * @param id Index of player
43 * @return Index of team
44 */
45 native jctf_get_team(id);
46
47 /**
48 * This native returns if the player is carrying the flag
49 * NOTE: It doesn't check if player is actually a player, you could get plugin errors if you use it wrong.
50 *
51 * @param id Index of player
52 * @return 1 if player is carying the flag, 0 otherwise
53 */
54 native jctf_get_flagcarrier(id);
55
56 /**
57 * This native returns the player's adrenaline amount.
58 * NOTE: It doesn't check if player is actually a player, you could get plugin errors if you use it wrong.
59 *
60 * @param id Index of player
61 * @return Amount of adrenaline player has
62 */
63 native jctf_get_adrenaline(id);
64
65 /**
66 * This native adds or substracts adrenaline from a player.
67 * NOTE: This can be used to set adrenaline too, you can empty it using -100 or fill it using 100 as iAdd.
68 * NOTE: It doesn't check if player is actually a player, you could get plugin errors if you use it wrong.
69 *
70 * @param id Index of player
71 * @param iAdd How much adrenaline to add, can be negative to substract
72 * @param szReason[] (optional) if specified, it will print a center and console message to the player about amount received/lost
73 * @noreturn
74 */
75 native jctf_add_adrenaline(id, iAdd, szReason[] = "");
76