#Rmad~> Posted June 9, 2014 Share Posted June 9, 2014 السلام عليكم ورحمة الله ياخوان بغيتكم تشوفون لي وش المشكلة. لان ماوجهتني اخطأ بالديبوق function Text () name = getPlayerName(localPlayer) local r, g, b = getPlayerNametagColor(localPlayer) hex = RGBToHex(r, g, b) dxDrawText (""..hex.."##ff0000Kabos:#ffffff"..name.."",size*5,(screenHeight-dxGetFontHeight(size*0.4,'bankgothic')/2)-size*50, 20, 20, tocolor ( 255, 255, 255, 255 ),size*0.800,"default-bold") end addEventHandler("onClientRender",getRootElement(),Text) function RGBToHex(red, green, blue, alpha) if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255))) then return nil end if(alpha) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end وايضا هاذا function LanguageChat(thePlayer, cmd, ...) local msg = table.concat({...}, " ") for _,players in ipairs(getElementsByType("player")) do local r, g, b = getPlayerNametagColor (thePlayer) local name = getPlayerName(thePlayer) local mycountry = exports.admin:getPlayerCountry(thePlayer) local playerscountry = exports.admin:getPlayerCountry(players) if (playerscountry == mycountry) then if (msg and msg ~= "") then outputChatBox("#A30000[#ffffff"..mycountry.."#A30000] #ffffff"..name.."#ffffff: "..msg.."",players,r, g, b,true) end end end end addCommandHandler("Language",LanguageChat) addEventHandler("onPlayerJoin",root, function () bindKey(source,"L","down","chatbox","Language") end ) addEventHandler("onResourceStart",resourceRoot, function () for index, player in ipairs(getElementsByType("player")) do bindKey(player,"L","down","chatbox","Language") end end ) واجهتني فيه مشاكل بالديبوق وحاولت احلها ومامشت معي warning:[admin]\server\admin_ip2c.lua:15:bad argument @ 'GetPlayerIP'[xepected element at argument 1 ,got nil warning:[admin]\server\admin_ip2c.lua:19 :bad argument @'gettok' warning:[admin]\server\admin_ip2c.lua:20 :bad argument @'gettok' Error:[admin]\server\admin_ip2c.lua:20:attempt to perform arithmetic on a bollean value Error:[script]language.lua:7:call:failed to call "admin:getPlayerCountry Error[script]language.lua:10:attempt to concatenate global "Country" (a boolean value) Link to comment
#DRAGON!FIRE Posted June 9, 2014 Share Posted June 9, 2014 function RGBToHex(red, green, blue, alpha) if ( (red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255) ) ) then return nil end if ( alpha ) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end addEventHandler( "onClientRender", root, function( ) local pName = getPlayerName( localPlayer ) local r, g, b = getPlayerNametagColor( localPlayer ) dxDrawText (""..RGBToHex(r, g, b).."##ff0000Kabos:#ffffff"..name.."",size*5,(screenHeight-dxGetFontHeight(size*0.4,'bankgothic')/2)-size*50, 20, 20, tocolor ( 255, 255, 255, 255 ),size*0.800,"default-bold"_,_,_,_,_,true) end ) وبالمناسبة الكود الثاني هو صحيح .. بس سكربت اللغات ما يجي بالطريقة ذي المشكلة من الادمنية .. حمل اخر اصدار الادمنية Link to comment
#Rmad~> Posted June 9, 2014 Author Share Posted June 9, 2014 function RGBToHex(red, green, blue, alpha) if ( (red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255) or (alpha and (alpha < 0 or alpha > 255) ) ) then return nil end if ( alpha ) then return string.format("#%.2X%.2X%.2X%.2X", red,green,blue,alpha) else return string.format("#%.2X%.2X%.2X", red,green,blue) end end addEventHandler( "onClientRender", root, function( ) local pName = getPlayerName( localPlayer ) local r, g, b = getPlayerNametagColor( localPlayer ) dxDrawText (""..RGBToHex(r, g, b).."##ff0000Kabos:#ffffff"..name.."",size*5,(screenHeight-dxGetFontHeight(size*0.4,'bankgothic')/2)-size*50, 20, 20, tocolor ( 255, 255, 255, 255 ),size*0.800,"default-bold"_,_,_,_,_,true) end ) وبالمناسبة الكود الثاني هو صحيح .. بس سكربت اللغات ما يجي بالطريقة ذي المشكلة من الادمنية .. حمل اخر اصدار الادمنية جربت كودك شغال تمام بس مشكلته مايطلع الالوان الاسم سادة وبنسبة لثاني انا محمل اخر اصدار للادمنية ومني معدل فيه شي وكالة وبالمناسبة انا ابي اسويه مثلا كتبت بالعربي يجي قبل كلامي بالتاج كلام واذا كتبت بالانجليزي نفس الحكاية يجي قبل اسمي كلام مهوب بذي الطريقة ادري ان في نقص بالكود Link to comment
#DRAGON!FIRE Posted June 9, 2014 Share Posted June 9, 2014 ? RGBTOHEXT اي اسم تقصد ؟ . حق اللي مستخدم فيه Kabos ذي الكلمة ما تجي باللوان ؟ Link to comment
#Rmad~> Posted June 9, 2014 Author Share Posted June 9, 2014 ? RGBTOHEXT اي اسم تقصد ؟ . حق اللي مستخدم فيه Kabos ذي الكلمة ما تجي باللوان ؟ لالا معليش الغلط مني مانتبهت للهيكس الي حطيته الحين الكود الثاني خلكم منه بدون معنا الحين ابي اخلي مثلا كتبت بشات بالاحرف العربية ابغاه يطلع لي كلام قبل الاسم مثلا [English]#Rmad~>:Hi Forum [Arabic]#Rmad~>:اهلا وش احتاج ؟ (ماقصد شات اللغات ) Link to comment
#DRAGON!FIRE Posted June 9, 2014 Share Posted June 9, 2014 (edited) addEventHandler( "onClientRender", root, function( ) local pName = getPlayerName( localPlayer ) dxDrawText ( "YourName:"..pName,size*5,(screenHeight-dxGetFontHeight(size*0.4,'bankgothic')/2)-size*50, 20, 20, tocolor ( 127, 255, 0, 255 ),size*0.800,"default-bold", "left", "top", false, false, true, true, false ) end ) بـ النسبة لسكربت اللغات يوم يتكلم انت جالس تجيب البلد حقه يعني مثلأ [ SA ] ZA7F : Hi Edited June 9, 2014 by Guest Link to comment
#Rmad~> Posted June 9, 2014 Author Share Posted June 9, 2014 مانفع جربت اخليه كذا وصارالكلام كله ابيض function text () local pName = getPlayerName(localPlayer) local color1, color2, color3 = getPlayerNametagColor(localPlayer) local playercolor = string.format ("#%02X%02X%02X", color1, color2, color3 ) dxDrawText ("Name:"..playercolor..""..pName,size*5,(screenHeight-dxGetFontHeight(size*0.4,'bankgothic')/2)-size*63, 20, 20, tocolor ( 255,255, 255, 255 ),size*0.800,"default-bold",_,_,_,_,_,true) end addEventHandler("onClientRender",root,text) Link to comment
#Rmad~> Posted June 9, 2014 Author Share Posted June 9, 2014 عدلت ردي .. جربه الحين كل الكلام بلون الهكس 00ff00 Link to comment
#Rmad~> Posted June 9, 2014 Author Share Posted June 9, 2014 كل الكلام بلون الهكس 00ff00 Link to comment
#Rmad~> Posted June 9, 2014 Author Share Posted June 9, 2014 function text () local pName = getPlayerName(localPlayer) dxDrawText ( "YourName:"..pName,size*5,(screenHeight-dxGetFontHeight(size*0.4,'bankgothic')/2)-size*50, 20, 20, tocolor ( 127, 255, 0, 255 ),size*0.800,"default-bold", "left", "top", false, false, true, true, false ) end addEventHandler("onClientRender",root,text) Link to comment
#DRAGON!FIRE Posted June 9, 2014 Share Posted June 9, 2014 (edited) طيب انت حاط اللوان لـ نككـ ؟ !! انا جربته وشغال مية مية ويجي الالوان جربته حتى مع اكثر من لون وتمام . Edited September 11, 2014 by Guest Link to comment
#Rmad~> Posted June 10, 2014 Author Share Posted June 10, 2014 طيب انت حاتط اللوان لـ نككـ ؟ !!انا جربته وشغال مية مية ويجي الالوان يب حاط كيف اشتغل معك !! غريبه Link to comment
#DRAGON!FIRE Posted June 10, 2014 Share Posted June 10, 2014 اغير نكي واحط اللوان وكل شي تمام شيكـ عندك يمكن انت مو ناسخ الكود كامل او ممعدل شي ذذ 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