Toffbrown Posted December 16, 2013 Share Posted December 16, 2013 is it possible to have a little area were the admins,smods,mods can only access and a regular player gets killed and respawned into another locations? because i have made a staff base but i don't know how to restrict it from players Link to comment
Castillo Posted December 16, 2013 Share Posted December 16, 2013 You can create a colshape around it, and when a player goes in, check if is a staff member, if not, kill him. Functions: createColRectangle getPlayerAccount getAccountName aclGetGroup isObjectInACLGroup killPed Event: onColShapeHit Link to comment
Toffbrown Posted December 16, 2013 Author Share Posted December 16, 2013 Like this? local groupName = "Admin" local x, y, z = 0, 0, 0 local colShape = createColRectangle ( 2160.93921, 2160.93921, 10000, 10000 ) addEventHandler("onColShapeHit",root,function ( element ) addEventHandler ( "onColShapeHit", colShape, function ( theElm ) if ( getElementType ( theElm ) == "player" ) and isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( hitPlayer ) ), aclGetGroup ( "Admin" ) ) then elseif function commitSuicide ( sourcePlayer ) killPed ( sourcePlayer, sourcePlayer ) end local spawnX, spawnY, spawnZ = -2026.17480, 156.90236, 29.03906 spawnPlayer(source, spawnX, spawnY, spawnZ) fadeCamera(source, true) setCameraTarget(source, source) outputChatBox("Do Not Enter the JJ's Staff Base", source)s end addEventHandler("onPlayerJoin", getRootElement(), joinHandler) end Link to comment
Castillo Posted December 16, 2013 Share Posted December 16, 2013 That doesn't make any sense. Link to comment
[M]ister Posted December 16, 2013 Share Posted December 16, 2013 Does it work? local groupName = "Admin" local colShape = createColRectangle ( 2160.93921, 2160.93921, 10000, 10000 ) function colShapeEnter() local accountname = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup (groupName)) then outputChatBox ("You entered the base admin",source) else outputChatBox ("You are not admin, to enter this base",source) killPed ( source ) end end addEventHandler ( "onColShapeHit", colShape, colShapeEnter ) Link to comment
Castillo Posted December 16, 2013 Share Posted December 16, 2013 "thePlayer" is not defined and "source" is the colshape. Link to comment
[M]ister Posted December 16, 2013 Share Posted December 16, 2013 And now? local groupName = "Admin" local colShape = createColRectangle ( 2160.93921, 2160.93921, 10000, 10000 ) function colShapeEnter(thePlayer) local accountname = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup (groupName)) then outputChatBox ("You entered the base admin",thePlayer) else outputChatBox ("You are not admin, to enter this base",thePlayer) killPed ( thePlayer ) end end addEventHandler ( "onColShapeHit", colShape, colShapeEnter ) Link to comment
[M]ister Posted December 16, 2013 Share Posted December 16, 2013 local groupName = "Admin" local colShape = createColRectangle ( 2160.93921, 2160.93921, 10000, 10000 ) function colShapeEnter(thePlayer) local accountname = getAccountName (getPlayerAccount(thePlayer)) if isObjectInACLGroup ( "user." .. accountname, aclGetGroup (groupName)) then outputChatBox ("You entered the base admin",thePlayer) else outputChatBox ("You are not admin, to enter this base",thePlayer) killPed ( thePlayer ) end end addEventHandler ( "onColShapeHit", colShape, colShapeEnter ) Here is ToffBrown. Thanks Solid Link to comment
Toffbrown Posted December 16, 2013 Author Share Posted December 16, 2013 Wow thanks heaps Malignos and Solid snake 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