Jump to content

[HELP] function


Spesso

Recommended Posts

Posted

hey guys, i wanna i little help, i created this function

function helloCommand ( playerSource, commandName )

local theTriggerer = getPlayerName ( playerSource )

triggerClientEvent ( "onHello", getRootElement() )

outputChatBox ( theTriggerer .. ": #00FF00Hello Man!", getRootElement(), 255, 255, 255, true )

end

but i wanna add this function works only for admin and donators, and idk how do it. anyone help me pls

Posted

For admins you can use:

getAccountName 
getPlayerAccount 
isObjectInACLGroup 
aclGetGroup 

For donators you have to make your own donators system which means every donator, you store them in an XML file or a database or something like that, afterwards you make a custom function to check whether a player is a donator and use it when needed.

F4MZM4.gif

Posted

If 'accountname' is defined, then it should work.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Moderators
Posted
For donators you have to make your own donators system

No you can create a donator group in the ACL just like for the admins and manually put the donators in that group.

The rEvolution is coming ...

Posted
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ))

this?

if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" )) then 

Sha67 سابقاً

Posted

Try this not tested

function helloCommand ( playerSource, commandName, acc ) 
local accName = getAccountName ( acc ) 
local theTriggerer = getPlayerName ( playerSource ) 
triggerClientEvent ( "onHello", getRootElement() ) 
    if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" )) then 
    outputChatBox ( theTriggerer .. ": #00FF00Hello Man!", getRootElement(), 255, 255, 255, true ) 
    else 
    outputChatBox ( "You can't use this command!", getRootElement(), 255, 0, 0, true) 
    end 
end 

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

'acc' will be a string there.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
  
function helloCommand ( playerSource, commandName, acc ) 
local account = getPlayerAccount( playerSource ) 
local accName = getAccountName( account ) 
local theTriggerer = getPlayerName ( playerSource ) 
triggerClientEvent ( "onHello", getRootElement() ) 
    if isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "Admin" )) or isObjectInACLGroup ( "user." .. accName, aclGetGroup ( "SuperModerator" )) then 
    outputChatBox ( theTriggerer .. ": #00FF00Hello Man!", getRootElement(), 255, 255, 255, true ) 
    else 
    outputChatBox ( "You can't use this command!", getRootElement(), 255, 0, 0, true) 
    end 
end 

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

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