#Major . Posted November 28, 2018 Share Posted November 28, 2018 (edited) -- Server 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'}) Why does the code not work on the { giveWeapon, setWeaponAmmo, takeWeapon } function, but it works on other functions Edited November 28, 2018 by *RayaN-Alharbi. Link to comment
savour Posted November 29, 2018 Share Posted November 29, 2018 from what i see it should work, but after putting it in the notepad++ i noticed some weird font in the addDebugScript line, you added some Arabic symbols in that line before the quotes- ' - which is considered as "Unicode" symbols, can't be used in LUA outside the string quotes so you will need to re-write that line, try this: addDebugHook('postFunction', GHook, {'giveWeapon','setWeaponAmmo','takeWeapon'}) even when you paste it here in the "Code" insertion you will notice it as a huge dot or something, however you will need also to remove any writing decorators you recently added and so. also you can check for the Unicode characters with this website https://apps.timwhitlock.info/unicode/inspect Link to comment
#Major . Posted November 30, 2018 Author Share Posted November 30, 2018 8 hours ago, savour said: from what i see it should work, but after putting it in the notepad++ i noticed some weird font in the addDebugScript line, you added some Arabic symbols in that line before the quotes- ' - which is considered as "Unicode" symbols, can't be used in LUA outside the string quotes so you will need to re-write that line, try this: addDebugHook('postFunction', GHook, {'giveWeapon','setWeaponAmmo','takeWeapon'}) even when you paste it here in the "Code" insertion you will notice it as a huge dot or something, however you will need also to remove any writing decorators you recently added and so. also you can check for the Unicode characters with this website https://apps.timwhitlock.info/unicode/inspect Actually I did not understand you well but this code works well with other functions like getPlayerSerial or getPedTotalAmmo but it does not work with previous functions Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now