Jump to content

[Help] Problem with ACL script


Recommended Posts

Posted

Hi everybody. When someone type /add [account] this command add an account to a group on ACL. I want to make this command just to a certain group on ACL. Could someone help me? I tried but did not succeed.

Script working but everybody can type /add [account]

function dartag (source, commandName, accountName) 
if accountName then 
  aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) 
  outputChatBox ("Voce adicionou "..accountName.." com sucesso na sua TAG", source, 255,255,255, true) 
  else 
  outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", source, 255,255,255, true) 
end 
end 
addCommandHandler ("add", dartag) 
  
function removetag (source, commandName, accountName) 
if accountName then 
aclGroupRemoveObject (aclGetGroup("grid"), "user."..accountName) 
outputChatBox ("Voce removeu "..accountName.." com sucesso da sua TAG", source, 255,255,255, true) 
else 
outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /rm [login]", source, 255,255,255, true) 
end 
end 
addCommandHandler ("rm", removetag) 

Script that i modified but everyone that write /add [account] get error "#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]" (Jump to Else)

local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
function dartag (source, commandName, accountName) 
  
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "grid" ) ) then 
  aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) 
  outputChatBox ("Voce adicionou "..accountName.." com sucesso na sua TAG", source, 255,255,255, true) 
  else 
  outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", source, 255,255,255, true) 
end 
end 
addCommandHandler ("add", dartag) 
  
function removetag (source, commandName, accountName) 
  
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "grid" ) ) then 
aclGroupRemoveObject (aclGetGroup("grid"), "user."..accountName) 
outputChatBox ("Voce removeu "..accountName.." com sucesso da sua TAG", source, 255,255,255, true) 
else 
outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /rm [login]", source, 255,255,255, true) 
end 
end 
addCommandHandler ("rm", removetag) 

Posted

what's the error in debugscript 3? edit: try , if there are errors tell us.

function dartag (player, commandName, accountName) 
 local accountName = getAccountName ( getPlayerAccount ( player ) ) 
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then 
  aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) 
  outputChatBox ("Voce adicionou "..accountName.." com sucesso na sua TAG", player, 255,255,255, true) 
  else 
  outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", player, 255,255,255, true) 
end 
end 
addCommandHandler ("add", dartag) 
  
function removetag (player, commandName, accountName) 
  local accountName = getAccountName ( getPlayerAccount ( player ) ) 
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then 
aclGroupRemoveObject (aclGetGroup("grid"), "user."..accountName) 
outputChatBox ("Voce removeu "..accountName.." com sucesso da sua TAG", player, 255,255,255, true) 
else 
outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /rm [login]", player, 255,255,255, true) 
end 
end 
addCommandHandler ("rm", removetag) 

Posted
what's the error in debugscript 3? edit: try , if there are errors tell us.
function dartag (player, commandName, accountName) 
 local accountName = getAccountName ( getPlayerAccount ( player ) ) 
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then 
  aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) 
  outputChatBox ("Voce adicionou "..accountName.." com sucesso na sua TAG", player, 255,255,255, true) 
  else 
  outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", player, 255,255,255, true) 
end 
end 
addCommandHandler ("add", dartag) 
  
function removetag (player, commandName, accountName) 
  local accountName = getAccountName ( getPlayerAccount ( player ) ) 
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then 
aclGroupRemoveObject (aclGetGroup("grid"), "user."..accountName) 
outputChatBox ("Voce removeu "..accountName.." com sucesso da sua TAG", player, 255,255,255, true) 
else 
outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /rm [login]", player, 255,255,255, true) 
end 
end 
addCommandHandler ("rm", removetag) 

Nothing on debugscript 3 and its not working :/

Posted
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then 
  aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) 

this one doesn't make sense, if you are in ACL Group "grid" then why are u gonna add yourself again to the acl "grid"? what exactly do u want to do?

of course it would give them this error:

outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", player, 255,255,255, true) 

if they are not in the ACL gridl

Posted
if isObjectInACLGroup ("user."..accountName, aclGetGroup ( "grid" ) ) then 
  aclGroupAddObject (aclGetGroup("grid"), "user."..accountName) 

this one doesn't make sense, if you are in ACL Group "grid" then why are u gonna add yourself again to the acl "grid"? what exactly do u want to do?

of course it would give them this error:

outputChatBox ("#FF0000[ERRO]#FFFFFF Maneira correta de usar /add [login]", player, 255,255,255, true) 

if they are not in the ACL gridl

Its a script to give TAG. If someone in this gang (grid) want to give someone tag of (grid) just type /add (login)

Posted

make sure that the player is in ACL grid before u do /add because if he is not in the ACL Grid he would give the error of course that's why there is "ELSE"

Posted
make sure that the player is in ACL grid before u do /add because if he is not in the ACL Grid he would give the error of course that's why there is "ELSE"

The problem is because player is already in acl grid and cant add anyone because keeps going to else.

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...