Jump to content

addDebugHoock


#Major .

Recommended Posts

function GHook(sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ...)
		local args = {...}
		outputChatBox("!")
		if getElementType(args[1]) == 'player' then
		SetWeapon(args[1])
		end
		end	
    addDebugHook('postFunction', GHook, {'giveWeapon','setWeaponAmmo','takeWeapon'})

بختصار ليه الكود م يشتغل ع الفنكشنات هذي معنه يشتغل مع اي فنكشن غيرها؟

Link to comment
function GHook(sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ...)
		local args = {...}
		outputChatBox("!")
  	if functionName=='giveWeapon' or functionName=='setWeaponAmmo' or functionName=='takeWeapon' then
		if #args==0 then return end
    if getElementType(args[1]) == 'player' then
		SetWeapon(args[1])
		end
    end
end	
    addDebugHook('preFunction', GHook)

 

Link to comment
20 hours ago, Master_MTA said:

function GHook(sourceResource, functionName, isAllowedByACL, luaFilename, luaLineNumber, ...)
		local args = {...}
		outputChatBox("!")
  	if functionName=='giveWeapon' or functionName=='setWeaponAmmo' or functionName=='takeWeapon' then
		if #args==0 then return end
    if getElementType(args[1]) == 'player' then
		SetWeapon(args[1])
		end
    end
end	
    addDebugHook('preFunction', GHook)

 

م تحس كذا بيسبب لاق؟

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