yasin0 Posted April 13, 2018 Share Posted April 13, 2018 السلام عليكم عندي مشكلة انه يتحقق بالسيريال لو اللاعب سيرياله صح تظهر الصورة فوقه ويشوفها الكل المشكلة الصورة تطلع لي حتى لو شلت السيريال --server side addEventHandler('onPlayerLogin',root,function() if getPlayerSerial(source) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' then setElementData(source,'serial') end end ) --client side function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end tag = dxCreateTexture("admin.png") addEventHandler("onClientPreRender",root, function () for k,v in ipairs(getElementsByType("player")) do getElementData(localPlayer,'serial') dxDrawImageOnElement(v,tag) end end ) Link to comment
MrBiG Posted April 13, 2018 Share Posted April 13, 2018 --server side addEventHandler( 'onPlayerLogin' , root , function() if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then setElementData( source , 'showTag' ) end end ) --client side function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end tag = dxCreateTexture( 'admin.png' ) addEventHandler( 'onClientPreRender' , root , function ( ) for k , v in ipairs( getElementsByType("player") ) do isSuperPlayer = getElementData( localPlayer , 'showTag' ) if ( isSuperPlayer ) then dxDrawImageOnElement( v , tag ) end end end ) على اساس ما فيها خطأ dxDrawImageOnElement انا ما شفت اكواد وظيفة (so Ez جرب الاكواد( مشكلتك Link to comment
yasin0 Posted April 13, 2018 Author Share Posted April 13, 2018 1 hour ago, Debo15 said: --server side addEventHandler( 'onPlayerLogin' , root , function() if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then setElementData( source , 'showTag' ) end end ) --client side function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end tag = dxCreateTexture( 'admin.png' ) addEventHandler( 'onClientPreRender' , root , function ( ) for k , v in ipairs( getElementsByType("player") ) do isSuperPlayer = getElementData( localPlayer , 'showTag' ) if ( isSuperPlayer ) then dxDrawImageOnElement( v , tag ) end end end ) على اساس ما فيها خطأ dxDrawImageOnElement انا ما شفت اكواد وظيفة (so Ez جرب الاكواد( مشكلتك لا تظهر الصورة كما يوجد ارجمنت ناقص وهو الداتا يقول الثالث none Link to comment
MrBiG Posted April 13, 2018 Share Posted April 13, 2018 37 minutes ago, yasin0 said: لا تظهر الصورة كما يوجد ارجمنت ناقص وهو الداتا يقول الثالث none جرب بطريقة التريقر هي تسوي لاق اقل --server side addEventHandler( 'onPlayerLogin' , root , function() if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then triggerClientEvent ( root , 'showTag', source ) end end ) --client side function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end tag = dxCreateTexture( 'admin.png' ) addEvent( 'showTag' , true ) function showTag ( ) dxDrawImageOnElement( source , tag , 20 , 30 , 30 ) end addEventHandler( 'showTag' , root , showTag ) الكود مو مجرب Link to comment
yasin0 Posted April 14, 2018 Author Share Posted April 14, 2018 14 hours ago, Debo15 said: جرب بطريقة التريقر هي تسوي لاق اقل --server side addEventHandler( 'onPlayerLogin' , root , function() if ( getPlayerSerial( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' ) then triggerClientEvent ( root , 'showTag', source ) end end ) --client side function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end tag = dxCreateTexture( 'admin.png' ) addEvent( 'showTag' , true ) function showTag ( ) dxDrawImageOnElement( source , tag , 20 , 30 , 30 ) end addEventHandler( 'showTag' , root , showTag ) الكود مو مجرب مايشتغل مع عدم وجود اخطاء Link to comment
Abdul KariM Posted April 14, 2018 Share Posted April 14, 2018 جرب هذا --server side addEventHandler('onPlayerLogin',root, function ( ) if getPlayerSerial ( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' then setElementData( source ,'serial', true ) end end ) function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end tag = dxCreateTexture("admin.png") addEventHandler("onClientPreRender",root, function ( ) for k,v in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( v ,'serial' ) == true then dxDrawImageOnElement( v , tag ) end end end ) 1 Link to comment
yasin0 Posted April 15, 2018 Author Share Posted April 15, 2018 20 hours ago, Abdul KariM said: جرب هذا --server side addEventHandler('onPlayerLogin',root, function ( ) if getPlayerSerial ( source ) == 'E7EF1AEEA73E5AD8CB4B1E6FCD30FF3' then setElementData( source ,'serial', true ) end end ) function dxDrawImageOnElement(TheElement,Image,distance,height,width,R,G,B,alpha) local x, y, z = getElementPosition(TheElement) local x2, y2, z2 = getElementPosition(localPlayer) local distance = distance or 20 local height = height or 1 local width = width or 1 local checkBuildings = checkBuildings or true local checkVehicles = checkVehicles or false local checkPeds = checkPeds or false local checkObjects = checkObjects or true local checkDummies = checkDummies or true local seeThroughStuff = seeThroughStuff or false local ignoreSomeObjectsForCamera = ignoreSomeObjectsForCamera or false local ignoredElement = ignoredElement or nil if (isLineOfSightClear(x, y, z, x2, y2, z2, checkBuildings, checkVehicles, checkPeds , checkObjects,checkDummies,seeThroughStuff,ignoreSomeObjectsForCamera,ignoredElement)) then local sx, sy = getScreenFromWorldPosition(x, y, z+height) if(sx) and (sy) then local distanceBetweenPoints = getDistanceBetweenPoints3D(x, y, z, x2, y2, z2) if(distanceBetweenPoints < distance) then dxDrawMaterialLine3D(x, y, z+1+height-(distanceBetweenPoints/distance), x, y, z+height, Image, width-(distanceBetweenPoints/distance), tocolor(R or 255, G or 255, B or 255, alpha or 255)) end end end end tag = dxCreateTexture("admin.png") addEventHandler("onClientPreRender",root, function ( ) for k,v in ipairs ( getElementsByType ( "player" ) ) do if getElementData ( v ,'serial' ) == true then dxDrawImageOnElement( v , tag ) end end end ) يعطيك العافية سؤال : اشرح لي كيف سويته ووش اخطائي Link to comment
Abdul KariM Posted April 15, 2018 Share Posted April 15, 2018 @yasin0 كان في عندك غلط نسيت تحط الارقمنت الثالث للداتا وعندك جهة كلينت ماسويت تحقق بالطريقة الصحيحة 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