Skip to content

API: Natives

Jonathan Öhrström edited this page Sep 12, 2017 · 16 revisions

betterwarden.inc

wardenmenu.inc


IsClientWarden

Checks if the given client is currently warden.

Parameters
    int CLIENT - Client index
Returns
    TRUE - If yes

Example

if(IsClientWarden(client)) {
  return Plugin_Handled;
}
WardenExists

Checks if there currently is a warden.

Parameters
    Nothing
Returns
    TRUE - If yes

Example

if(WardenExists()) {
  return Plugin_Handled;
}
SetWarden

Makes the given client warden for the round.

Parameters
    int CLIENT - Client index
Returns
    TRUE - If successful

Example

int client;
public void OnMapStart() {
  SetWarden(client);
}
RemoveWarden

Removes the current warden.

Parameters
    Nothing
Returns
    TRUE - If successful

Example

public void OnMapEnd {
  RemoveWarden();
}
GetCurrentWarden

Fetch the current wardens' client index.

Parameters
    Nothing
Returns
    CLIENT - Client index of the current warden

Example

public fetchWarden() {
  int warden = GetCurrentWarden();
  return warden;
}
GetTeamAliveClientCount

Gets the amount of alive players in the specified team.

Parameters
    TEAM - Team index number
Returns
    COUNT - Number of alive players

Example

public void OnMapStart() {
  int team1 = GetTeamAliveClientCount(CS_TEAM_T);
}
IsClientWardenAdmin

Checks if the client is a Better Warden admin

Parameters
    CLIENT - Client index
Returns
    TRUE - If yes

Example

public Action command(int client, int args) {
  if(!IsClientWardenAdmin(client)) {
  	return Plugin_Handled;
  }
}
IsEventDayActive

Check if there is a event day currently active.

Parameters
    Nothing
Returns
    TRUE - If yes

Example

if(IsEventDayActive()) {
  return Plugin_Handled;
}
IsHnsActive

Check if a Hide and Seek game is running.

Parameters
    Nothing
Returns
    TRUE - If yes

Example

if(IsHnsActive()) {
  return Plugin_Handled;
}
IsGravFreedayActive

Check if a Gravity Freeday is running.

Parameters
    Nothing
Returns
    TRUE - If yes

Example

if(IsGravFreedayActive()) {
  return Plugin_Handled;
}
IsWarActive

Check if a warday is running.

Parameters
    Nothing
Returns
    TRUE - If yes

Example

if(IsWarActive()) {
  return Plugin_Handled;
}
IsFreedayActive

Check if a freeday is running.

Parameters
    Nothing
Returns
    TRUE - If yes

Example

if(IsFreedayActive()) {
  return Plugin_Handled;
}
ClientHasFreeday

Check if the specified client already has a freeday.

Parameters
    CLIENT - Client index
Returns
    TRUE - If yes

Example

if(ClientHasFreeday(client)) {
  return Plugin_Handled;
}
GiveClientFreeday

Give a client a freeday

Parameters
    CLIENT - Client index
Returns
    TRUE - If successful

Example

int client;
if(WardenExists()) {
  GiveClientFreeday(client);
}
RemoveClientFreeday

Remove a client's freeday

Parameters
    CLIENT - Client index
Returns
    TRUE - If successful

Example

int client;
if(!WardenExists()) {
  RemoveClientFreeday(client);
}
SetClientBeacon

Sets a beacon on a client. Just like the one in the SM Admin Menu.

Parameters
    CLIENT - Client index
    beaconState - State of the beacon
Returns
    TRUE - If successful

Example

int client;
if(ClientHasFreeday(client)) {
  SetClientBeacon(client, true);
}
ExecWarday

Executes a warday. This will execute whether or not a game is already running. Make sure to check before with IsEventDayActive()!

Parameters
    Nothing
Returns
    TRUE - If successful

Example

public void OnMapStart() {
  ExecWarday();
}
ExecFreeday

Executes a freeday. This will execute whether or not a game is already running. Make sure to check before with IsEventDayActive()!

Parameters
    Nothing
Returns
    TRUE - If successful

Example

public void OnMapStart() {
  ExecFreeday();
}
ExecHnS

Executes a HnS. This will execute whether or not a game is already running. Make sure to check before with IsEventDayActive()!

Parameters
    WINNERS - Number of winners
Returns
    TRUE - If successful

Example

public void OnMapStart() {
  ExecHnS(2);
}
ExecGravday

Executes a Gravity Freeday. This will execute whether or not a game is already running. Make sure to check before with IsEventDayActive()!

Parameters
    Nothing
Returns
    TRUE - If successful

Example

public void OnMapStart() {
  ExecGravday();
}