Skip to content

Commit

Permalink
0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
jonteohr authored Aug 20, 2017
1 parent 50528c2 commit 3de6b4a
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ Some of the other entries in the menu include:
|`sm_warden_colorR`|**33**|The Red value of the color the warden gets.|
|`sm_warden_colorG`|**114**|The Green value of the color the warden gets.|
|`sm_warden_colorB`|**255**|The Blue value of the color the warden gets.|
|`sm_warden_icon`|**1**|Have an icon above the wardens' head? 1 = Enable. 0 = Disable.|
|`sm_warden_icon_path`|**decals/BetterWarden/warden**|The path to the icon. Do not include file extensions!|

### CMenu
| ConVar | Default | Description |
Expand Down Expand Up @@ -110,6 +112,7 @@ Some of the other entries in the menu include:
#endinput
#endif
#define bwardenincluded
#define VERSION "0.4"
#define a ADMFLAG_RESERVATION
#define b ADMFLAG_GENERIC
Expand Down Expand Up @@ -147,6 +150,14 @@ forward void OnWardenDeath(int client);
*/
forward void OnWardenCreated(int client);
/**
* Called when an admin sets a warden.
*
* @param admin client index
* @param client index
*/
forward void OnWardenCreatedByAdmin(int admin, int client);
/**
* Called when the current warden disconnects.
*
Expand Down Expand Up @@ -225,8 +236,8 @@ native bool IsClientWardenAdmin(int client);
* Checks several parameters to see if the specified client is a valid user.
*
* @param client index
* @param Allow bots?
* @param Allow dead?
* @param Allow bots? (False)
* @param Allow dead? (False)
* @return true if valid
*/
stock bool IsValidClient(int client, bool bAllowBots = false, bool bAllowDead = false)
Expand All @@ -237,6 +248,22 @@ stock bool IsValidClient(int client, bool bAllowBots = false, bool bAllowDead =
}
return true;
}
/**
* Precaches and prepares models for download. Used for icons!
*
* @param path to model
*/
stock void PrecacheModelAnyDownload(char[] sModel)
{
char sBuffer[256];
Format(sBuffer, sizeof(sBuffer), "materials/%s.vmt", sModel);
AddFileToDownloadsTable(sBuffer);
PrecacheModel(sBuffer, true);
Format(sBuffer, sizeof(sBuffer), "materials/%s.vtf", sModel);
AddFileToDownloadsTable(sBuffer);
PrecacheModel(sBuffer, true);
}
```
### CMenu
```sourcepawn
Expand Down Expand Up @@ -326,7 +353,6 @@ native bool GiveClientFreeday(int client);
* Remove a client's freeday
*
* @param client index
* @param set a beacon
* @return true if successful
*/
native bool RemoveClientFreeday(int client);
Expand All @@ -338,13 +364,7 @@ native bool RemoveClientFreeday(int client);
* @param state of the beacon.
* @return true if successful
*/
stock bool SetClientBeacon(int client, bool beaconState) {
if(IsValidClient(client)) {
// Beacon code to be implemented here
return true;
}
return false;
}
native bool SetClientBeacon(int client, bool beaconState);
```

## Translations
Expand Down

0 comments on commit 3de6b4a

Please sign in to comment.