isa_Khamdan Posted August 4, 2013 Share Posted August 4, 2013 ok I have a panel and I want it to be visible for people in police group only so I made this code but when I tested it it didn't work the panel can be opened by anyone have the access to the admin panel [lua]addEventHandler("onPlayerLogin",root, function (_,acc) if isObjectInACLGroup("user." .. getAccountName(acc),aclGetGroup("Police")) then outputChatBox("* Press n To Open Police Panel",source,255,255,255,true) end end ) [/lua] Link to comment
Castillo Posted August 4, 2013 Share Posted August 4, 2013 That code is not the problem, post the whole script. Link to comment
isa_Khamdan Posted August 4, 2013 Author Share Posted August 4, 2013 (edited) That code is not the problem, post the whole script. ---Server Side addEventHandler("onPlayerLogin",root, function (_,acc) if isObjectInACLGroup("user." .. getAccountName(acc),aclGetGroup("Police")) then outputChatBox("* Welcome Admin Man Press n To Open Admin Panel",source,255,255,255,true) end end ) addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( toWho ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("* Your vehicle has been destroyed by ".. name .."", toWho, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) --------------- addEvent("slap", true) function slap( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) data = 100 if ( getElementHealth ( toWho ) > 0 ) and ( not isPedDead ( toWho ) ) then if ( tonumber ( data ) > getElementHealth ( toWho ) ) then setTimer ( killPed, 50, 1, toWho ) else setElementHealth ( toWho, getElementHealth ( toWho ) - data ) end local x, y, z = getElementVelocity ( toWho ) setElementVelocity ( toWho, x , y, z + 0.2 ) outputChatBox("* [ #ffff00".. PlayerNick .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" .. name .."#ff0000 ]", root, 255, 0, 0, true ) end end addEventHandler("slap", getRootElement(),slap) ------------------ function loggedOut ( ) triggerClientEvent ( source, "police", source, false ) end addEventHandler( "onPlayerLogout", getRootElement(), loggedOut ) function polstart ( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if ( hasObjectPermissionTo ( player, "function.kickPlayer", false ) ) then triggerClientEvent ( player, "police", player, true ) end end addEvent( "polstart", true ) addEventHandler( "polstart", getRootElement(), polstart ) function onPlayerLogin ( ) polstart ( source ) end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin ) Edited August 4, 2013 by Guest Link to comment
Castillo Posted August 4, 2013 Share Posted August 4, 2013 addEventHandler("onPlayerLogin",root, function (_,acc) if isObjectInACLGroup("user." .. getAccountName(acc),aclGetGroup("Police")) then outputChatBox("* Welcome Admin Man Press n To Open Admin Panel",source,255,255,255,true) end end ) addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( toWho ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("* Your vehicle has been destroyed by ".. name .."", toWho, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) --------------- addEvent("slap", true) function slap( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) data = 100 if ( getElementHealth ( toWho ) > 0 ) and ( not isPedDead ( toWho ) ) then if ( tonumber ( data ) > getElementHealth ( toWho ) ) then setTimer ( killPed, 50, 1, toWho ) else setElementHealth ( toWho, getElementHealth ( toWho ) - data ) end local x, y, z = getElementVelocity ( toWho ) setElementVelocity ( toWho, x , y, z + 0.2 ) outputChatBox("* [ #ffff00".. PlayerNick .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" .. name .."#ff0000 ]", root, 255, 0, 0, true ) end end addEventHandler("slap", getRootElement(),slap) ------------------ function loggedOut ( ) triggerClientEvent ( source, "police", source, false ) end addEventHandler( "onPlayerLogout", getRootElement(), loggedOut ) function polstart ( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup("user." .. accName, aclGetGroup("Police")) then triggerClientEvent ( player, "police", player, true ) end end addEvent( "polstart", true ) addEventHandler( "polstart", getRootElement(), polstart ) function onPlayerLogin ( ) polstart ( source ) end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin ) Link to comment
isa_Khamdan Posted August 4, 2013 Author Share Posted August 4, 2013 addEventHandler("onPlayerLogin",root, function (_,acc) if isObjectInACLGroup("user." .. getAccountName(acc),aclGetGroup("Police")) then outputChatBox("* Welcome Admin Man Press n To Open Admin Panel",source,255,255,255,true) end end ) addEvent( "destroy", true) ----destroy car addEventHandler( "destroy", getRootElement(), function ( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) local theVehicle = getPedOccupiedVehicle ( toWho ) if ( isElement(theVehicle) ) then destroyElement ( theVehicle ) outputChatBox("* Your vehicle has been destroyed by ".. name .."", toWho, 255, 0, 0, true ) else outputChatBox("* he don't have a car !!", source, 255, 0, 0, true ) end end ) --------------- addEvent("slap", true) function slap( PlayerNick ) local toWho = getPlayerFromName ( PlayerNick ) local name = getPlayerName ( source ) data = 100 if ( getElementHealth ( toWho ) > 0 ) and ( not isPedDead ( toWho ) ) then if ( tonumber ( data ) > getElementHealth ( toWho ) ) then setTimer ( killPed, 50, 1, toWho ) else setElementHealth ( toWho, getElementHealth ( toWho ) - data ) end local x, y, z = getElementVelocity ( toWho ) setElementVelocity ( toWho, x , y, z + 0.2 ) outputChatBox("* [ #ffff00".. PlayerNick .."#ff0000 ] #999999 has been slapped by#ff0000 [ #ffff00" .. name .."#ff0000 ]", root, 255, 0, 0, true ) end end addEventHandler("slap", getRootElement(),slap) ------------------ function loggedOut ( ) triggerClientEvent ( source, "police", source, false ) end addEventHandler( "onPlayerLogout", getRootElement(), loggedOut ) function polstart ( player ) local accName = getAccountName ( getPlayerAccount ( player ) ) if isObjectInACLGroup("user." .. accName, aclGetGroup("Police")) then triggerClientEvent ( player, "police", player, true ) end end addEvent( "polstart", true ) addEventHandler( "polstart", getRootElement(), polstart ) function onPlayerLogin ( ) polstart ( source ) end addEventHandler("onPlayerLogin", getRootElement(), onPlayerLogin ) Thanks for your help 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