nasserdfdd Posted August 13, 2015 Share Posted August 13, 2015 hi all so i have this script toe change veh mod for admin buti get error server function permission (source) local accName = getAccountName ( getPlayerAccount ( source ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then end end addEvent("check",true) addEventHandler("check",root,permission) client function enterveh () triggerServerEvent("check",localPlayer) txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) end addEventHandler ( "onClientPlayerVehicleEnter", getRootElement(), enterveh ) it give me Error:test\server.lus:3: attemept to concatentate local 'accname'(a boolean value) Link to comment
KariiiM Posted August 13, 2015 Share Posted August 13, 2015 addEvent("check",true) addEventHandler("check",root, function (thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer )) if isObjectInACLGroup ( "user."..accName, aclGetGroup ( "Admin" ) ) then end end) Link to comment
nasserdfdd Posted August 13, 2015 Author Share Posted August 13, 2015 does not have error and the shader does not change Link to comment
xeon17 Posted August 13, 2015 Share Posted August 13, 2015 -- Server local acls = {"Console", "Admin"} addEventHandler('onVehicleEnter', root, function (thePlayer) if not (isAllowedPlayer(thePlayer)) then return end triggerClientEvent(thePlayer,'replaceMod',thePlayer) end) -- Utils functions function isAllowedPlayer(player) local account = getPlayerAccount(player) if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) for i, v in pairs (acls) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup (v))) then return true end end return false end -- Client side addEvent("replaceMod",true) addEventHandler("replaceMod", root, function() txd = engineLoadTXD("infernus.txd", 411 ) engineImportTXD(txd, 411) dff = engineLoadDFF("infernus.dff", 411 ) engineReplaceModel(dff, 411) end) 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