Jump to content

Need help-ACL


manve1

Recommended Posts

hey guys, how could i make this script only work for admins? i have tryied using wiki and from other scripts, but it didn't help :( please help me

addCommandHandler("getguard", function(p) 
    if(ablauf[p] == true) then return end 
    ablauf[p] = true 
    local x, y, z = getElementPosition(p) 
    ped[p] = createPed(164, x, y+1, z) 
    setElementData(ped[p], "besitzer", getPlayerName(p)) 
    setElementData(ped[p], "bodyguard", true) 
    giveWeapon(ped[p], 25, 99999, true) 
    setPedStat (ped[p], 72, 999) 
    addEventHandler("onPedWasted", ped[p], function() 
        local ped = source 
        setTimer(destroyElement, 1000, 1, ped) 
        ablauf[p] = false 
         
    end) 
end)  

thanx for any help.

Link to comment
addCommandHandler("getguard", function(p) 
if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( p ) ), aclGetGroup ( "Admin" ) ) then 
    if(ablauf[p] == true) then return end 
    ablauf[p] = true 
    local x, y, z = getElementPosition(p) 
    ped[p] = createPed(164, x, y+1, z) 
    setElementData(ped[p], "besitzer", getPlayerName(p)) 
    setElementData(ped[p], "bodyguard", true) 
    giveWeapon(ped[p], 25, 99999, true) 
    setPedStat (ped[p], 72, 999) 
    addEventHandler("onPedWasted", ped[p], function() 
        local ped = source 
        setTimer(destroyElement, 1000, 1, ped) 
        ablauf[p] = false 
        
    end) 
  end 
end) 

Link to comment
addCommandHandler("getguard", function(p) 
if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( p ) ), aclGetGroup ( "Admin" ) ) then 
    if(ablauf[p] == true) then return end 
    ablauf[p] = true 
    local x, y, z = getElementPosition(p) 
    ped[p] = createPed(164, x, y+1, z) 
    setElementData(ped[p], "besitzer", getPlayerName(p)) 
    setElementData(ped[p], "bodyguard", true) 
    giveWeapon(ped[p], 25, 99999, true) 
    setPedStat (ped[p], 72, 999) 
    addEventHandler("onPedWasted", ped[p], function() 
        local ped = source 
        setTimer(destroyElement, 1000, 1, ped) 
        ablauf[p] = false 
        
    end) 
  end 
end) 

dont work :(

Link to comment
addCommandHandler("getguard", function(p) 
   local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then  
    if(ablauf[p] == true) then return end 
    ablauf[p] = true 
    local x, y, z = getElementPosition(p) 
    ped[p] = createPed(164, x, y+1, z) 
    setElementData(ped[p], "besitzer", getPlayerName(p)) 
    setElementData(ped[p], "bodyguard", true) 
    giveWeapon(ped[p], 25, 99999, true) 
    setPedStat (ped[p], 72, 999) 
    addEventHandler("onPedWasted", ped[p], function() 
        local ped = source 
        setTimer(destroyElement, 1000, 1, ped) 
        ablauf[p] = false 
        
    end) 
end) 

Link to comment
addCommandHandler("getguard", function(p) 
   local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) -- get his account name 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then  
    if(ablauf[p] == true) then return end 
    ablauf[p] = true 
    local x, y, z = getElementPosition(p) 
    ped[p] = createPed(164, x, y+1, z) 
    setElementData(ped[p], "besitzer", getPlayerName(p)) 
    setElementData(ped[p], "bodyguard", true) 
    giveWeapon(ped[p], 25, 99999, true) 
    setPedStat (ped[p], 72, 999) 
    addEventHandler("onPedWasted", ped[p], function() 
        local ped = source 
        setTimer(destroyElement, 1000, 1, ped) 
        ablauf[p] = false 
        
    end) 
end) 

this dont work too :( and the script is server sided.

Link to comment

Try this

ablauf = {} 
ped = {} 
  
addCommandHandler("getguard", function(p) 
if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( p ) ), aclGetGroup ( "Admin" ) ) then 
    if(ablauf[p] == true) then return end 
    ablauf[p] = true 
    local x, y, z = getElementPosition(p) 
    ped[p] = createPed(164, x, y+1, z) 
    setElementData(ped[p], "besitzer", getPlayerName(p)) 
    setElementData(ped[p], "bodyguard", true) 
    giveWeapon(ped[p], 25, 99999, true) 
    setPedStat (ped[p], 72, 999) 
    addEventHandler("onPedWasted", ped[p], function() 
        local ped = source 
        setTimer(destroyElement, 1000, 1, ped) 
        ablauf[p] = false 
  
    end) 
  end 
end) 

Link to comment
Try this
ablauf = {} 
ped = {} 
  
addCommandHandler("getguard", function(p) 
if isObjectInACLGroup ( "user." ..getAccountName ( getPlayerAccount ( p ) ), aclGetGroup ( "Admin" ) ) then 
    if(ablauf[p] == true) then return end 
    ablauf[p] = true 
    local x, y, z = getElementPosition(p) 
    ped[p] = createPed(164, x, y+1, z) 
    setElementData(ped[p], "besitzer", getPlayerName(p)) 
    setElementData(ped[p], "bodyguard", true) 
    giveWeapon(ped[p], 25, 99999, true) 
    setPedStat (ped[p], 72, 999) 
    addEventHandler("onPedWasted", ped[p], function() 
        local ped = source 
        setTimer(destroyElement, 1000, 1, ped) 
        ablauf[p] = false 
  
    end) 
  end 
end) 

it works, thx

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...