1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/scripting/include/cssdm.inc Sun Jun 24 21:58:09 2007 +0000
1.3 @@ -0,0 +1,187 @@
1.4 +/**
1.5 + * vim: set ts=4 :
1.6 + * ===============================================================
1.7 + * SourceMod (C)2004-2007 AlliedModders LLC. All rights reserved.
1.8 + * ===============================================================
1.9 + *
1.10 + * This file is part of the SourceMod/SourcePawn SDK. This file may only be used
1.11 + * or modified under the Terms and Conditions of its License Agreement, which is found
1.12 + * in LICENSE.txt. The Terms and Conditions for making SourceMod extensions/plugins
1.13 + * may change at any time. To view the latest information, see:
1.14 + * http://www.sourcemod.net/license.php
1.15 + *
1.16 + * Version: $Id$
1.17 + */
1.18 +
1.19 +#if defined _cssdm_included
1.20 + #endinput
1.21 +#endif
1.22 +#define _cssdm_included
1.23 +
1.24 +#define CSSDM_VERSION "2.0.0.0"
1.25 +
1.26 +#define CSSDM_MAX_WEAPONS 32
1.27 +
1.28 +#define CSSDM_TEAM_T 2
1.29 +#define CSSDM_TEAM_CT 3
1.30 +
1.31 +enum DmWeaponType
1.32 +{
1.33 + DmWeapon_Invalid = -1,
1.34 + DmWeapon_Primary = 0,
1.35 + DmWeapon_Secondary = 1,
1.36 + DmWeapon_Grenade = 3,
1.37 + DmWeapon_C4 = 4,
1.38 +};
1.39 +
1.40 +/**
1.41 + * Called when CS:S DM is started/enabled. If CS:S DM is enabled,
1.42 + * this will get called at the start of every map.
1.43 + */
1.44 +forward DM_OnStartup();
1.45 +
1.46 +/**
1.47 + * Called when CS:S DM is disabled. If CS:S DM is enabled, this
1.48 + * will get called at the end of the map.
1.49 + */
1.50 +forward DM_OnShutdown();
1.51 +
1.52 +/**
1.53 + * Called when a player spawns and CS:S DM is active. This
1.54 + * is a wrapper around the "player_spawn" event.
1.55 + *
1.56 + * @param client Client index.
1.57 + * @noreturn
1.58 + */
1.59 +forward DM_OnClientSpawned(client);
1.60 +
1.61 +/**
1.62 + * Called when a player spawns and CS:S DM is active. This
1.63 + * is called after all plugins are done processing
1.64 + * DM_OnClientSpawned().
1.65 + *
1.66 + * @param client Client index.
1.67 + * @noreturn
1.68 + */
1.69 +forward DM_OnClientPostSpawned(client);
1.70 +
1.71 +/**
1.72 + * Called when a player dies.
1.73 + *
1.74 + *
1.75 + * @param client Client index.
1.76 + * @return Plugin_Handled to block player from respawning.
1.77 + */
1.78 +forward Action:DM_OnClientDeath(client);
1.79 +
1.80 +/**
1.81 + * Called when the cssdm_spawn_method cvar changes.
1.82 + *
1.83 + * @param method Method name.
1.84 + * @return Plugin_Stop to handle this method.
1.85 + */
1.86 +forward Action:DM_OnSetSpawnMethod(const String:method[]);
1.87 +
1.88 +/**
1.89 + * Returns whether CS:S DM is running or not. This should be used to
1.90 + * check whether non-CS:S DM callbacks should be processed.
1.91 + *
1.92 + * @return True if CS:S DM is running, false otherwise.
1.93 + */
1.94 +native bool:DM_IsRunning();
1.95 +
1.96 +/**
1.97 + * Retrieves the CS:S DM spawning method.
1.98 + *
1.99 + * @param method Method name buffer.
1.100 + * @param maxlength Maximum size of the method name buffer.
1.101 + * @noreturn
1.102 + */
1.103 +native DM_GetSpawnMethod(const String:method[], maxlength);
1.104 +
1.105 +/**
1.106 + * Provides lookup for a weapon by its short name.
1.107 + *
1.108 + * @param name Weapon short name (such as "usp").
1.109 + * @return Weapon ID in CS:S DM, or -1 on failure.
1.110 + */
1.111 +native DM_GetWeaponID(const String:name[]);
1.112 +
1.113 +/**
1.114 + * Gets the type of a weapon by index.
1.115 + *
1.116 + * @param id Weapon ID.
1.117 + * @return Weapon type.
1.118 + * @error Invalid weapon index.
1.119 + */
1.120 +native DmWeaponType:DM_GetWeaponType(index);
1.121 +
1.122 +/**
1.123 + * Retrieves the classname of a weapon.
1.124 + *
1.125 + * @param id Weapon ID.
1.126 + * @param classname Class name buffer.
1.127 + * @param maxlength Maximum length of the class name buffer.
1.128 + * @noreturn
1.129 + * @error Invalid weapon index.
1.130 + */
1.131 +native DM_GetWeaponClassname(id, String:classname[], maxlength);
1.132 +
1.133 +/**
1.134 + * Retrieves the display name of a weapon.
1.135 + *
1.136 + * @param id Weapon ID.
1.137 + * @param name Display name buffer.
1.138 + * @param maxlength Maximum length of the display name buffer.
1.139 + * @noreturn
1.140 + * @error Invalid weapon index.
1.141 + */
1.142 +native DM_GetWeaponName(id, String:name[], maxlength);
1.143 +
1.144 +/**
1.145 + * Retrieves the entity index of a weapon in a player's weapon slot.
1.146 + *
1.147 + * @param client Client index.
1.148 + * @param type Weapon slot type.
1.149 + * @return Entity index, or -1 for none.
1.150 + */
1.151 +native DM_GetClientWeapon(client, DmWeaponType:type);
1.152 +
1.153 +/**
1.154 + * Drops a client's weapon. CS:S DM removes dropped weapons from the world.
1.155 + *
1.156 + * @param client Client index.
1.157 + * @param entity Weapon entity index.
1.158 + * @noreturn
1.159 + * @error Client index invalid or not in game; weapon entity invalid.
1.160 + */
1.161 +native DM_DropWeapon(client, entity);
1.162 +
1.163 +/**
1.164 + * Strips all items from a bot, excluding their player suit.
1.165 + *
1.166 + * @param client Client index.
1.167 + * @noreturn
1.168 + * @error Invalid client index, client not in game, nor client not a bot.
1.169 + */
1.170 +native DM_StripBotItems(client);
1.171 +
1.172 +
1.173 +/**
1.174 + * Do not edit below this line!
1.175 + */
1.176 +public Extension:__ext_cssdm =
1.177 +{
1.178 + name = "CS:S DM",
1.179 + file = "cssdm.ext",
1.180 +#if defined AUTOLOAD_EXTENSIONS
1.181 + autoload = 1,
1.182 +#else
1.183 + autoload = 0,
1.184 +#endif
1.185 +#if defined REQUIRE_EXTENSIONS
1.186 + required = 1,
1.187 +#else
1.188 + required = 0,
1.189 +#endif
1.190 +};