function allowORnot (player, key)
outputChatBox("check")
if isObjectInACLGroup("user."..getAccountName( getPlayerAccount( player ) ), aclGetGroup( "Pirate" ) ) then
if (key == nil) then
key = 0
outputChatBox("go")
removeEventHandler("onVehicleStartEnter", getRootElement(), pirateBoat)
end
elseif (key == 0) then
addEventHandler ( "onVehicleStartEnter", getRootElement(), pirateBoat)
key = nil
outputChatBox("stop")
end
end
addCommandHandler ("cannon", allowORnot)
csiguusz's code isn't fine , tried with checks, it "check" then "go" but doesnt go to "stop" and after that it just "check"