Jump to content

Why not working aclGroupRemove and AddObject?


Turbe$Z

Recommended Posts

--server--

function kivesz()
local accountName = getPlayerAccount(source)
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" )) then 
	aclGroupRemoveObject(aclGetGroup("Admin"), "user."..accountName)
	end
end
addCommandHandler("rangki", kivesz)

function betesz()
local accountName = getPlayerAccount(source)
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" )) then 
	aclGroupAddObject (aclGetGroup("Admin1"), "user."..accountName)
	end
end
addCommandHandler("rangbe", betesz)

and i got this errors and warnings: http://imgur.com/a/tI7mJ
how to fix this?

Link to comment
  • Moderators
11 minutes ago, Mr.Loki said:

so it should be:

function kivesz (player, command)

close but it should be :
function kivesz (source, command)

EDIT: and as we don't use 'command' neither additional parameters we can shorten it to:
function kivesz (source)

Edited by Citizen
Link to comment
11 minutes ago, Mr.Loki said:
11 minutes ago, Mr.Loki said:

addCommandHandler (server) has 2 main parameters



player playerSource, string commandName, [string arg1, string arg2, ...] 

so it should be:

function kivesz (player, command)

then you can use player for your functions instead of source or can just change player to source in the function parameters.

addCommandHandler (server) has 2 main parameters


 
  1. player playerSource, string commandName, [string arg1, string arg2, ...]

so it should be:

function kivesz (player, command)

then you can use player for your functions instead of source or can just change player to source in the function parameters.

attempt to concatenate local 'accountName' (a userdata value) :S

Link to comment
15 minutes ago, Mr.Loki said:
15 minutes ago, Mr.Loki said:
1 minute ago, Mr.Loki said:

Post your current code.

addCommandHandler (server) has 2 main parameters



 
  1. player playerSource, string commandName, [string arg1, string arg2, ...]

so it should be:

function kivesz (player, command)

then you can use player for your functions instead of source or can just change player to source in the function parameters.

addCommandHandler (server) has 2 main parameters


 
  1. player playerSource, string commandName, [string arg1, string arg2, ...]

so it should be:

function kivesz (player, command)

then you can use player for your functions instead of source or can just change player to source in the function parameters

function kivesz(player, command)
local accountName = getPlayerAccount(player)
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin" )) then 
	aclGroupRemoveObject(aclGetGroup("Admin"), "user."..accountName)
	end
end
addCommandHandler("rangki", kivesz)

function betesz(player, command)
local accountName = getPlayerAccount(player)
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( player ) ), aclGetGroup ( "Admin1" )) then 
	aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName)
	end
end
addCommandHandler("rangbe", betesz)

 

Link to comment

 

function kivesz(player, command)
local accountName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" )) then 
	aclGroupRemoveObject(aclGetGroup("Admin"), "user."..accountName)
	end
end
addCommandHandler("rangki", kivesz)

function betesz(player, command)
local accountName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin1" )) then 
	aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName)
	end
end
addCommandHandler("rangbe", betesz)
  • Like 1
Link to comment
22 minutes ago, Mr.Loki said:
22 minutes ago, Mr.Loki said:
1 minute ago, Mr.Loki said:

 




function kivesz(player, command)
local accountName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" )) then 
	aclGroupRemoveObject(aclGetGroup("Admin"), "user."..accountName)
	end
end
addCommandHandler("rangki", kivesz)

function betesz(player, command)
local accountName = getAccountName ( getPlayerAccount ( player ) )
if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin1" )) then 
	aclGroupAddObject (aclGetGroup("Admin"), "user."..accountName)
	end
end
addCommandHandler("rangbe", betesz)

addCommandHandler (server) has 2 main parameters



player playerSource, string commandName, [string arg1, string arg2, ...] 

so it should be:

function kivesz (player, command)

then you can use player for your functions instead of source or can just change player to source in the function parameters.

addCommandHandler (server) has 2 main parameters


 
  1. player playerSource, string commandName, [string arg1, string arg2, ...]

so it should be:

function kivesz (player, command)

then you can use player for your functions instead of source or can just change player to source in the function parameters.

Thanks :D

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