Duff1995 Posted August 23, 2022 Share Posted August 23, 2022 function onInventory(source) if not isGuestAccount(getPlayerAccount(source)) then triggerClientEvent(source, "N3xT.onOpenInventory", source) else messageS(source, "Você precisa estar logado para abrir o inventário!", "error") end end function onResStart() for index, player in ipairs(getElementsByType("player")) do bindKey(player, config.bind, "down", onInventory) if not isGuestAccount(getPlayerAccount(player)) then local acc = getAccountName(getPlayerAccount(player)) loadItens(player, acc) end end end addEventHandler("onResourceStart", resourceRoot, onResStart) function onPlayerJoin() bindKey(source, config.bind, "down", onInventory) end addEventHandler("onPlayerJoin", getRootElement(), onPlayerJoin) function cleanAll() for index, player in ipairs(getElementsByType("player")) do unbindKey(player, config.bind, "down", onInventory) bindKey ( player, "F1", "down", onInventory ) end end addEventHandler("onResourceStop", resourceRoot, cleanAll) Link to comment
#\_oskar_/# Posted August 23, 2022 Share Posted August 23, 2022 the code is a server, not a client 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