Guest Posted July 14, 2018 Share Posted July 14, 2018 Guys i have made this code to make non vips players can't enter hydra vipVehicles = { [520]=true } local cuenta = getAccountName( getPlayerAccount(thePlayer) ) if isObjectInACLGroup("user."..cuenta, aclGetGroup("VIP")) then --Group VIP spaces(thePlayer) function onVehicleStartEnter ( enteringPlayer, seat, jacked, door ) outputChatBox ( "● You must be vip to enter this vehicle", thePlayer, 0, 255, 0 ) -- and tell the player why end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onVehicleStartEnter ) What is wrong with it ? Link to comment
Galactix Posted July 14, 2018 Share Posted July 14, 2018 vipVehicles = { [520]=true } function onVehicleStartEnter ( enteringPlayer, seat, jacked, door ) local cuenta = getAccountName( getPlayerAccount(thePlayer) ) if isObjectInACLGroup("user."..cuenta, aclGetGroup("VIP")) then --Group VIP spaces(thePlayer) else outputChatBox ( "● You must be vip to enter this vehicle", thePlayer, 0, 255, 0 ) -- and tell the player why end end addEventHandler ( "onVehicleStartEnter", getRootElement(), onVehicleStartEnter ) I Don't understand the spaces part though, could you explain what is its purpose? Link to comment
Guest Posted July 14, 2018 Share Posted July 14, 2018 (edited) Thanks you but you forgot to change local cuenta = getAccountName( getPlayerAccount(thePlayer) ) to enteringPlayer Btw wan't to ask you meta was like this " client " , did not work <meta> <script src="client.lua" type="client" /> </meta> So when i changed it to server.lua and type="client" worked how can i know that file is client or server and when i must create 2 files ( client + server ) Edited July 14, 2018 by Guest Link to comment
Manticore Posted July 14, 2018 Share Posted July 14, 2018 <meta> <script src="client.lua" type="server" /> </meta> Try this. Btw, All you need. Just replace type="client" with type="server" Link to comment
Guest Posted July 14, 2018 Share Posted July 14, 2018 yes i did that , i'm just asking how i can know its client or server Link to comment
Galactix Posted July 14, 2018 Share Posted July 14, 2018 (edited) Just change thePlayer to source in your getPlayerAccount variable A client script is what is executed on the player's computer directly, not on the server. A client script doesn't use variables like thePlayer and such because everything is source related in general. Edited July 14, 2018 by Galactix 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