Jump to content

مشكله : يطلع مره وحده :|


G.KinG

Recommended Posts

سلام عليكم

:roll:

اليوم استخدم سكربت

https://community.multitheftauto.com/in ... ls&id=7668

وعدلت على ذا الكود

  
addEvent("Silenced", true) 
addEventHandler("Silenced",root, 
function() 
local PlayerMoney = getPlayerMoney(source) 
 if ( PlayerMoney >= 1800) then 
    takePlayerMoney(source,1800) 
    giveWeapon ( source ,  23,30 ) 
    local name = getPlayerName(source) 
    exports['TopChat']:sendClientMessage ( "#55D32B* [ "..name .." ] Has Bought Silenced ", getRootElement(), 255, 0, 0, true ) 
end 
end) 
  

المشكله لما اشتري اكثر من مره

يطلع مره وحده في الشريط

الي فوق

يعني ما يطلع ورى بعض

مثلا ضغظت 6 مرات على الشراء

يطلع 6 سطور في الشريط الي فوق

والمشكله انه يطلع شريط واحد

اتمنى فهمتو مشكلتي ><

Link to comment

بوضحها زياده عشان توضح المشكله

انا مثلا ضغظت 6 مرات على الزر

ابيه يطلع في الشريط الي فوق زي كذا

========

========

========

========

========

========

المشكله انه يطلع مره وحده

زي كذا

========

ذا مثال عشان توضح المشكله ض1

Link to comment

جرب

------------------------------------------ 
--            TopBarChat                -- 
------------------------------------------ 
-- Developer: Braydon Davis             -- 
-- File: c.lua                          -- 
-- Copyright 2013 (C) Braydon Davis     -- 
-- All rights reserved.                 --   
------------------------------------------ 
sec = {{{{{{},{},{},{}}}}}}             -- 
------------------------------------------ 
  
local maxMessages = 5; -- 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 sendClientMessage ( 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..":sendClientMessage", true ) 
addEventHandler ( TheResourceName..":sendClientMessage", 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 ) 

الغيت سطر 38 + 59

Link to comment

متأكد من اسم المود؟

لان بالموضوع انت حاط الكود كذا

exports['TopChat']:sendClientMessage ( "#55D32B* [ "..name .." ] Has Bought Silenced ", getRootElement(), 255, 0, 0, true ) 

TopChat اسم المود بكودك

TopBarChat يوم حملت المود من الرابط لقيت الأسم مختلف

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