Jump to content

command sounds


JoZeFSvK

Recommended Posts

Client

addEvent( "onNoob", true ) 
addEventHandler( "onNoob", root, function() 
  local sound = playSound("noob.mp3") 
end ) 

Server

rRoot = getResourceRootElement(getThisResource()) 
local accountname = getAccountName (getPlayerAccount(player)) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
  
function noob (player, command) 
 outputChatBox( "Player "..getPlayerName(player).." : say  you are NOOB! ", root, 255, 255, 255, true ) 
 triggerClientEvent("onNoob", root) 
else outputChatBox ( "You dont have permission for this command", player, 255, 0, 0, true ) return end 
end 
addCommandHandler("noob", noob) 

Ehm it is good ? with alc ? and when i will want acl Admin and Supermoderator i must add new line or ?

Edited by Guest
Link to comment
rRoot = getResourceRootElement(getThisResource()) 
local accountname = getAccountName (getPlayerAccount(player)) 
  
function noob (player, command) 
if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) then 
 outputChatBox( "Player "..getPlayerName(player).." : say  you are NOOB! ", root, 255, 255, 255, true ) 
 triggerClientEvent("onNoob", root) 
else outputChatBox ( "You dont have permission for this command", player, 255, 0, 0, true ) return end 
end 
addCommandHandler("noob", noob) 

I can not like this but I have problem of bind more functions

Link to comment
local accountname = getAccountName (getPlayerAccount(player)) 

That has to go inside "noob" function.

Aha thank you so much. :) and when i will want 2 groups ? Admin and Supermoderator ? i must duplicate this line or can edit this line ?

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

Link to comment
you can simply do if isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Admin" ) ) or isObjectInACLGroup ( "user." .. accountname, aclGetGroup ( "Supermoderator " ) ) then

When i add this on script then i see message end expected to close function at line near

and when i add "or if isObject" then i see unexpected symbol near if in debugscript 3

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