
TheOtherSide
Members-
Posts
30 -
Joined
-
Last visited
Everything posted by TheOtherSide
-
وش علاقة موضوع الرجال ب triggerEvent triggerEvent وانت تقول يمديك تسوي حدث بهالوظيفه الي طارحها هو , ماجبت طاري
-
? هالوظيفه مايمديك تسوي فيها حدث لها صله بأنها دي بق لكنها بشكل ادق, مالها صله بأنك تسوي حدث
-
multiLineForText multiLineForText(string YourText,int TheMaximumNumberPerLine) فايدة الوظيفة تقسيم نص طويل الى اكثر من نص مثلا عندي نص فيه 30 حرف وابي كل 5 حروف من هالنص يكونو لحالهم الوظيفة راح ترجع لك جدول مقسمه فيه النصوص function multiLineForText(txt,maxForEachLine) if not( type(txt) == 'string' and type(maxForEachLine) == 'number' ) then return false end array = {} _txt = '' _count = 1 if ( #txt >= maxForEachLine ) then for i=1,#txt do _txt = _txt..''..string.sub(txt,i,i) if ( i == maxForEachLine ) then array[#array+1] = _txt _txt = '' _count = _count+1 elseif ( i == maxForEachLine*_count ) then array[#array+1] = _txt _txt = '' _count = _count+1 else if ( i == #txt and _txt ~= '' ) then array[#array+1] = _txt end end end else array[#array+1] = txt end return array end مثال x = 'hihihihihihihihihihihiheyheyheyheyheyheyheyheyheyheyheyheyheyheyhey' for i,v in ipairs(multiLineForText(x,4)) do outputChatBox(v) -- راح يطلع فكل رساله 4 حروف -- مثلا اول رساله بتكون hihi end
-
لما تستخدم debugscript 3 راح غالباً تجيك الأخطاء للسكربتات الشغاله الا في حالت انه فيه سكربت من السكربتات الشغاله فنكشن الأوتبت ديبق عموماً ذي الوظيفه تعطيك تفاصيل ادق للي جالس يحصل فالسكربتات او بأمكانك تحدد سكربت معين او وظيفه معينه حتى لو ماكان فيه أخطاء راح يطلع لك تفاصيل وش جالس يصير فالحدث المعين مثلا او فجميع الأحداث الي فالسكربتات , الوظيفه هذي ادفانس شوي وماضن انه له داعي تتطرق لها حالياً
-
server addEventHandler("onResourceStart", resourceRoot, function() for _,player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if account and not isGuestAccount(account) then local level, xp = (tonumber(getAccountData(account, "level"))) or 1, (tonumber(getAccountData(account, "xp"))) or 0 setElementData(player, "level", level) setElementData(player, "xp", xp) end end end ) addEventHandler("onPlayerLogin", root, function(_,account) local level, xp = (tonumber(getAccountData(account, "level"))) or 1, (tonumber(getAccountData(account, "xp"))) or 0 setElementData(source, "level", level) setElementData(source, "xp", xp) end ) addEventHandler("onPedWasted", root, function(_,killer) if killer and getElementType(killer) == "player" then setElementData(killer, "xp", (getElementData(killer, "xp") or 0) + 10) checkNextLevel(killer) saveDataIntoAcc(killer) end end ) function checkNextLevel(player) local currentLevel = getElementData(player, "level") or 1 local neededXP = currentLevel*100 local currentXP = getElementData(player, "xp") or 0 if currentXP >= neededXP then setElementData(player, "level", currentLevel+1) setElementData(player, "xp", currentXP-neededXP) outputChatBox("you've promoted to level "..currentLevel+1, player, 255, 255, 0, true) end end addEventHandler("onPlayerQuit", root, function() saveDataIntoAcc(source) end ) function saveDataIntoAcc(plr) local account = getPlayerAccount(plr) if not isGuestAccount(account) then local level, xp = getElementData(plr, "level"), getElementData(plr, "xp") setAccountData(account, "xp", xp) setAccountData(account, "level", level) end end client local sw,sh = guiGetScreenSize() addEventHandler("onClientRender", root, function() local level = getElementData(localPlayer, "level") or 1 local xp = getElementData(localPlayer, "xp") or 0 if level and xp then dxDrawLine(40 - 1, 827 - 1, 40 - 1, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 827 - 1, 40 - 1, 827 - 1, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(40 - 1, 854, 249, 854, tocolor(1, 251, 236, 255), 1, false) dxDrawLine(249, 854, 249, 827 - 1, tocolor(1, 251, 236, 255), 1, false) local precentage = ((xp/level)*100)*100 if precentage >= 100 then precentage = 0 end local bar = precentage*2.75 dxDrawRectangle(40, 827, 209, 27, tocolor(127, 126, 126, 255), false) dxDrawText(" Level: "..level.." - XP : "..xp.." / "..(level*100), 45, sh-30, 239, sh-30, tocolor(255, 255, 255, 255), 1.00, "default", "left", "top", false, false, false, false, false)--832 end end )
-
i don’t think he’s really care about the width as much as viewing the full word , therefore i think @MrTasty’s is useful for what @XML asked for
-
i know the mechanism already but this is what i wanted https://wiki.multitheftauto.com/wiki/Resource_Web_Access thanks bro
-
I got that thanks , but ' callRemote ' I can access another server but how to access a specific db , like I have a script called Test1 and there's a db in the script called img.db , how to access this db ? from another server, provide an example please , I have seen the wiki already . I don't know if this is possible ?
-
I didn't get ur full point yet, do u want multi lines in the list for the same length 100% or just it should be about the length not exactly the same length but with full word? if u need same length 100% and full word , that's in my opinion impossible .
-
use notepad ++ for example left ctrl + h , there's an option ( find what ) ( replaced with ) find ( = ) replace with ( , ) then press replace for all
-
if u mean u have long text and u want to insert it as multi line in the list depending in the text length try my function : function multiLineForText(txt,maxForEachLine) if not( txt and maxForEachLine ) then return end array = {} _txt = '' _count = 1 if ( #txt >= maxForEachLine ) then for i=1,#txt do _txt = _txt..''..string.sub(txt,i,i) if ( i == maxForEachLine ) then array[#array+1] = _txt _txt = '' _count = _count+1 elseif ( i == maxForEachLine*_count ) then array[#array+1] = _txt _txt = '' _count = _count+1 else if ( i == #txt and _txt ~= '' ) then array[#array+1] = _txt end end end else array[#array+1] = txt end return array end use it as a table , for example : function multiLineForText(txt,maxForEachLine) if not( txt and maxForEachLine ) then return end array = {} _txt = '' _count = 1 if ( #txt >= maxForEachLine ) then for i=1,#txt do _txt = _txt..''..string.sub(txt,i,i) if ( i == maxForEachLine ) then array[#array+1] = _txt _txt = '' _count = _count+1 elseif ( i == maxForEachLine*_count ) then array[#array+1] = _txt _txt = '' _count = _count+1 else if ( i == #txt and _txt ~= '' ) then array[#array+1] = _txt end end end else array[#array+1] = txt end return array end local list = guiCreateGridList ( 0, 0, 350,350,false ) local column = guiGridListAddColumn( list, 'Player', 1 ) txt_ = 'test1test1test1test1test1test1test1test2test2test2test2test2test2test2test3test3test3test3test3test3test34fewwwwosk' for i,v in ipairs(multiLineForText(txt_,35)) do -- 35 change it to an appropriate max for text per line local row = guiGridListAddRow ( list ) guiGridListSetItemText ( list, row, column,v, false, false ) end
-
hello can I create database in my script and make a connection to it from another server ( how give me an example ) ? and can I insert an image for it ? is there anyway to insert an image without using base64string ? thanks