shaio Posted December 1, 2016 Share Posted December 1, 2016 I'll take into consideration that everyone knows the IRC default resource for MTA? I don't think they include it in the package but it is one of the default scripts.Link to MTA IRC Default Resource Documentation Anyway, I'm having trouble with making a command for my server, I want to be able to control the ACL with my phone via IRC.. I've given the script admin permissions and ACL Request permissions. Every other part of the script works, and I do not receive any errors or warnings through console or debugscript. Please help me fix this. addIRCCommandHandler("!staff",function(server,channel,user,command,account,group) if account and group then if isObjectInACLGroup("user."..account,aclGetGroup(group)) then aclGroupRemoveObject(aclGetGroup(group),"user."..account) ircSay(channel,account.." has been successfully removed from "..group.."!") outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has removed "..account.." from "..group.."!",getRootElement(),255,0,0,true) else aclGroupAddObject(aclGetGroup(group),"user."..account) outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has added "..account.." to "..group.."!",getRootElement(),255,0,0,true) ircSay(channel,account.." has been successfully added to "..group.."!") end else ircSay(channel,"Incorrect Syntax! !addstaff <playerName> <aclGroup>") end end) Link to comment
shaio Posted December 2, 2016 Author Share Posted December 2, 2016 Please may I get some help with this? Link to comment
pa3ck Posted December 2, 2016 Share Posted December 2, 2016 Looks fine to me, are you sure the parameters are in the right order? Have you tried to outputChatBox ALL of the parameters? Are you sure you spell the username and group correctly and they exist? Link to comment
shaio Posted December 4, 2016 Author Share Posted December 4, 2016 Yes, I can make it check and use tostring if i need to but it still doesn't work. This is why I need help The rest of the script works, just this function doesn't, and I have no clue as to why.. Link to comment
Captain Cody Posted December 4, 2016 Share Posted December 4, 2016 Try this addIRCCommandHandler("!staff",function(server,channel,user,command,account,group) outputDebugString('1') if account and group then outputDebugString('2') if isObjectInACLGroup("user."..account,aclGetGroup(group)) then outputDebugString('3') aclGroupRemoveObject(aclGetGroup(group),"user."..account) ircSay(channel,account.." has been successfully removed from "..group.."!") outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has removed "..account.." from "..group.."!",getRootElement(),255,0,0,true) else outputDebugString('4') aclGroupAddObject(aclGetGroup(group),"user."..account) outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has added "..account.." to "..group.."!",getRootElement(),255,0,0,true) ircSay(channel,account.." has been successfully added to "..group.."!") end else outputDebugString('5') ircSay(channel,"Incorrect Syntax! !addstaff <playerName> <aclGroup>") end end) Tell me which numbers it shows. Link to comment
shaio Posted December 12, 2016 Author Share Posted December 12, 2016 (edited) On 12/4/2016 at 4:49 PM, CodyL said: Try this addIRCCommandHandler("!staff",function(server,channel,user,command,account,group) outputDebugString('1') if account and group then outputDebugString('2') if isObjectInACLGroup("user."..account,aclGetGroup(group)) then outputDebugString('3') aclGroupRemoveObject(aclGetGroup(group),"user."..account) ircSay(channel,account.." has been successfully removed from "..group.."!") outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has removed "..account.." from "..group.."!",getRootElement(),255,0,0,true) else outputDebugString('4') aclGroupAddObject(aclGetGroup(group),"user."..account) outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has added "..account.." to "..group.."!",getRootElement(),255,0,0,true) ircSay(channel,account.." has been successfully added to "..group.."!") end else outputDebugString('5') ircSay(channel,"Incorrect Syntax! !addstaff <playerName> <aclGroup>") end end) Tell me which numbers it shows. Debug strings did not work so I used ircSay instead. I had to set the permission to 0 for the command to even show up. And it says, 1, 2, 4, shay successfully added to Moderator! And it did work. Here is the code I used. addIRCCommandHandler("!staff",function(server,channel,user,command,account,group) ircSay(channel,"1") if account and group then ircSay(channel,"2") if isObjectInACLGroup("user."..account,aclGetGroup(group)) then ircSay(channel,"3") aclGroupRemoveObject(aclGetGroup(group),"user."..account) ircSay(channel,account.." has been successfully removed from "..group.."!") outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has removed "..account.." from "..group.."!",getRootElement(),255,0,0,true) else ircSay(channel,"4") aclGroupAddObject(aclGetGroup(group),"user."..account) outputChatBox("#FFFF00* #FF008F[#FFFFFFIRC#FF008F] #FFFFFF"..ircGetUserNick(user).."#FFFFFF has added "..account.." to "..group.."!",getRootElement(),255,0,0,true) ircSay(channel,account.." has been successfully added to "..group.."!") end else ircSay(channel,"5") ircSay(channel,"Incorrect Syntax! !addstaff <playerName> <aclGroup>") end end) Edited December 12, 2016 by shaio 1 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