SaedAmer Posted April 19, 2016 Share Posted April 19, 2016 addEvent("onPlayerOpenChat",true) addEvent("onPlayerCloseChat",true) function playerchat() if eventName == "onPlayerOpenChat" then addEventHandler("onPlayerChat",root,chatbox) elseif eventName == "onPlayerCloseChat" then removeEventHandler("onPlayerChat",root,chatbox) end end addEventHandler("onPlayerCloseChat",root,playerchat) addEventHandler("onPlayerOpenChat",root,playerchat) addEventHandler("onPlayerChat",root, function chatbox( text, type) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#0099DC* [ Lv.1 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL2")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#2554C7* [ Lv.2 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL3")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#00cc11* [ Lv.3 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL4")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007700* [ Lv.4 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL5")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#cc0000* [ Lv.5 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Lv.6 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Head-Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Manager")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#347235* [ T-Developer ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin-Ex")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#777777* [ Admin - EX ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Police")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007F7F* [ Soldier ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FFFFFF* " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end addEvent("onPlayerCloseChat",true) function chatbox( text, type ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end Link to comment
MR.GRAND Posted April 19, 2016 Share Posted April 19, 2016 addEvent("onPlayerOpenChat",true) addEvent("onPlayerCloseChat",true) function playerchat() if eventName == "onPlayerOpenChat" then addEventHandler("onPlayerChat",root,chatbox) elseif eventName == "onPlayerCloseChat" then removeEventHandler("onPlayerChat",root,chatbox) end end addEventHandler("onPlayerCloseChat",root,playerchat) addEventHandler("onPlayerOpenChat",root,playerchat) addEventHandler("onPlayerChat",root, function chatbox( text, type) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#0099DC* [ Lv.1 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL2")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#2554C7* [ Lv.2 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL3")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#00cc11* [ Lv.3 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL4")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007700* [ Lv.4 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL5")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#cc0000* [ Lv.5 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Lv.6 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Head-Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Manager")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#347235* [ T-Developer ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin-Ex")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#777777* [ Admin - EX ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Police")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007F7F* [ Soldier ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FFFFFF* " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end addEvent("onPlayerCloseChat",true) function chatbox( text, type ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end addEvent("onPlayerOpenChat",true) addEvent("onPlayerCloseChat",true) function playerchat() if eventName == "onPlayerOpenChat" then addEventHandler("onPlayerChat",root,chatbox) elseif eventName == "onPlayerCloseChat" then removeEventHandler("onPlayerChat",root,chatbox) end end addEventHandler("onPlayerCloseChat",root,playerchat) addEventHandler("onPlayerOpenChat",root,playerchat) addEventHandler("onPlayerChat",root, function( text, type) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#0099DC* [ Lv.1 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL2")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#2554C7* [ Lv.2 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL3")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#00cc11* [ Lv.3 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL4")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007700* [ Lv.4 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL5")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#cc0000* [ Lv.5 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Lv.6 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Head-Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Manager")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#347235* [ T-Developer ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin-Ex")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#777777* [ Admin - EX ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Police")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007F7F* [ Soldier ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FFFFFF* " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end ) addEvent("onPlayerCloseChat",true) function chatbox( text, type ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end Link to comment
SaedAmer Posted April 19, 2016 Author Share Posted April 19, 2016 اوك طيب ده server addEvent("onPlayerOpenChat",true) addEvent("onPlayerCloseChat",true) function playerchat() if eventName == "onPlayerOpenChat" then addEventHandler("onPlayerChat",root,chatbox) elseif eventName == "onPlayerCloseChat" then removeEventHandler("onPlayerChat",root,chatbox) end end addEventHandler("onPlayerCloseChat",root,playerchat) addEventHandler("onPlayerOpenChat",root,playerchat) addEventHandler("onPlayerChat",root, function( text, type) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#0099DC* [ Lv.1 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL2")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#2554C7* [ Lv.2 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL3")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#00cc11* [ Lv.3 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL4")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007700* [ Lv.4 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("LVL5")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#cc0000* [ Lv.5 ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin1")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Lv.6 ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Head-Admin")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#C11B17* [ Head.Admin ] " .. getPlayerName ( source ) ..": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Manager")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#347235* [ T-Developer ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Admin-Ex")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#777777* [ Admin - EX ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Police")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#007F7F* [ Soldier ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FFFFFF* " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end ) outputChatBox("[C.Console]: Chat has been open by " ..getPlayerName(player).. " ",root,0,255,0,true) addEvent("onPlayerCloseChat",true) function chatbox( text, type ) if isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Console")) then cancelEvent() local r, g, b = getPlayerNametagColor(source) outputChatBox("#FF0000* [ Console ] " .. getPlayerName ( source ) .. ": #ffFFff" .. text, getRootElement(), r, g, b, true ) end end function createTeamsOnStart () outputChatBox ("[#Chat Loked By Console] ", getRootElement(), 255, 255, 255, true) roobB = createObject (2634, 308.10000610352, 2516.3999023438, 17.5, 0, 0, 186) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) outputChatBox ("[C.Console]: Chat has been locked by Console ", root,255,255,255,true) clint function Strong ( ) guiSetVisible ( NameWindow,true ) showCursor ( true ) end addCommandHandler ( "c.c",Strong ) addEventHandler("onClientGUIClick",guiRoot, function() if source == GUIEditor.button[1] then triggerServerEvent("onPlayerOpenChat",localPlayer) elseif source == GUIEditor.button[2] then triggerServerEvent("onPlayerCloseChat",localPlayer) end end) في السيرفر لما بضغط بطن 1 المفروض يطلع كلام بالشات و مش عاوزو يتكرر الكلام و لما بضغط بطن 2 بردو يطلع كلام بلشات و الكونسول بس هو الي يقضر يتكلم اما الكلنت ابيه يفتح من ف8 ب كلمة c.c Link to comment
SaedAmer Posted April 19, 2016 Author Share Posted April 19, 2016 حد يساعدني يا جماعة Link to comment
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