Jump to content

Help Please [ =


iPrestege

Recommended Posts

Hello , i have a problem here in this script :

function Police(text, type,source) 
 if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then 
local Police = getTeamFromName ( "Police" ) 
 if ( Police ) then  
  
            cancelEvent() 
  
outputChatBox("#0000FF* [Police] x "..getPlayerName ( source ).." :#ffFFff " .. text, getRootElement(), true ) 
  
             end 
      end 
end 
addEventHandler("onPlayerChat", getRootElement(), Police) 
  

Problem = Not Working

need some help .

am use it on server side .

thanks ^ .

Link to comment
I don't really understand what are you trying to do, though, the first problem I see is that you are placing 'source' as argument, but 'source' is already defined.

I want if the player in the police team and a console group when he chating it will be like that :

outputChatBox("#0000FF* [Police] x "..getPlayerName ( source ).." :#ffFFff " .. text, getRootElement(), true )

Chat : * [Police] x Mr.Pres[T]ege : text

another one :

* [Police] x Mr.Pres[T]ege : Hello Mta ( =

and i use cancel event for non-repetition .

i hope you understand me now .

Link to comment
function Police ( text, type ) 
    local team = getPlayerTeam ( source ) 
    if ( team and getTeamName ( team ) == "Police" ) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Console" ) ) then 
            outputChatBox ( "#0000FF* [Police] x ".. getPlayerName ( source ) .." :#ffFFff " .. text, getRootElement(), true ) 
            cancelEvent ( ) 
        end 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), Police ) 

Link to comment
function Police ( text, type ) 
    local team = getPlayerTeam ( source ) 
    if ( team and getTeamName ( team ) == "Police" ) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Console" ) ) then 
            outputChatBox ( "#0000FF* [Police] x ".. getPlayerName ( source ) .." :#ffFFff " .. text, getRootElement(), true ) 
            cancelEvent ( ) 
        end 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), Police ) 

Thanks castillo works now but #color is not working but fixed thanks!

Link to comment

@DNK

i know that i do it like that but not working -_-" ? what,s the fucking problem :

function Police ( text, type ) 
    local team = getPlayerTeam ( source ) 
    if ( team and getTeamName ( team ) == "Police" ) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Console" ) ) then 
            outputChatBox ( "#0000FF* [Police] x ".. getPlayerName ( source ) .." :#ffFFff " .. text, root, true, 255, 0, 0) 
            cancelEvent ( ) 
        end 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), Police ) 

Link to comment
function Police ( text, type ) 
    local team = getPlayerTeam ( source ) 
    if ( team and getTeamName ( team ) == "Police" ) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Console" ) ) then 
            outputChatBox ( "#0000FF* [Police] x ".. getPlayerName ( source ) .." :#ffFFff " .. text, root, 255, 0, 0, true) 
            cancelEvent ( ) 
        end 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), Police ) 

Link to comment
function Police ( text, type ) 
    local team = getPlayerTeam ( source ) 
    if ( team and getTeamName ( team ) == "Police" ) then 
        if isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Console" ) ) then 
            outputChatBox ( "#0000FF* [Police] x ".. getPlayerName ( source ) .." :#ffFFff " .. text, root, 255, 0, 0, true) 
            cancelEvent ( ) 
        end 
    end 
end 
addEventHandler ( "onPlayerChat", getRootElement(), Police ) 

Thank You "DNL" Works now [= .

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