xeon17 Posted August 14, 2014 Posted August 14, 2014 How i can make my admin chat to work by bindkey ''‚'' ( ‚ ) function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) for i, v in pairs ( acls ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ORGANIZADOR" ) )) then outputChatBox ( "#FF0000[Organizador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "MODERADOR" ) )) then outputChatBox ( "#FF0000[Moderador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ADMINISTADOR" ) )) then outputChatBox ( "#FF0000[Administrador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "COLABORADOR" ) )) then outputChatBox ( "#FF0000[Colaborador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "Console" ) )) then outputChatBox ( "#FF0000[Console] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end end end end addCommandHandler ( "ac", adminchat ) I tried but dosen't work ,help Et-win :DDDDD A unique GangWar gamemode waiting for you!Click here for more information.
Et-win Posted August 14, 2014 Posted August 14, 2014 How you want to chat via a bind... You can't enter a message by then... ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
TAPL Posted August 14, 2014 Posted August 14, 2014 MTA hard-coded commandschatbox: Opens the chatbox for input https://wiki.multitheftauto.com/wiki/Control_names https://wiki.multitheftauto.com/wiki/BindKey
tosfera Posted August 14, 2014 Posted August 14, 2014 How you want to chat via a bind... You can't enter a message by then... You can bind a key to a chatbox. ^^ bindKey ( source, key, "down", "chatbox", function ); edit; ^ up was faster. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
xeon17 Posted August 14, 2014 Author Posted August 14, 2014 local acls = { "ORGANIZADOR", "MODERADOR", "ADMINISTADOR", "COLABORADOR", "Console" } function adminchat ( thePlayer, _, ... ) local message = table.concat ( { ... }, " " ) local account = getPlayerAccount(thePlayer) if (not account or isGuestAccount(account)) then return end local accountName = getAccountName(account) for i, v in pairs ( acls ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ORGANIZADOR" ) )) then outputChatBox ( "#FF0000[Organizador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "MODERADOR" ) )) then outputChatBox ( "#FF0000[Moderador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "ADMINISTADOR" ) )) then outputChatBox ( "#FF0000[Administrador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "COLABORADOR" ) )) then outputChatBox ( "#FF0000[Colaborador] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end if (isObjectInACLGroup ( "user."..accountName, aclGetGroup ( "Console" ) )) then outputChatBox ( "#FF0000[Console] #FFFF00".. getPlayerName ( thePlayer ) .." : #FFFFFF".. message, player, 255, 255, 255, true ) end end end end addCommandHandler ( "ac", adminchat ) function isAllownedPlayer(player) local account = getPlayerAccount(player) if (not account or isGuestAccount(account)) then return false end local accountName = getAccountName(account) for i, v in pairs ( acls ) do if ( isObjectInACLGroup ( "user.".. accountName, aclGetGroup ( v ) ) ) then return true end end outputChatBox("#FFF000[sERVER]#FFFFFF You aren't an admin.", player, 255,255,255, true) return false end bindKey ( source, u , "down", "chatbox", function ); A unique GangWar gamemode waiting for you!Click here for more information.
tosfera Posted August 14, 2014 Posted August 14, 2014 'source' is nothing outside a function. Make it bind when players spawn, or when an admin logs in. Also, the 'u' should be a string and your 'function' should be replaced with the name of your function. If you want to contact me directly concerning Advanced-Gaming, please contact me at [email protected]
xeon17 Posted August 14, 2014 Author Posted August 14, 2014 It's first time i work with bindkey and this stuff , i don't understand how it work... function Bind ( source ) if not (isAllownedPlayer(source)) then return end bindKey ( source, adminchat , "down", "chatbox", bind ) end addEventHandler("onPlayerLogin", root, Bind) A unique GangWar gamemode waiting for you!Click here for more information.
xeon17 Posted August 14, 2014 Author Posted August 14, 2014 ._. A unique GangWar gamemode waiting for you!Click here for more information.
Max+ Posted August 14, 2014 Posted August 14, 2014 --serverside , addEventHandler ( 'onPlayerLogin', resourceRoot, function ( player ) if not ( isAllownedPlayer(player)) then return end bindKey ( player, 'u', 'down', 'chatbox', adminchat ) end ) - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
TAPL Posted August 14, 2014 Posted August 14, 2014 --serverside , addEventHandler ( 'onPlayerLogin', resourceRoot, function ( player ) if not ( isAllownedPlayer(player)) then return end bindKey ( player, 'u', 'down', 'chatbox', adminchat ) end ) Never try to help anyone when you don't even know the basics.
xeon17 Posted August 30, 2014 Author Posted August 30, 2014 I tried this but dosen't work addEventHandler ( 'onPlayerJoin', root, function () bindKey ( source, 'u', 'down', 'chatbox', adminchat ) end) bug: [2014-08-30 17:03:26] WARNING: (GW)Admin-Chat\admin-chat.lua:38: Bad argument @ 'bindKey' [Expected string at argument 5, got function] A unique GangWar gamemode waiting for you!Click here for more information.
Anubhav Posted August 30, 2014 Posted August 30, 2014 addEventHandler ( 'onPlayerJoin', root, function () bindKey ( source, 'u', 'down', adminchat ) end) See my some resources: Skin shop: https://community.multitheftauto.com/in ... ls&id=8008 Note script: https://community.multitheftauto.com/in ... ls&id=8009 Rules Panel: https://community.multitheftauto.com/in ... ls&id=8246 Random Money: https://community.multitheftauto.com/in ... ls&id=8718
xeon17 Posted August 30, 2014 Author Posted August 30, 2014 Now when i press ''U'' it's output ''down'' in chat , no work as chatbox. A unique GangWar gamemode waiting for you!Click here for more information.
xeon17 Posted August 30, 2014 Author Posted August 30, 2014 Ah the problem was the argument 5° was name of function , should be name of command. Problem solved. A unique GangWar gamemode waiting for you!Click here for more information.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now