2004-03-04 16:08:31 +00:00
|
|
|
/* Counter-Strike functions
|
|
|
|
*
|
|
|
|
* by the AMX Mod X Development Team
|
|
|
|
*
|
|
|
|
* This file is provided as is (no warranties).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if defined _cstrike_included
|
|
|
|
#endinput
|
|
|
|
#endif
|
|
|
|
#define _cstrike_included
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns player deaths.
|
|
|
|
*/
|
2004-03-07 20:06:04 +00:00
|
|
|
native cs_get_user_deaths(index);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Sets player deaths.
|
|
|
|
*/
|
2004-03-07 20:06:04 +00:00
|
|
|
native cs_set_user_deaths(index, newdeaths);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns index of entity (does not have to be a player) which hostage is following. 0 is hostage doesn't follow anything.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_get_hostage_foll(index);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Set hostage to follow entity specified in followedindex. Does not have to be a player. If followedindex is 0 the hostage will stop following.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_set_hostage_foll(index, followedindex = 0);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Get unique hostage id.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_get_hostage_id(index);
|
|
|
|
|
|
|
|
/* Get amount of ammo in backpack on a user for a specific weapon.
|
2004-04-06 07:40:51 +00:00
|
|
|
* Look in amxconst.inc for weapon types: CSW_*.
|
|
|
|
* Weapons on the same line uses the same ammo type:
|
|
|
|
* awm
|
|
|
|
* scout, ak, g3
|
|
|
|
* para
|
|
|
|
* famas, m4a1, aug, sg550, galil, sg552
|
|
|
|
* m3, xm
|
|
|
|
* usp, ump, mac
|
|
|
|
* fiveseven, p90
|
|
|
|
* deagle
|
|
|
|
* p228
|
|
|
|
* glock, mp5, tmp, elites
|
|
|
|
* flash
|
|
|
|
* he
|
|
|
|
* smoke
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_get_user_bpammo(index, weapon);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Restock/remove ammo in a user's backpack.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_set_user_bpammo(index, weapon, amount);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns 1 if user has a defuse kit.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_get_user_defuse(index);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
|
|
|
/* If defusekit is 1, the user will have a defuse kit.
|
2004-04-06 07:40:51 +00:00
|
|
|
* You can specify a different colour for the defuse kit icon showing on hud. Default is the normal green.
|
|
|
|
* You can specify an icon. Default is "defuser". Set flash to 1 if you want the icon to flash red.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_set_user_defuse(index, defusekit = 1, r = 0, g = 160, b = 0, icon[] = "defuser", flash = 0);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Is user in buyzone? Returns 1 when true, 0 when false.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_get_user_buyzone(index);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Get user model.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_get_user_model(index, model[], len);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Set user model.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_set_user_model(index, const model[]);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Use to reset model to standard selected model.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_reset_user_model(index);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns users money.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_get_user_money(index);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Gives money to user. If flash is 1, the difference between new and old amount will flash red or green.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_set_user_money(index, money, flash = 1);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Does user have night vision goggles?
|
|
|
|
*/
|
2004-03-20 23:58:26 +00:00
|
|
|
native cs_get_user_nvg(index);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them.
|
|
|
|
*/
|
2004-03-20 23:58:26 +00:00
|
|
|
native cs_set_user_nvg(index, nvgoggles = 1);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_get_user_plant(index);
|
|
|
|
|
|
|
|
/* If plant is 1, a user will be set to be able to plant bomb within the usual bomb target areas if having one.
|
2004-04-06 07:40:51 +00:00
|
|
|
* You should use this if you give a player a weapon_c4, or he won't be able to plant it
|
|
|
|
* without dropping it and picking it up again (only possible for terrorists).
|
|
|
|
* If showbombicon is 1, the green C4 icon will be shown on user hud (if plant "skill" was enabled).
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_set_user_plant(index, plant = 1, showbombicon = 1);
|
|
|
|
|
|
|
|
/* Get team directly from player's entity.
|
2004-04-06 07:40:51 +00:00
|
|
|
* 1 = terrorist
|
|
|
|
* 2 = counter-terrorist
|
|
|
|
* 3 = spectator
|
|
|
|
*/
|
|
|
|
enum CsTeams {
|
|
|
|
CS_TEAM_T = 1,
|
|
|
|
CS_TEAM_CT = 2,
|
|
|
|
CS_TEAM_SPECTATOR = 3
|
|
|
|
};
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_get_user_team(index);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Set user team without killing player (so you can move hostages, plant bomb etc as terrorist).
|
|
|
|
* Note: Effect may vary between different versions of CS.
|
|
|
|
* If model is anything other than 0, that will be set as player's model.
|
|
|
|
* Model updates when player spawns.
|
|
|
|
*/
|
|
|
|
enum CsInternalModel {
|
|
|
|
CS_DONTCHANGE = 0,
|
|
|
|
CS_CT_URBAN = 1,
|
|
|
|
CS_T_TERROR = 2,
|
|
|
|
CS_T_LEET = 3,
|
|
|
|
CS_T_ARCTIC = 4,
|
|
|
|
CS_CT_GSG9 = 5,
|
|
|
|
CS_CT_GIGN = 6,
|
|
|
|
CS_CT_SAS = 7,
|
|
|
|
CS_T_GUERILLA = 8,
|
|
|
|
CS_CT_VIP = 9
|
|
|
|
};
|
|
|
|
native cs_set_user_team(index, team, model = CS_DONTCHANGE);
|
|
|
|
|
|
|
|
/* Is user vip? Returns 1 if true, 0 if false.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_get_user_vip(index);
|
|
|
|
|
|
|
|
/* If vip = 1, user is set to vip. Note that this is useful to unset vips, so they can change teams properly.
|
2004-04-06 07:40:51 +00:00
|
|
|
* This will not change the player's model to/from vip, or add/remove the "VIP" text in scoreboard.
|
|
|
|
*/
|
2004-03-04 16:08:31 +00:00
|
|
|
native cs_set_user_vip(index, vip = 1);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns 1 if specified weapon is in burst mode.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_get_weapon_burst(index);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
|
|
|
/* If burstmode = 1, weapon will be changed to burst mode, 0 and non-burst mode (semiautomatic/automatic) will be activated.
|
2004-04-06 07:40:51 +00:00
|
|
|
* Only GLOCK and FAMAS can enter/leave burst mode.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_set_weapon_burst(index, burstmode = 1);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns 1 if weapon is silenced, else 0.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_get_weapon_silen(index);
|
2004-03-04 16:08:31 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced.
|
|
|
|
*/
|
2004-03-22 07:23:47 +00:00
|
|
|
native cs_set_weapon_silen(index, silence = 1);
|
2004-03-22 09:10:11 +00:00
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Returns amount of ammo in weapon's clip.
|
|
|
|
*/
|
2004-03-22 09:10:11 +00:00
|
|
|
native cs_get_weapon_ammo(index);
|
|
|
|
|
2004-04-06 07:40:51 +00:00
|
|
|
/* Set amount of ammo in weapon's clip.
|
|
|
|
*/
|
2004-03-22 09:10:11 +00:00
|
|
|
native cs_set_weapon_ammo(index, newammo);
|