Jump to content

[HELP] takeWeapon why not working?


Tokio

Recommended Posts

42 minutes ago, MIKI785 said:

Depends on where you put it, post rest of the code.

function onSwitchToMinigun (previous, current)
if ( current == 38 ) then
local accName = getAccountName ( getPlayerAccount ( source ) )		
if ( hasObjectPermissionTo(source, "function.kickPlayer") then
		else
			killPed(source)
			takeWeapon( source, 38)
		end
	end
end

addEventHandler("onPlayerWeaponSwitch", getRootElement(), onSwitchToMinigun )

 

Link to comment
  • Moderators

Your first code will just take the ammo.

Firstlly, debug your code if you don't know where the error is. It can be because you're using takeWeapon after killPed, or maybe it has something wrong with hasObjectPermissionTo function.

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...