Jump to content

custom blips - مشكلة بـ


Recommended Posts

سلام عليكم

معي مشكلة ب كوستم بليب

آبي آلكومآند , يحط صور عليآ , كل لمآ آتحرك يحط صورة عليآ , ويشيل آلصورة آلقديمة

لكن آلمشكلة مآ يحذف آلصورة آلقديمة

-- # Server
 addCommandHandler("aw",
	function (source)
		setTimer(function()
		local x,y,z = getElementPosition(source)
		triggerClientEvent(root,"addBlip",root,x,y,z)
		end, 1000,0)
	end
)

-- # Client

addEvent ( "addBlip", true )
addEventHandler ( "addBlip", root,
	function (x,y,z)
		if getElementData(resourceRoot,"theBlib") then
				exports.customblips:destroyCustomBlip ( getElementData(resourceRoot,"theBlib") )
		else
		setElementData(resourceRoot,"theBlib", exports.customblips:createCustomBlip ( x,y, 20, 20, "photo.png" ))
		end
	end
)

 

Link to comment
-- # Server
 addCommandHandler( "aw" ,
	function ( source )
		setTimer ( function (   )
			local pos = getElementPosition ( source )
			triggerClientEvent ( root , "addBlip" , source , pos[1] , pos[2] , pos[3] )
		end , 1000 , 0 )
	end
)

-- # Client

addEvent ( "addBlip", true )
addEventHandler ( "addBlip" , root ,
	function ( x , y , z )
		if ( isVisiable ) then
			exports.customblips:destroyCustomBlip ( bilp )
			local isVisiable = false
		end
		bilp = exports.customblips:createCustomBlip ( x , y , 20, 20, "photo.png" )
		local isVisiable = true
	end
)

 

Link to comment
23 minutes ago, Debo15 said:

-- # Server
 addCommandHandler( "aw" ,
	function ( source )
		setTimer ( function (   )
			local pos = getElementPosition ( source )
			triggerClientEvent ( root , "addBlip" , source , pos[1] , pos[2] , pos[3] )
		end , 1000 , 0 )
	end
)

-- # Client

addEvent ( "addBlip", true )
addEventHandler ( "addBlip" , root ,
	function ( x , y , z )
		if ( isVisiable ) then
			exports.customblips:destroyCustomBlip ( bilp )
			local isVisiable = false
		end
		bilp = exports.customblips:createCustomBlip ( x , y , 20, 20, "photo.png" )
		local isVisiable = true
	end
)

 

مآ ظبطت 

 

Link to comment
-- # Server
addCommandHandler('aw', function(player)
    setElementData(player, 'playerCustomBlip', true);
end)

-- # Client
local playerBlips = {};
local customblips = exports.customblips;

setTimer(function()
    local player = getElementsByType('player');
    for index = 1, #player do
        if getElementData(player[index], 'playerCustomBlip') then
            local px, py = getElementPosition(player[index]);
            local oldBlip = playerBlips[player[index]]
            if oldBlip then
                customblips:destroyCustomBlip(oldBlip);
            end
            playerBlips[player[index]] = customblips:createCustomBlip(px, py, 20, 20, 'photo.png');
        end
    end
end, 100, 0)

 

Edited by #,xiRocKyz
Link to comment
3 hours ago, Abdul KariM said:

@#,xiRocKyz @Debo15 ترا مايحتاج تحذف في وظيفة بالسكربت نفسه تغير مكان البلب


setCustomBlipPosition

والافضل يكون فيه  تحقق ان الاعب يتحرك عن طريق

https://wiki.multitheftauto.com/wiki/IsElementMoving

 

المود هذا انا ما بستخدمه حتى اعرف الدوال الخاصة به + انا عدلت على اكواده بس

19 hours ago, Mr.Mostafa said:

مآ ظبطت 

انتا بدك لما يكتب الكلمة تظهر العلامة على الخريطة وتتبع الاعب وين ما يروح ولا تبقى مكانها 

+ هات الدوال الي مستخدمهم انت من الأكسبورت 

 قبل هيك تأكد انك مشغل المود ( الي مسوي له اكسبورت )  و حاط القيم المطلوبة لحصول الوظيفة  الخاصة بالاكسبورت

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