Jump to content

N3xT

Retired Staff
  • Posts

    2,490
  • Joined

  • Days Won

    18

Posts posted by N3xT

  1. Please use the code tool next time to share your codes, so it would be easier for others to read and understand your codes. I edited it for you this time.

     

    Also, please explain your issue or what you're trying to achieve properly and on the topic, not hidden within your codes because it's really hard to notice.

     

     

    For your request, you could use these:

    onClientGUIClick
    guiSetVisible

     

  2. You need to trigger an event to make this happens, so when the player presses the button you send a server-side trigger, furthermore, you send it back again to his teammates and then do whatever you want to them

    triggerClientEvent
    triggerServerEvent

     

  3. 14 hours ago, redditing said:
    
    -- meta.xml
    
    <script src="Testing.Lua" type="server"/>
    

     

    <meta>
        <script src="file_name.lua" type="server"></script>
    </meta>

    edit file_name with the file you have

  4. 9 minutes ago, Kas7 said:

    ظبط بس انا كنت ابغا لما الاعب يطلع من السيارة ب 20 ثانية تنحزف مو لما يطلع من السيرفر
    + مشكور

    memory leak حدث الخروج لابد منه عشان تتجنب الـ

    • Like 1
  5. @VenomNX

    removePedFromVehicle لازم تستخدم معاه ,onVehicleEnter ما ينلغي

    جرب

    local bikes = {}
    
    addEventHandler("onMarkerHit", root,
        function(element, matchingDimension)
            if not isElement(element) or not matchingDimension or getElementType(element) ~= "player" then
                return
            end
            if source == pizMar then
                triggerClientEvent(element, "onPizzaHit", resourceRoot)
            elseif source == pizMar2 then
                if getElementData(element, "pizzaOccupent") == true and not bikes[element] then
                    bikes[element] = createVehicle(482, -74.28358, -352.48004, 1.38142, 359.447, 0.000, 93.239)
                    if bikes[element] then
                        warpPedIntoVehicle(element, bikes[element])
                        setElementData(bikes[element], "isPizzaBike", true)
                    end
                end
            end
        end
    )
    
    addEventHandler("onVehicleStartEnter", root,
        function(player)
            if getElementData(source, "isPizzaBike") == true then
                if source ~= bikes[player] then
                    cancelEvent()
                end
            end
        end
    )
    
    addEventHandler("onPlayerQuit", root,
        function()
            local bike = bikes[source]
            if bike then
                destroyElement(bike)
                bikes[source] = nil
            end
        end
    )

     

  6. On 13/06/2020 at 20:49, VenomNX said:

    هو مش خطا هو يضبط لكن على حسب المبرمج والشي اللي يريحه

    اذا يريحك التايمر نسوي لك واحد ابشر

    CLIENT SIDE :

    
    local ACCOUNT_NAME = "N/A";local IP = "N/A";local SERIAL = "N/A";function DRAW_UI()		dxDrawRectangle(736, 410, 0, 0, tocolor(255, 255, 255, 255), false)	dxDrawLine(0 - 1, 1050 - 1, 0 - 1, 1080, tocolor(145, 0, 0, 255), 1, false)	dxDrawLine(1920, 1050 - 1, 0 - 1, 1050 - 1, tocolor(145, 0, 0, 255), 1, false)	dxDrawLine(0 - 1, 1080, 1920, 1080, tocolor(145, 0, 0, 255), 1, false)	dxDrawLine(1920, 1080, 1920, 1050 - 1, tocolor(145, 0, 0, 255), 1, false)	dxDrawRectangle(0, 1050, 1920, 30, tocolor(0, 0, 0, 255), false)			local name = getPlayerName(localPlayer) -- جلـب ألاسم ألاعب	dxDrawText("Name:"..name, 3, 1056, 200, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			dxDrawText("Account: "..ACCOUNT_NAME, 210, 1056, 407, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)				local Team = getTeamName (getPlayerTeam (localPlayer)) or 'None' -- جلب ألأفريق ألذي يوجد به ألآعب	dxDrawText("Team: "..Team, 417, 1056, 614, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)	local Skin = getPlayerSkin(localPlayer)	dxDrawText("ID Skin: "..Skin, 624, 1056, 821, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local money = getPlayerMoney(localPlayer)-- جلب مبلغ ألآعب	dxDrawText("Money: "..money, 831, 1056, 1028, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local weaponType = getPedWeapon ( localPlayer ) -- جلب رقم ألسلآح	dxDrawText("ID Weapon: "..weaponType, 1038, 1056, 1235, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local Health = getElementHealth ( localPlayer ) -- جلب كمية ألدم 	dxDrawText("Health: "..Health, 1245, 1056, 1442, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local me = getLocalPlayer ( ) -- مدري وش قصته , لا تحذفة يخرب مجرب ض	local armor = getPedArmor ( me ) -- جلب كمية ألدرع	dxDrawText("Armour: "..armor, 1452, 1056, 1649, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local ping = getPlayerPing(localPlayer)-- جلب سرعـه ألارتنرنت للاعب	dxDrawText("Ping: "..ping, 1659, 1057, 1723, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local fps = getFPSLimit(localPlayer) -- جلب حد ألفبس لـ سيرفر	dxDrawText("FPS: "..fps, 1733, 1057, 1797, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(10 - 1, 1030 - 1, 10 - 1, 1046, tocolor(101, 0, 0, 254), 1, false)	dxDrawLine(364, 1030 - 1, 10 - 1, 1030 - 1, tocolor(101, 0, 0, 254), 1, false)	dxDrawLine(10 - 1, 1046, 364, 1046, tocolor(101, 0, 0, 254), 1, false)	dxDrawLine(364, 1046, 364, 1030 - 1, tocolor(101, 0, 0, 254), 1, false)	dxDrawRectangle(10, 1030, 354, 16, tocolor(1, 0, 0, 254), false)			dxDrawText("Serial: "..SERIAL, 13, 1030, 364, 1046, tocolor(114, 255, 144, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(1598 - 1, 1032 - 1, 1598 - 1, 1046, tocolor(117, 0, 0, 254), 1, false)	dxDrawLine(1910, 1032 - 1, 1598 - 1, 1032 - 1, tocolor(117, 0, 0, 254), 1, false)	dxDrawLine(1598 - 1, 1046, 1910, 1046, tocolor(117, 0, 0, 254), 1, false)	dxDrawLine(1910, 1046, 1910, 1032 - 1, tocolor(117, 0, 0, 254), 1, false)	dxDrawRectangle(1598, 1032, 312, 14, tocolor(0, 0, 0, 254), false)		dxDrawText("IP: "..IP, 1602, 1032, 1910, 1046, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(374 - 1, 1030 - 1, 374 - 1, 1046, tocolor(123, 0, 0, 254), 1, false)	dxDrawLine(673, 1030 - 1, 374 - 1, 1030 - 1, tocolor(123, 0, 0, 254), 1, false)	dxDrawLine(374 - 1, 1046, 673, 1046, tocolor(123, 0, 0, 254), 1, false)	dxDrawLine(673, 1046, 673, 1030 - 1, tocolor(123, 0, 0, 254), 1, false)	dxDrawRectangle(374, 1030, 299, 16, tocolor(1, 0, 0, 254), false)			dxDrawText("Name Skin: ", 378, 1030, 677, 1046, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(1413 - 1, 1032 - 1, 1413 - 1, 1046, tocolor(119, 0, 0, 254), 1, false)	dxDrawLine(1588, 1032 - 1, 1413 - 1, 1032 - 1, tocolor(119, 0, 0, 254), 1, false)	dxDrawLine(1413 - 1, 1046, 1588, 1046, tocolor(119, 0, 0, 254), 1, false)	dxDrawLine(1588, 1046, 1588, 1032 - 1, tocolor(119, 0, 0, 254), 1, false)	dxDrawRectangle(1413, 1032, 175, 14, tocolor(0, 1, 1, 254), false)			local time = getRealTime()-- جلب ألساعه	local hours = time.hour-- ساعه	local minutes = time.minute -- دقيقة	local seconds = time.second -- الثانية	-- Make sure to add a 0 to the front of single digits.	if (hours < 5) then -- الساعة		hours = "0"..hours	end	if (minutes < 5) then -- الدقيقة		minutes = "0"..minutes	end	if (seconds < 5) then -- الثانية		seconds = "0"..seconds		end        dxDrawText("Time: "..hours..":"..minutes..":"..seconds , 1414, 1031, 1588, 1046, tocolor(0, 255, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)        dxDrawLine(687 - 1, 1030 - 1, 687 - 1, 1046, tocolor(15, 102, 82, 254), 1, false)        dxDrawLine(1404, 1030 - 1, 687 - 1, 1030 - 1, tocolor(15, 102, 82, 254), 1, false)        dxDrawLine(687 - 1, 1046, 1404, 1046, tocolor(15, 102, 82, 254), 1, false)        dxDrawLine(1404, 1046, 1404, 1030 - 1, tocolor(15, 102, 82, 254), 1, false)        dxDrawRectangle(687, 1030, 717, 16, tocolor(59, 59, 59, 159), false)        dxDrawText("Welcome To Server", 687, 1031, 1398, 1046, tocolor(102, 158, 145, 254), 1.00, "default-bold", "center", "top", false, false, false, false, false)    endendaddEventHandler("onClientRender" , root, DRAW_UI)Timer = setTimer(triggerServerEvent,5000,0,"ON_RENDER_BEGIN",localPlayer);function ON_RECIEVE_DATA(data)	if data then		ACCOUNT_NAME = data.acc_name;		IP = data.ip;		SERIAL = data.serial;		return true;	end	return false;endaddEvent("ON_RECIEVE_DATA",true);addEventHandler("ON_RECIEVE_DATA",root,ON_RECIEVE_DATA);

     

    اذا انه شغال هذا لا يدل على انه صحيح، فيه فنكشنات من الخطأ استخدامها داخل تايمر متكرر والرندر خصوصاً

    معلومات زي كذا المفروض ترسل التريقر عند فتح اللوحة كمثال لا اكثر ولا اقل، وكذا تكون وفرت من استهلاك معالج السيرفر وغيره من الامور الاخرى

  7. 45 minutes ago, VenomNX said:

    SERVER

    
    function ON_RENDER_BEGIN()	local ACC = getPlayerAccount(source);	if ACC and not isGuestAccount(ACC) then		local acc_name = getAccountName(ACC);		local ip = getPlayerIP(source);		local serial = getPlayerSerial(source);		local data = {};		data.acc_name = acc_name;		data.ip = ip;		data.serial = serial;		triggerClientEvent(source,"ON_RECIEVE_DATA",source,data);		data = nil;		return true;	else		return false;	endendaddEvent("ON_RENDER_BEGIN",true);addEventHandler("ON_RENDER_BEGIN",root,ON_RENDER_BEGIN);

      

    CLIENT

    
    local ACCOUNT_NAME = "N/A";local IP = "N/A";local SERIAL = "N/A";function DRAW_UI()		dxDrawRectangle(736, 410, 0, 0, tocolor(255, 255, 255, 255), false)	dxDrawLine(0 - 1, 1050 - 1, 0 - 1, 1080, tocolor(145, 0, 0, 255), 1, false)	dxDrawLine(1920, 1050 - 1, 0 - 1, 1050 - 1, tocolor(145, 0, 0, 255), 1, false)	dxDrawLine(0 - 1, 1080, 1920, 1080, tocolor(145, 0, 0, 255), 1, false)	dxDrawLine(1920, 1080, 1920, 1050 - 1, tocolor(145, 0, 0, 255), 1, false)	dxDrawRectangle(0, 1050, 1920, 30, tocolor(0, 0, 0, 255), false)			triggerServerEvent("ON_RENDER_BEGIN",localPlayer);	local name = getPlayerName(localPlayer) -- جلـب ألاسم ألاعب	dxDrawText("Name:"..name, 3, 1056, 200, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			dxDrawText("Account: "..ACCOUNT_NAME, 210, 1056, 407, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)				local Team = getTeamName (getPlayerTeam (localPlayer)) or 'None' -- جلب ألأفريق ألذي يوجد به ألآعب	dxDrawText("Team: "..Team, 417, 1056, 614, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)	local Skin = getPlayerSkin(localPlayer)	dxDrawText("ID Skin: "..Skin, 624, 1056, 821, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local money = getPlayerMoney(localPlayer)-- جلب مبلغ ألآعب	dxDrawText("Money: "..money, 831, 1056, 1028, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local weaponType = getPedWeapon ( localPlayer ) -- جلب رقم ألسلآح	dxDrawText("ID Weapon: "..weaponType, 1038, 1056, 1235, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local Health = getElementHealth ( localPlayer ) -- جلب كمية ألدم 	dxDrawText("Health: "..Health, 1245, 1056, 1442, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local me = getLocalPlayer ( ) -- مدري وش قصته , لا تحذفة يخرب مجرب ض	local armor = getPedArmor ( me ) -- جلب كمية ألدرع	dxDrawText("Armour: "..armor, 1452, 1056, 1649, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local ping = getPlayerPing(localPlayer)-- جلب سرعـه ألارتنرنت للاعب	dxDrawText("Ping: "..ping, 1659, 1057, 1723, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)			local fps = getFPSLimit(localPlayer) -- جلب حد ألفبس لـ سيرفر	dxDrawText("FPS: "..fps, 1733, 1057, 1797, 1075, tocolor(144, 0, 0, 255), 1.30, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(10 - 1, 1030 - 1, 10 - 1, 1046, tocolor(101, 0, 0, 254), 1, false)	dxDrawLine(364, 1030 - 1, 10 - 1, 1030 - 1, tocolor(101, 0, 0, 254), 1, false)	dxDrawLine(10 - 1, 1046, 364, 1046, tocolor(101, 0, 0, 254), 1, false)	dxDrawLine(364, 1046, 364, 1030 - 1, tocolor(101, 0, 0, 254), 1, false)	dxDrawRectangle(10, 1030, 354, 16, tocolor(1, 0, 0, 254), false)			dxDrawText("Serial: "..SERIAL, 13, 1030, 364, 1046, tocolor(114, 255, 144, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(1598 - 1, 1032 - 1, 1598 - 1, 1046, tocolor(117, 0, 0, 254), 1, false)	dxDrawLine(1910, 1032 - 1, 1598 - 1, 1032 - 1, tocolor(117, 0, 0, 254), 1, false)	dxDrawLine(1598 - 1, 1046, 1910, 1046, tocolor(117, 0, 0, 254), 1, false)	dxDrawLine(1910, 1046, 1910, 1032 - 1, tocolor(117, 0, 0, 254), 1, false)	dxDrawRectangle(1598, 1032, 312, 14, tocolor(0, 0, 0, 254), false)		dxDrawText("IP: "..IP, 1602, 1032, 1910, 1046, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(374 - 1, 1030 - 1, 374 - 1, 1046, tocolor(123, 0, 0, 254), 1, false)	dxDrawLine(673, 1030 - 1, 374 - 1, 1030 - 1, tocolor(123, 0, 0, 254), 1, false)	dxDrawLine(374 - 1, 1046, 673, 1046, tocolor(123, 0, 0, 254), 1, false)	dxDrawLine(673, 1046, 673, 1030 - 1, tocolor(123, 0, 0, 254), 1, false)	dxDrawRectangle(374, 1030, 299, 16, tocolor(1, 0, 0, 254), false)			dxDrawText("Name Skin: ", 378, 1030, 677, 1046, tocolor(255, 255, 255, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)	dxDrawLine(1413 - 1, 1032 - 1, 1413 - 1, 1046, tocolor(119, 0, 0, 254), 1, false)	dxDrawLine(1588, 1032 - 1, 1413 - 1, 1032 - 1, tocolor(119, 0, 0, 254), 1, false)	dxDrawLine(1413 - 1, 1046, 1588, 1046, tocolor(119, 0, 0, 254), 1, false)	dxDrawLine(1588, 1046, 1588, 1032 - 1, tocolor(119, 0, 0, 254), 1, false)	dxDrawRectangle(1413, 1032, 175, 14, tocolor(0, 1, 1, 254), false)			local time = getRealTime()-- جلب ألساعه	local hours = time.hour-- ساعه	local minutes = time.minute -- دقيقة	local seconds = time.second -- الثانية	-- Make sure to add a 0 to the front of single digits.	if (hours < 5) then -- الساعة		hours = "0"..hours	end	if (minutes < 5) then -- الدقيقة		minutes = "0"..minutes	end	if (seconds < 5) then -- الثانية		seconds = "0"..seconds		end        dxDrawText("Time: "..hours..":"..minutes..":"..seconds , 1414, 1031, 1588, 1046, tocolor(0, 255, 0, 255), 1.00, "default-bold", "left", "top", false, false, false, false, false)        dxDrawLine(687 - 1, 1030 - 1, 687 - 1, 1046, tocolor(15, 102, 82, 254), 1, false)        dxDrawLine(1404, 1030 - 1, 687 - 1, 1030 - 1, tocolor(15, 102, 82, 254), 1, false)        dxDrawLine(687 - 1, 1046, 1404, 1046, tocolor(15, 102, 82, 254), 1, false)        dxDrawLine(1404, 1046, 1404, 1030 - 1, tocolor(15, 102, 82, 254), 1, false)        dxDrawRectangle(687, 1030, 717, 16, tocolor(59, 59, 59, 159), false)        dxDrawText("Welcome To Server", 687, 1031, 1398, 1046, tocolor(102, 158, 145, 254), 1.00, "default-bold", "center", "top", false, false, false, false, false)    endendaddEventHandler("onClientRender" , root, DRAW_UI)function ON_RECIEVE_DATA(data)	if data then		ACCOUNT_NAME = data.acc_name;		IP = data.ip;		SERIAL = data.serial;		return true;	end	return false;endaddEvent("ON_RECIEVE_DATA",true);addEventHandler("ON_RECIEVE_DATA",root,ON_RECIEVE_DATA);
    triggerServerEvent("ON_RENDER_BEGIN",localPlayer);

    خطأ استخدام التريقر بداخل رندر

×
×
  • Create New...