Functions

cstrike.inc

amxmodx 1.8.2 hg65

Function Type Description
CS_InternalCommand forward Called when CS internally fires a command to a player. It does this for a few
functions, most notably rebuy/autobuy functionality. This is also used to pass
commands to CZ bots internally.
cs_get_armoury_type native Get what weapon type (CSW_*) an armoury_entity is.
cs_get_c4_defusing native Gets or sets whether the C4 is being defused.
cs_get_c4_explode_time native Gets or sets the time in which the C4 will explode.
cs_get_hostage_foll native Returns index of entity (does not have to be a player) which hostage is following. 0 is hostage doesn't follow anything.
Note: this native does not work on Condition Zero, which has a different hostage AI than CS.
cs_get_hostage_id native Get unique hostage id.
cs_get_hostage_lastuse native Gets or sets the time that the hostage was last used.
cs_get_hostage_nextuse native Gets or sets the time which the hostage can next be used.
cs_get_no_knives native Returns 1 if no knives mode is enabled, else 0.
cs_get_user_armor native This function has no description.
cs_get_user_bpammo native Get amount of ammo in backpack on a user for a specific weapon.
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
cs_get_user_buyzone native Is user in buyzone? Returns 1 when true, 0 when false.
cs_get_user_deaths native Returns player deaths.
cs_get_user_defuse native Returns 1 if user has a defuse kit.
cs_get_user_driving native Returns different values depending on if user is driving a vehicle - and if so at what speed.
0: no driving
1: driving, but standing still
2-4: driving, different positive speeds
5: driving, negative speed (backing)
Note: these values were tested quickly, they may differ.
cs_get_user_hasprim native Returns 1 when user has a primary weapon OR a shield in inventory, else 0.
cs_get_user_hostagekills native Gets or sets the number of hostages that a user has killed.
cs_get_user_lastactivity native Gets or sets the user's last activity time. This is the time that CS's internal afk kicker
checks to see who has been afk too long.
cs_get_user_mapzones native Returns in bitwise form if the user is in a specific map zone.
NOTE: If user can't plant (cs_get_user_plant(index) is 0) then cs_get_user_mapzones(index) & CS_MAPZONE_BOMBTARGET will return 0 too.
cs_get_user_model native Get user model.
cs_get_user_money native Returns users money.
cs_get_user_nvg native Does user have night vision goggles?
cs_get_user_plant native Returns 1 if user has the "skill" to plant bomb, else 0. Normally this would only be true for a terrorist carrying a bomb.
cs_get_user_shield native Returns 1 if user has a shield, else 0.
cs_get_user_stationary native Returns 1 if user is using a stationary gun, else 0.
cs_get_user_submodel native Returns the submodel setting of the player.
If this is 1, then the user has a backpack or defuser on their model (depending on team)
cs_get_user_team native This function has no description.
cs_get_user_tked native Returns 1 of specified user has tk:ed (team killed).
cs_get_user_vip native Is user vip? Returns 1 if true, 0 if false.
cs_get_user_zoom native Returns how a user is zooming during the native call. Values correspond to the above enum, but will return 0 if an error occurred.
cs_get_weapon_ammo native Returns amount of ammo in weapon's clip.
cs_get_weapon_burst native Returns 1 if specified weapon is in burst mode.
cs_get_weapon_id native Get weapon type. Corresponds to CSW_* in amxconst.inc: 1 is CSW_P228, 2 is CSW_SCOUT and so on...
cs_get_weapon_silen native Returns 1 if weapon is silenced, else 0.
cs_reset_user_model native Use to reset model to standard selected model.
cs_set_armoury_type native Set an armoury_entity to be of specified type. You will have to set the appropriate model.
The second argument, type, should be a CSW_* constant. Not all weapons are supported by Counter-strike.
Supported weapons/items: CSW_MP5NAVY, CSW_TMP, CSW_P90, CSW_MAC10, CSW_AK47, CSW_SG552, CSW_M4A1, CSW_AUG, CSW_SCOUT
CSW_G3SG1, CSW_AWP, CSW_M3, CSW_XM1014, CSW_M249, CSW_FLASHBANG, CSW_HEGRENADE, CSW_VEST, CSW_VESTHELM, CSW_SMOKEGRENADE
cs_set_c4_defusing native This function has no description.
cs_set_c4_explode_time native This function has no description.
cs_set_hostage_foll native Set hostage to follow entity specified in followedindex. Does not have to be a player. If followedindex is 0 the hostage will stop following.
Note: this native does not work on Condition Zero, which has a different hostage AI than CS.
cs_set_hostage_lastuse native This function has no description.
cs_set_hostage_nextuse native This function has no description.
cs_set_no_knives native Enabled no knives mode by calling this with value 1. Disabled with 0.
No knives mode means that player will not be given a knife when spawning.
You can still give knives (ie through fun's give_item).
cs_set_user_armor native Use this instead of fun's set_user_armor.
Appropriate message to update client's HUD will be sent if armortype is kevlar or vesthelm.
cs_set_user_bpammo native Restock/remove ammo in a user's backpack.
cs_set_user_deaths native Sets player deaths.
cs_set_user_defuse native If defusekit is 1, the user will have a defuse kit.
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.
cs_set_user_hostagekills native This function has no description.
cs_set_user_lastactivity native This function has no description.
cs_set_user_model native Set user model.
cs_set_user_money native Gives money to user. If flash is 1, the difference between new and old amount will flash red or green.
cs_set_user_nvg native Set nvgoggles to 1 to give night vision goggles to index. Set it to 0 to remove them.
cs_set_user_plant native If plant is 1, a user will be set to be able to plant bomb within the usual bomb target areas if having one.
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).
cs_set_user_submodel native Sets the submodel setting of the player.
If this is 1, then the user has a backpack or defuser on their model (depending on team)
0 removes it.
cs_set_user_team native This function has no description.
cs_set_user_tked native Returns 1 of specified user has TKed (team killed).
tk = 1: player has TKed
tk = 0: player hasn't TKed
Set subtract to how many frags to subtract. Set subtract to negative value to add frags.
cs_set_user_vip native If vip = 1, user is set to vip.
If model = 1, then user's model will be changed to VIP model or random CT model if vip = 0.
If scoreboard = 1, then scoreboard will be updated to show that user is VIP.
This shouldn't be used for players on teams other than CT.
NOTE: this is mostly useful for unsetting vips, so they can change teams and/or buy items properly.
It does not alter game play; the one being VIP at start of round will retain internal status as VIP; terrorists
can terminate him and accomplish their objective, etc.
cs_set_user_zoom native Sets a weapon zoom type on a player, any zoom type will work for all weapons, so you can even set an awp zoom to pistols :D
The 2nd param has to be one of the above zoom types in the enum. Mode can only be 0 or 1.
If mode=0 (blocking mode), the user will be forced to use the zoom type set by the native, and wont be able to change it (even by changing weapon)
until the native resets the zoom with CS_RESET_ZOOM.
If mode=1 the user will be able to restore back to a normal view by changing weapon.
cs_set_weapon_ammo native Set amount of ammo in weapon's clip.
cs_set_weapon_burst native If burstmode = 1, weapon will be changed to burst mode, 0 and non-burst mode (semiautomatic/automatic) will be activated.
Only GLOCK and FAMAS can enter/leave burst mode.
cs_set_weapon_silen native If silence = 1, weapon will be silenced, 0 and silencer will be removed. Only USP and M4A1 can be silenced.
cs_user_spawn native Spawns a Counter-Strike player