manve1 Posted August 21, 2012 Posted August 21, 2012 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. Looking for tutorials or information? check out: www.simpleask.co.uk
Vision Posted August 21, 2012 Posted August 21, 2012 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)
manve1 Posted August 21, 2012 Author Posted August 21, 2012 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 Looking for tutorials or information? check out: www.simpleask.co.uk
Perfect Posted August 21, 2012 Posted August 21, 2012 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) Multi Theft Auto Player since middle of 2011. Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.
manve1 Posted August 21, 2012 Author Posted August 21, 2012 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. Looking for tutorials or information? check out: www.simpleask.co.uk
sockz Posted August 21, 2012 Posted August 21, 2012 syntax errors and the player argument is p, not thePlayer
manve1 Posted August 21, 2012 Author Posted August 21, 2012 can you stop arguing and give me how it should be and should work with? here is debug: http://i.imgur.com/KsJmw.jpg Looking for tutorials or information? check out: www.simpleask.co.uk
Vision Posted August 21, 2012 Posted August 21, 2012 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)
manve1 Posted August 21, 2012 Author Posted August 21, 2012 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 Looking for tutorials or information? check out: www.simpleask.co.uk
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