LucasBaker Posted October 31, 2014 Share Posted October 31, 2014 function freezar(M, _, T) local x1, y1 = getElementPosition(M) for _,Pl in ipairs(getElementsByType("player")) do local x2, y2 = getElementPosition(Pl) local Distance = getDistanceBetweenPoints2D(x1, y1, x2, y2) if (Distance <= 30) then if not ( isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then -- pra não congela os adm toggleAllControls ( Pl, false ) setElementFrozen ( Pl, true ) outputChatBox("#00FFFF[EVENTO] Você foi congelado", Pl, 0, 255, 0, true) end end end end addCommandHandler("congelar", freezar) What I want the function to work for All Less admins but the error value Link to comment
Castillo Posted October 31, 2014 Share Posted October 31, 2014 The error is here: if ( not isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then You aren't obtaining his account name, just the account userdata, you have to use getAccountName: if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( Pl ) ), aclGetGroup ( "Admin" ) ) ) then Link to comment
LucasBaker Posted October 31, 2014 Author Share Posted October 31, 2014 The error is here: if ( not isObjectInACLGroup ( "user.".. getPlayerAccount(Pl), aclGetGroup ( "Admin" ) ) ) then You aren't obtaining his account name, just the account userdata, you have to use getAccountName: if ( not isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( Pl ) ), aclGetGroup ( "Admin" ) ) ) then thx 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