Jump to content

how i make a script only one clan can use a command?


Recommended Posts

I want to create a Base for mi clan, but i don't know how i can make only my clan can use the command to open.

Link to post

set an element data for that group

and use this:

function a()
  if getElementData(localPlayer, "ClanName") then
    -- do something here
    else
    outputChatBox("You are not allowed to use this command", 255, 0, 0)
    end
  end
addCommandHandler("abc1", a)

 

  • Like 1
Link to post
10 hours ago, Hydra said:

set an element data for that group

and use this:


function a()
  if getElementData(localPlayer, "ClanName") then
    -- do something here
    else
    outputChatBox("You are not allowed to use this command", 255, 0, 0)
    end
  end
addCommandHandler("abc1", a)

 

How i set an element data for that group?

Link to post
95 /5000 
 

Resultados de tradução

You need to create an acl so that players in it can access the command!
Sorry for my English,

use a function:
https://wiki.multitheftauto.com/wiki/IsObjectInACLGroup

 
function clan(thePlayer)
local accName = getAccountName(getPlayerAccount(thePlayer))
      if isObjectInACLGroup("user." ..accName, aclGetGroup("CLAN")) then
       ---- code
          else
         return  outputChatBox("comando apenas jogadores do clan")
        end
end
AddCommandHandler("clan", clan)


 
Edited by Down MTA
Link to post

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