Jump to content

currentWeaponID


HoLsTeN

Recommended Posts

hi guys, its me again.

A simple problem

No Error in the debugscript 3

function WeaponsNo_ ( previousWeaponID, currentWeaponID ) 
    if ( getElementInterior(source) ~= 0 ) then 
        if currentWeaponID == 16 or 39 or 17 then   
            toggleControl ( source, "fire", false ) 
            outputChatBox("Change The Wepaons You Cant use this wepaon here",source,0,255,0) 
        else  
            toggleControl ( source, "fire", true ) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), WeaponsNo_ ) 

help <>

Link to comment

This should work:

function noweps ( previousWeaponID, currentWeaponID ) 
    if ( getElementInterior(source) == 0 ) then 
        if (currentWeaponID == 16 or currentWeaponID == 39 or currentWeaponID == 17) then   
            toggleControl ( source, "fire", false ) 
            outputChatBox("Change the weapons you cant use this weapon here.",source,0,255,0) 
        else 
            toggleControl ( source, "fire", true ) 
        end 
    end 
end 
addEventHandler ( "onPlayerWeaponSwitch", getRootElement(), noweps ) 

(tested)

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...