hank Posted January 27, 2012 Share Posted January 27, 2012 I'm having trouble, see if this code is right. function kickPlayerHandler (kickedname) if (kickedname ~= nil) then local kicked = getPlayerFromName(kickedname) kickPlayer (kicked) else outputChatBox("Error.: /kick ") end --end end addCommandHandler("kick",kickPlayerHandler) awaiting response. Link to comment
Scooby Posted January 27, 2012 Share Posted January 27, 2012 just ur parameters are wrong, it should be: function kickPlayerHandler (playerSource,commandName, kickedname) have a read: https://wiki.multitheftauto.com/wiki/AddCommandHandler for more info also u should check the player 'kicked' exists after u get it from kickedname or u will get an error if a player types /kick bob and bob doesnt exist. Link to comment
TAPL Posted January 27, 2012 Share Posted January 27, 2012 function kickPlayerHandler (player,cmd,kickedname) if (kickedname) then local kicked = getPlayerFromName(kickedname) if (kicked) then kickPlayer(kicked) else outputChatBox("Error.: Player name not exist",player) end else outputChatBox("Error.: /kick ",player) end end addCommandHandler("kick",kickPlayerHandler) Link to comment
Klesh Posted January 27, 2012 Share Posted January 27, 2012 function kickPlayerHandler (player,cmd,kickedname) if not (kickedname) then local kicked = getPlayerFromName(kickedname) if (kicked) then kickPlayer(kicked) else outputChatBox("Error.: Player name not exist",player) end else outputChatBox("Error.: /kick ",player) end end addCommandHandler("kick",kickPlayerHandler) Link to comment
BriGhtx3 Posted January 27, 2012 Share Posted January 27, 2012 function kickPlayerHandler (player,cmd,kickedname) if not (kickedname) then local kicked = getPlayerFromName(kickedname) if (kicked) then kickPlayer(kicked) else outputChatBox("Error.: Player name not exist",player) end else outputChatBox("Error.: /kick ",player) end end addCommandHandler("kick",kickPlayerHandler) function kickPlayerHandler (player,cmd,kickedname) if (kickedname) then local kicked = getPlayerFromName(kickedname) if (kicked) then kickPlayer(kicked) else outputChatBox("Error.: Player name not exist",player) end else outputChatBox("Error.: /kick ",player) end end addCommandHandler("kick",kickPlayerHandler) Remove the not Link to comment
hank Posted January 27, 2012 Author Share Posted January 27, 2012 I want to kick myself. How do I?I put / kick Douglas Douglas and nothing happens. Link to comment
Klesh Posted January 27, 2012 Share Posted January 27, 2012 That's completely useless, you can kick once if you are in Admin group, if you dont know how to set it go to https://wiki.multitheftauto.com/wiki/ACL, you dont need to script that. Link to comment
hank Posted January 27, 2012 Author Share Posted January 27, 2012 MTA is very complicated. I want to kick player when he clicks a button. It would be possible to do this? How to set the ACL? In the SAMP is so easy, using Kick (playerid). Link to comment
CapY Posted January 27, 2012 Share Posted January 27, 2012 MTA is very complicated. It's not, you're just one more beginner. Link to comment
hank Posted January 28, 2012 Author Share Posted January 28, 2012 MTA is very complicated. I want to kick/disconnect player when he clicks a button. It would be possible to do this? How to set the ACL? In the SAMP is so easy, using Kick (playerid). Anyone? Link to comment
Klesh Posted January 28, 2012 Share Posted January 28, 2012 1 - Go to your mta directory: C:\Program Files\MTA San Andreas 1.3 2 - Search a folder server/mods/deathmatch 3 - There is a file named acl.xml 4 - Open it with notepad, recomendated notepad++ 5 - You will see a big list of codes, look at line 18, you will see a group called admin 5 - Add the username you was register before in your server, your login account, add it before user. "user.hank"/> 6 - The final have to look something like this : "Admin"> "Moderator"/> "SuperModerator"/> "Admin"/> "RPC"/> "resource.admin"/> "resource.webadmin"/> "user.hank"/> Only add the last line to the admin group, with all that you will have admin on your server, press "p" to open admin panel, commands are always enabled to used, i hope this work. 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