ertlflorian1 Posted January 29, 2013 Share Posted January 29, 2013 Why it dont work? function check (thePlayer) pname = getPlayerName (thePlayer) name = getPlayerFromName (thePlayer) if (pname ~= "#00ff22Ertl") then kickPlayer (name, "ka!") end end addEventHandler("onPlayerConnect", getRootElement(), check) Error : [19:06:09] WARNING: sicher\server.lua:2: Bad argument @ 'getPlayerName' [Expected element at argument 1, got string 'Ertl'] Ressource is in the ACL Admin! Link to comment
Jullul7000 Posted January 29, 2013 Share Posted January 29, 2013 Why it dont work? function check (thePlayer) pname = getPlayerName (thePlayer) name = getPlayerFromName (thePlayer) if (pname ~= "#00ff22Ertl") then kickPlayer (name, "ka!") end end addEventHandler("onPlayerConnect", getRootElement(), check) Error : [19:06:09] WARNING: sicher\server.lua:2: Bad argument @ 'getPlayerName' [Expected element at argument 1, got string 'Ertl'] Ressource is in the ACL Admin! Same error. Link to comment
Castillo Posted January 29, 2013 Share Posted January 29, 2013 function check ( pname ) if ( pname ~= "#00ff22Ertl") then cancelEvent ( true, "ka!" ) end end addEventHandler ( "onPlayerConnect", getRootElement(), check ) Try that instead. Link to comment
Kenix Posted January 29, 2013 Share Posted January 29, 2013 Why it dont work? function check (thePlayer) pname = getPlayerName (thePlayer) name = getPlayerFromName (thePlayer) if (pname ~= "#00ff22Ertl") then kickPlayer (name, "ka!") end end addEventHandler("onPlayerConnect", getRootElement(), check) Error : [19:06:09] WARNING: sicher\server.lua:2: Bad argument @ 'getPlayerName' [Expected element at argument 1, got string 'Ertl'] Ressource is in the ACL Admin! Variable thePlayer is string, not element ( userdata ). You are doing nonsense. Read wiki more better please before post something. 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