kamel10 Posted July 19, 2014 Share Posted July 19, 2014 انا عندي مود التوب شات ركبته و كل شيئ تمام سيرفر ------------------------------------------ -- TopBarChat -- ------------------------------------------ -- Developer: Braydon Davis -- -- File: s.lua -- -- Copyright 2013 (C) Braydon Davis -- -- All rights reserved. -- ------------------------------------------ sec = {{{{{{},{},{},{}}}}}} -- ------------------------------------------ local TheResourceName = getResourceName ( getThisResource ( ) ) function outputServer ( who, msg, r, g, b, pos, time ) if ( msg and who ) then if ( isElement ( who ) ) then triggerClientEvent ( who, TheResourceName..":outputServer", who, msg, r, g, b, pos, time ) return true else return false end else return false end end addCommandHandler ( "runtest", function ( ) for i=1,7 do setTimer ( function ( i ) outputServer ( "Indexing "..i.."...", root, math.random ( 20, 255 ), math.random ( 20, 255 ), math.random ( 20, 255 ), true ) outputServer ( "Indexing "..i.."...", root, math.random ( 20, 255 ), math.random ( 20, 255 ), math.random ( 20, 255 ), false ) end, i*1000, 1, i ) end end ) كلينت ------------------------------------------ sec = {{{{{{},{},{},{}}}}}} -- ------------------------------------------ local maxMessages = 20; -- The max messages that will show (on each bar) local DefaultTime = 8; -- The max time each message will show if time isn't defined. ---------- DON'T EDIT BELOW HERE UNLESS YOU KNOW WHAT YOUR DOING! ---------- local sx, sy = guiGetScreenSize ( ) local DefaultPos = true; -- Top bar variables local timer_top = { } local timer_btm = { } -- Bottom bar variables local messages_top = { } local messages_btm = { } function outputClient ( msg, r, g, b, pos, time ) -- Msg: String -- R: Int (0-255) -- G: Int (0-255) -- B: Int (0-255) -- Pos: Boolean -- Time: Int local r, g, b = r, g, b or 255, 255, 255 if ( pos == nil ) then pos = DefaultPos end -- Check for pos if ( time == nil ) then time = DefaultTime end -- Check for time local GsubedMessage = msg:gsub ( "#%x%x%x%x%x%x", "" ) if ( pos == true ) then -- if ( not isTimer ( timer_top[GsubedMessage] ) ) then local c_messages = messages_top; if ( #messages_top >= maxMessages ) then local c_messages = messages_top; messages_top = { } for i,v in ipairs ( c_messages ) do if ( i ~= 1 ) then table.insert ( messages_top, { v[1], v[2], v[3], v[4] } ) end end end table.insert ( messages_top, { msg, r, g, b } ) timer_top[GsubedMessage] = setTimer ( function ( msg ) for i,v in ipairs ( messages_top ) do if ( v[1] == msg ) then table.remove ( messages_top, i ) break end end end, time*1000, 1, msg ) return_value = true -- else return_value = false end else if not ( isTimer ( timer_btm[GsubedMessage] ) ) then local c_messages = messages_btm; if ( #messages_btm >= maxMessages ) then local c_messages = messages_btm; messages_btm = { } for i,v in ipairs ( c_messages ) do if ( i ~= 1 ) then table.insert ( messages_btm, { v[1], v[2], v[3], v[4] } ) end end end table.insert ( messages_btm, { msg, r, g, b } ) timer_btm[GsubedMessage] = setTimer ( function ( msg ) for i,v in ipairs ( messages_btm ) do if ( v[1] == msg ) then table.remove ( messages_btm, i ) break end end end, time*1000, 1, msg ) return_value = true else return_value = false end end return return_value or false end local TheResourceName = getResourceName ( getThisResource ( ) ) addEvent ( TheResourceName..":outputClient", true ) addEventHandler ( TheResourceName..":outputClient", root, sendClientMessage ) function dxDrawNotificationBar ( ) for i,v in ipairs ( messages_top ) do local i = i - 1 -- Because tables start at 1 -.- if ( i == #messages_top-1 ) then dxDrawRectangle ( ( sx/2-530/2 ), i*25, 530, 25, tocolor ( 0, 0, 0, 100 ) ) end dxDrawRectangle ( ( sx/2-530/2 ), i*25, 530, 25, tocolor ( 0, 0, 0, 120 ) ) dxDrawText ( v[1], 0, i*25+5, sx, 25, tocolor ( v[2], v[3], v[4], 255 ), 1, "default-bold", "center", "top", true, false, false, true ) end for i,v in pairs ( messages_btm ) do local i = i - 1 local y = i * 25+25 if ( i+1 == #messages_btm ) then dxDrawRectangle ( ( sx/2-530/2 ), (sy-y), 530, 25, tocolor ( 0, 0, 0, 120 ) ) end dxDrawRectangle ( ( sx/2-530/2 ), (sy-y), 530, 25, tocolor ( 0, 0, 0, 120 ) ) dxDrawText ( v[1], 0, (sy-y+5), sx, sy, tocolor ( v[2], v[3], v[4], 255 ), 1, "default-bold", "center", "top", true, false, false, true ) end end addEventHandler ( "onClientRender", root, dxDrawNotificationBar ) المشكلة هي ما يبي يشتغل مع المود دة addCommandHandler ( "chat", function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then local name = getPlayerName(thePlayer) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) exports["guimessages"]:outputServer (getRootElement(), "#FF0000|~|~| #00FF00The #00FF00Admin #FF0000" .. name .. " #FF0000 Has#00FF00 Cleared#FF0000 The#00FF00 Chat #FF0000|~|~|", 255, 0, 0, true ) end end ) يقولي في دوبيق server triggered clientside event GuiMessages:outputServer but event not added to client sided Link to comment
-#Saimon Posted July 19, 2014 Share Posted July 19, 2014 addCommandHandler ( "chat", function ( thePlayer ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Console" ) ) then local name = getPlayerName(thePlayer) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) outputChatBox ( " ", getRootElement(), 255, 0, 0, true ) exports["TopBarChat"]:outputServer (getRootElement(), "#FF0000|~|~| #00FF00The #00FF00Admin #FF0000" .. name .. " #FF0000 Has#00FF00 Cleared#FF0000 The#00FF00 Chat #FF0000|~|~|", 255, 0, 0, true ) end end ) Link to comment
TAPL Posted July 19, 2014 Share Posted July 19, 2014 سطر 81 و 82 في الكلينت outputClient انت حاط اسم الأفنت outputServer بينما في السيرفر اسم التريقر Link to comment
kamel10 Posted July 19, 2014 Author Share Posted July 19, 2014 طيب انا ابي اخلي في الكلينت لما ابي اخليه يطلع فوق اكتب outputClient مو outputServer 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