Jump to content

Help? Command


GamerDeMTA

Recommended Posts

use this
addEventHandler("onPlayerCommand", root, 
function(cmd) 
     if cmd == "votemap" then 
          outputChatBox ( "INFO: Comand votemap is disabled", source, 255, 69, 0 ) 
          cancelEvent() 
     end 
end) 

With this setup, I've created a command you might like too;

addEventHandler("onPlayerCommand", root, 
function(cmd) 
     if cmd == "votemap" then 
        local accName = getAccountName ( getPlayerAccount ( source ) ) -- get his account name 
        if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) -- if he isn't an admin 
          outputChatBox ( "INFO: Comand votemap is disabled for normal players, please ask and admin to start a vote.", source, 255, 69, 0 ) 
          cancelEvent() 
        end 
     end 
end) 
  

Link to comment
addEventHandler("onPlayerCommand", root, 
function(cmd) 
     if cmd == "votemap" then 
        local accName = getAccountName ( getPlayerAccount ( source ) ) -- get his account name 
        if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then -- if he isn't an admin 
          outputChatBox ( "INFO: Comand votemap is disabled for normal players, please ask and admin to start a vote.", source, 255, 69, 0 ) 
          cancelEvent() 
        end 
     end 
end) 

Was missing a then at line 5 ^^ ..

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