Wilson [29th ID]
12-21-2007, 12:29 AM
These are stocks that have come in quite handy and will hopefully be implemented into the DoDx module eventually.
Until then, feel free to use them and post up some others that you have created.
// Returns entity name of provided wpnid
// Will pass the weaponname into the 2nd argument
stock dod_get_weapon_name( wpnid, weaponname[], len )
// Returns entity number of the client's weapon
// Provide *either* wpnid (ie. DODW_GARAND) *or* weaponname (ie. "weapon_garand")
stock dod_get_weapon_ent( id, wpnid=0, weaponname[] = "" )
// Returns DODW_ id of the weapon entity provided
stock dod_get_weapon_id( wpnent )
// Special Scoped Weapons (ie. FG42, Enfield) are not their own weapon entities
// but use the entities of similar weapons and this offset to distinguish
// Returns whether or not the weapon is set to special
// Provide *either* wpnid (ie. DODW_GARAND) *or* weaponname (ie. "weapon_garand")
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_scoped_weapon( id, wpnid, weaponname[] = "", set = -1 )
// Gets or Sets the prone state of the client
// Values: 0=Not Proned, 1=Proned, 2=Proned and Deployed
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_prone_state( id, set = -1 )
// Gets or Sets whether or not the current weapon (ie. Rocket) is shouldered
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_shouldered( id, set = -1 )
// Returns whether or not the provided wpnid is a deployable weapon
stock dod_is_deployable( wpnid )
// Gets or Sets the client's deploy state
// Values: 0=Not Deployed, 1=Deployable, 2=Deployed
// Only use the set param (value of 2, 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_deploy_state( id, set = -1 )
// Gets or Sets client's current stamina
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock Float:dod_stamina( id, Float:set = -1.0 )
// Gets or Sets the fuse on a grenade entity
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock Float:dod_fuse( grenindex, Float:set = -1.0 )
// Tests if client has cl_autoreload enabled - Or sets it for them
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_autoreload( id, set = -1 )
// by diamond-optic (12.24.07)
// converts weapon ids (from dod_get_user_weapon for example)
// into the ids used for those weapons in death messages
stock dod_weaponid_to_deathmsgid( weaponid )
// Provided simply for convenience/logic
stock dod_is_map_british()
Until then, feel free to use them and post up some others that you have created.
// Returns entity name of provided wpnid
// Will pass the weaponname into the 2nd argument
stock dod_get_weapon_name( wpnid, weaponname[], len )
// Returns entity number of the client's weapon
// Provide *either* wpnid (ie. DODW_GARAND) *or* weaponname (ie. "weapon_garand")
stock dod_get_weapon_ent( id, wpnid=0, weaponname[] = "" )
// Returns DODW_ id of the weapon entity provided
stock dod_get_weapon_id( wpnent )
// Special Scoped Weapons (ie. FG42, Enfield) are not their own weapon entities
// but use the entities of similar weapons and this offset to distinguish
// Returns whether or not the weapon is set to special
// Provide *either* wpnid (ie. DODW_GARAND) *or* weaponname (ie. "weapon_garand")
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_scoped_weapon( id, wpnid, weaponname[] = "", set = -1 )
// Gets or Sets the prone state of the client
// Values: 0=Not Proned, 1=Proned, 2=Proned and Deployed
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_prone_state( id, set = -1 )
// Gets or Sets whether or not the current weapon (ie. Rocket) is shouldered
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_shouldered( id, set = -1 )
// Returns whether or not the provided wpnid is a deployable weapon
stock dod_is_deployable( wpnid )
// Gets or Sets the client's deploy state
// Values: 0=Not Deployed, 1=Deployable, 2=Deployed
// Only use the set param (value of 2, 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_deploy_state( id, set = -1 )
// Gets or Sets client's current stamina
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock Float:dod_stamina( id, Float:set = -1.0 )
// Gets or Sets the fuse on a grenade entity
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock Float:dod_fuse( grenindex, Float:set = -1.0 )
// Tests if client has cl_autoreload enabled - Or sets it for them
// Only use the set param (value of 1 or 0) to set this offset; ignore it to "get"
// the current value
stock dod_autoreload( id, set = -1 )
// by diamond-optic (12.24.07)
// converts weapon ids (from dod_get_user_weapon for example)
// into the ids used for those weapons in death messages
stock dod_weaponid_to_deathmsgid( weaponid )
// Provided simply for convenience/logic
stock dod_is_map_british()