Hello!
I would like to create that only group pilot and admins rangs on server can enter vehicles.
My lua doesn't work, please help me
local function Vehicle_enter_exit(ply,ent)--If the player is an admin, and the entity is a door or a player,
local whitelisted_groups = {
"admin",
"superadmin"
"pilot"
}
if ply:IsPlayer() and ply:EnterVehicle() thenreturnfalse
elseif return table.HasValue(whitelisted_groups, ply:GetUserGroup())
end
hook.Add("Vehicle", "disallowplayercanentervehicle", Vehicle_enter_exit)
https://en.wikipedia.org/wiki/Rubber_duck_debugging
Explain what IsPlayer does
They are doing lua haha i don't know, i am really bad with lua
You are using EnterVehicle incorrectly.
Player/EnterVehicle
READ WHAT IT DOES.
can you help me? I can't do that
m8 you need to read and try yourself. You wont get the fully working code here for free
local jeep = ply:GetEyeTrace().Entity
local whitelisted_groups = {
"admin",
"superadmin"
"pilot"
}
if ply:IsPlayer() and Player:EnterVehicle( Vehicle vehicle ) thenreturnfalse
elseif return table.HasValue(whitelisted_groups, ply:GetUserGroup())
end
hook.Add("Vehicle", "disallowplayercanentervehicle", Vehicle_enter_exit)
ok here you go
Oh my god! Thank you very much @diff360 !!! You are my god!!
Sorry, you need to Log In to post a reply to this thread.