Est GetWeaponIndex

From EventScripts Community Encyclopedia
Syntax: est_GetWeaponIndex <variable> <indentifier> <weapon slot/name>
Note: Command parameters are described inside the < and > characters. Optional parameters are contained within [ and ] characters.

Contents

Description

Gets the player's weapon index for the specified slot/weapon name and save it into variable

Parameters

  • variable - The variable to store the returned value in.
  • identifier - The identifier to use, must be a players:
    • userid
    • steamid
    • username - Partial or full name
  • weapon slot/name - See List_of_CSS_weapons for weapon selection help
    • 1 - Primary weapon
    • 2 - Secondary weapon
    • 3 - Knife
    • 4 - Gernades
    • Weapon name - Use a weapon name. example:AWP

Example


event player_hurt
{
  es_xset myvar 0
  es est_GetWeaponIndex myvar event_var(userid) 1
  es_tell event_var(userid) #multi #defaultYour primary weapon index is:#green server_var(myvar)
  // Displays players primary weapon index every time they get hurt
}

Notes

  • None

See Also

blog comments powered by Disqus