OnClientPlayerWeaponSwitch: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
m (See Also for client player events) |
||
Line 28: | Line 28: | ||
==See Also== | ==See Also== | ||
{{ | ===Client player events=== | ||
{{Client_player_events}} | |||
===Client event functions=== | |||
{{Client_event_functions}} |
Revision as of 12:35, 12 January 2008
This event is triggered whenever a player switches his weapon.
Parameters
int previousWeapon, int currentWeapon
- previousWeapon: An integer representing the previous weapon the player had before he switched.
- currentWeapon: An integer representing the new weapon the player has.
Source
The source of this event is the player who changed his weapon
Example
This example disables the use of aiming for the minigun.
function disableMinigunOnSwitch ( prevID, newID ) if newID == 38 then --if the switched weapon is the minigun toggleControl ( "aim_weapon", false ) --disable the aim button else --if it isnt the minigun toggleControl ( "aim_weapon", true ) --renable the aim button end end addEventHandler ( "onClientPlayerWeaponSwitch", getRootElement(), disableMinigunOnSwitch )
See Also
Client player events
- onClientPlayerChangeNick
- onClientPlayerChoke
- onClientPlayerDamage
- onClientPlayerHeliKilled
- onClientPlayerHitByWaterCannon
- onClientPlayerJoin
- onClientPlayerPickupHit
- onClientPlayerPickupLeave
- onClientPlayerQuit
- onClientPlayerRadioSwitch
- onClientPlayerSpawn
- onClientPlayerStealthKill
- onClientPlayerStuntFinish
- onClientPlayerStuntStart
- onClientPlayerTarget
- onClientPlayerVehicleEnter
- onClientPlayerVehicleExit
- onClientPlayerVoicePause
- onClientPlayerVoiceResumed
- onClientPlayerVoiceStart
- onClientPlayerVoiceStop
- onClientPlayerWasted
- onClientPlayerWeaponFire
- onClientPlayerWeaponSwitch
Client event functions
- triggerLatentServerEvent
- triggerServerEvent
- Shared
- addEvent
- addEventHandler
- cancelEvent
- cancelLatentEvent
- getEventHandlers
- getLatentEventHandles
- getLatentEventStatus
- removeEventHandler
- triggerEvent
- wasEventCancelled