-
Posts
142 -
Joined
-
Last visited
Posts posted by JustP
-
-
-
5 hours ago, !#DesTroyeR_,) said:
اشوف تخبيص واجد بكودك
ليه ما سويت متغير احسن
-- ملف السيرفر addEventHandler( "onPlayerJoin", root, function() triggerClientEvent( source, "startBar", source ) end ) -- ملف الكلينت Bar = guiCreateProgressBar(0.25, 0.93, 0.48, 0.05, true) guiSetVisible( Bar, false ) addEvent( "startBar", true ) addEventHandler( "startBar", root, function() setTimer( function() if not guiGetVisible( Bar ) then guiSetVisible( Bar, true ) guiProgressBarSetProgress( Bar, 10 ) if guiProgressBarGetProgress( Bar ) == 100 then guiSetVisible( Bar, false) end end end, 1000, 8 ) end )
-
local Group1 = ""..getElementData ( resourceRoot, "group1" ).."" local Group2 = "" Groups = { "Admin", "Console", } -- by justp function justA ( thePlayer, commandName, ... ) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) for i, v in ipairs ( Groups ) do if isObjectInACLGroup ( "user."..accName, aclGetGroup ( v ) ) then local justp = { ... } local textt = table.concat ( justp, " " ) setElementData ( resourceRoot, "group1", textt ) outputChatBox(getElementData ( resourceRoot, "group1" ), thePlayer) exports["guimessages"]:outputServer(thePlayer, "#C38EC7[Clanwar] group1 set to " ..getElementData ( resourceRoot, "group1" ), 255, 255, 0) end end end addCommandHandler('setgtext', justA)
في مشكلة بـ السطر رقم واحد يقول
attempt to concatenate a boolean value
-
43 minutes ago, Jamayka said:
شباب كيف مثلا اسوي لما بدي احط للاعب . سريالك الشخصي : ويعطيه سرياله على اللوحه او مثلا لفلك : ويعطيه كم لفله على الجيو
اللفل احتمال داتا
فلذلك تسوي
local level = getElementData(source, 'level') -- serial local serial = getPlayerSerial(source)
-
-
-
9 hours ago, SWAT-M7MD said:
ابي 3 صور تضهر ف 3 احداثيات و ما ادري ليش كودي ما اشتغل
انا مسوي المود كلنت فقط
addEventHandler("onClientRender",getRootElement(), function() local dr32 = dxCreateTexture("Gang1.png") addEventHandler( "onClientRender", root, function ( ) local x, y, z = 34.83220,382.35397,2.76875 dxDrawMaterialLine3D(x, y, z+3.6, x, y, z+2, dr32, 2.5, tocolor(255,255,255,255)) end ) addEventHandler("onClientRender",getRootElement(), function() local dr32 = dxCreateTexture("Gang2.png") addEventHandler( "onClientRender", root, function ( ) local x, y, z = 196.19046020508, 1916.88671875, 80.6 dxDrawMaterialLine3D(x, y, z+3.6, x, y, z+2, dr32, 2.5, tocolor(255,255,255,255)) end ) addEventHandler("onClientRender",getRootElement(), function() local dr32 = dxCreateTexture("Mafia1.png") addEventHandler( "onClientRender", root, function ( ) local x, y, z = 197.19046020508, 1915.88671875, 80.6 dxDrawMaterialLine3D(x, y, z+3.6, x, y, z+2, dr32, 2.5, tocolor(255,255,255,255)) end )
الغلط ,انو في فاكشنات انت ماغالقها ولا افنتات
-
36 minutes ago, Simple. said:
local showComponents = false bindKey("f5", "down", function() showComponents = not showComponents end) addEventHandler("onClientRender", root, function() if (showComponents) then for _, veh in pairs(getElementsByType("vehicle", root, true)) do for compname in pairs(veh:getComponents()) do local x, y = getScreenFromWorldPosition(veh:getComponentPosition(compname, "world")) if (x) then dxDrawText(compname, x, y, 0, 0, tocolor(255, 255, 255)) end end end end end )
هذا مثال من الويكي ممكن يساعدك
شكرا لكن
حق
x اقدر اسوي مثلهif x > 2 then
وكذا ؟
-
12 minutes ago, jakson said:
ERROR: Loading script failed: name\s.lua:5: ')'expected near 'then'
local hydra = { } addEventHandler ( "onVehicleStartEnter" , root , function ( ) if getTeamName( getPlayerTeam ( source ) == "SWAT" ) then if getElementModel ( source ) == 520 then if isElement ( hydra [ source ] ) ) then destroyElement ( hydra [ source ] ) end hydra [ source ] = createBlipAttachedTo ( source , 9 , 0,2,255,0,0,255,0,16383.0,getTeamFromName("SWAT")) end end end ) ; addEventHandler ( "onVehicleStartExit" , root , function ( ) if ( getElementModel ( source ) == 520 and isElement ( hydra [ source ] ) ) then destroyElement ( hydra [ source ] ) hydra [ source ] = nil end end )
-
-
1 hour ago, jakson said:
ظهر الخطء
ERROR: Loading script failed: name\s.lua:5:unexpected symbol near 'if'
local hydra = { } addEventHandler ( "onVehicleStartEnter" , root , function ( ) if getTeamName( getPlayerTeam ( source ) == "SWAT" then if getElementModel ( source ) == 520 ) then if isElement ( hydra [ source ] ) ) then destroyElement ( hydra [ source ] ) end hydra [ source ] = createBlipAttachedTo ( source , 9 , 0,2,255,0,0,255,0,16383.0,getTeamFromName("SWAT")) end end ) ; addEventHandler ( "onVehicleStartExit" , root , function ( ) if ( getElementModel ( source ) == 520 and isElement ( hydra [ source ] ) ) then destroyElement ( hydra [ source ] ) hydra [ source ] = nil end end )
هذا بيشتغل
-
17 hours ago, jakson said:
هلا شباب كيفكم.
ممكن حد يقول لي كيف اسوي بليبس علي الهيدرا ...
يعني لما ينزل لاعب هيدرا
يظهر علامه علي الهيدرا في المني ماب الي موجوده تحت علي الشمال في ام تي اي
عشان تكشف للاعبين الاخره ان في شخص يسوق هيدرا
وشكرا
addEventHandler('onVehicleEnter',root, function(thePlayer, seat , jacked) if getElementModel(source) == 520 then -- يتحقق من انو الموديل حق الهايدرا outputChatBox(getPlayerName(thePlayer)..'entered a hydra', root) -- يكتبلك بالشات انو اللاعب ذا دخل بهايدرا createBlipAttachedTo(source, 52) --- يصنع البلب destroyElement(source) -- يشيل الهايدرا outputChatBox(getPlayerName(thePlayer).."don't enter a hydra again", thePlayer) -- يكتب للاعب end end )
- 1
-
-
جرب
function test() for i , v in ipairs (getElementsByType('object')) do setObjectBreakable(v, false) end end
- 1
-
29 minutes ago, liwahadri said:
عندي مشكله بضبط الصوره ثلاثي آبعاد انا مسوي له خاص لتيم بس ضفت خويي لتيم عشان اجرب وابغاه تجي فوق راسه بس يعني الآحداثيات ماتجي علي شوف صور
الصوره قريب خويي
الصوره بعيد علي خويي
مثل شايفين النص و الخط فوق راس خويي مضبوطين بس الصوره الي آبغاه اذا بعدت شوي تنقص الصوره وش الحل؟؟
teamnamePointX,teamnamePointY,teamnamePointZ = x_off,y_off+1,pz+1.2 local screen_xteam,screen_yteam = getScreenFromWorldPosition(teamnamePointX,teamnamePointY,teamnamePointZ+0.1) dxDrawLine3D(px,py,pz,namePointX,namePointY,pz+1.1,tocolor(255,255,255,150),2) dxDrawText(nick,screen_x,screen_y,sX,sY,tocolor(255,255,255,255),fontSize,font,"left","top",false,false,false,true,true) dxDrawText(teamName,screen_xteam,screen_yteam,sX,sY,tocolor(teamR,teamG,teamB,255),fontSize/1.0,font,"left","top",false,false,false,true,true) dxDrawImage(screen_xteam,screen_yteam,70,80, ":guieditor/images/2.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
تقدر تستخدم
https://wiki.multitheftauto.com/wiki/DxDrawTextOnElement
هذا بيفيدك احسن من الي مسويه انت وتقدر تتحكم بالبعد
-
لو انا مسوي جدول كذا
tires = { {tireleft}, {tireright}, } function gettire() for i , theVehicle in ipairs getElementsByType('vehicle') do local pos = getVehicleComponeontPosition(theVehicle)[tires] if getPositionBetweenPoints3D(unpack(pos), unpack(getElementPosition(source)) < 3 then outputChatBox(''..getVehicleWheelState(theVehicle)..'', source) end end end
وهذا يجيبلي التاير الي انا قريب عليه يجيبلي حالة التاير طبعاً انا بضيف حدث الي هو اون المنت كلكد لكن كيف اخلي يجيب حالة التاير الي قريب عليه يعني انا واقف عند التاير اليمين يجيب حالة هذا التاير وهكذا
الي مايعرف وش تايرات يعني عجلات السيارة
-
15 hours ago, +Source|> said:
انا مسوي ايديت بوكس
ابي لما احط رابط يوتيوب في الايدت بوكس
يشتغل الصوت
-- كلينت requestBrowserDomains( { "www.convertmp3.io" } ) local browser = createBrowser( 0, 0, false ) local currentSound function callback( data, error ) if ( error ~= 0 ) then return outputChatBox( error ) end if ( data == "ERROR" ) then return outputChatBox( "data error" ) end local data = fromJSON( "["..data.."]" ) if ( data ) then loadBrowserURL( browser, data.UrlS ) end end function fetch( UrlS ) if ( UrlS ) then fetchRemote( "http://www.convertmp3.io/fetch/?format=JSON&video="..UrlS, callback ) end end addEventHandler( "onClientBrowserNavigate", browser, function( UrlS ) if not UrlS:find( "www.convertmp3.io" ) then currentSound = playSound( UrlS ) end end ) addEvent( "startSound", true ) addEventHandler( "startSound", root, function ( _, UrlS ) fetch( UrlS ) end )
https://community.multitheftauto.com/index.php?p=resources&s=details&id=14600
هذا رابط مود نفس الي تحتاجه انت -
حسب اذا انت مسويه على داتا او على تيم او على وظيفة
فتجيب الداتا حقه وتتحقق من هالشيء وتخلي اللون الي تبيه
-
3 hours ago, liwahadri said:
ماضبط كمان
function displayServerMessage(source, message, type) triggerClientEvent(source, "servermessages", getRootElement(), message, type)endfunction bounce()antiBounce = false if not getElementData(localPlayer,"login") then return end antiBounce = not antiBounce if antiBounce then displayServerMessage(source, "test.", "confirm") else displayServerMessage(source, "test.", "warning") endendbindKey("c","down", bounce)addEventHandler("onClientVehicleCollision",root, function(hitElement) if(not antiBounce) then return end if(hitElement ~= nil) then if(getElementType(hitElement) ~= "object") then return end end if(getElementType(source) ~= "vehicle") then return end if getVehicleOccupant(source) ~= localPlayer then return end local tx, ty, tz = getVehicleTurnVelocity(source) if ((math.abs(ty) > 0.1 and math.abs(tz) > 0.001) or (math.abs(ty) > 0.001 and math.abs(tz) > 0.1)) then local vx,vy,vz = getElementVelocity(source) setVehicleTurnVelocity(source, 0, 0, 0) setElementVelocity(source, vx*1.01, vy*1.01, vz) end end)
اعتقد انك لازم تحط الوظيفة بالاخير.. يعني مو قبل الي تبي تستخدمه انت
-
1 hour ago, liwahadri said:
سويت آلي قلت لي ياه غير اكواد وسميت فانكشن وحطيت bindKey اسم الفأنكشن
مآشتغل
وآلكود مب آتوقع مفيه اغلاط عشان مارسلت الكودً كأمل
آلي سويته كذا
Server Side
function bounce()antiBounce = false if not getElementData(localPlayer,"login") then return end antiBounce = not antiBounce if antiBounce then triggerClientEvent(source,'servermessages',source, 'TEST',warning) else triggerClientEvent(source,'servermessages',source, 'TEST',warning) endendbindKey("c","down", bounce)addEventHandler("onClientVehicleCollision",root, function(hitElement) if(not antiBounce) then return end if(hitElement ~= nil) then if(getElementType(hitElement) ~= "object") then return end end if(getElementType(source) ~= "vehicle") then return end if getVehicleOccupant(source) ~= localPlayer then return end local tx, ty, tz = getVehicleTurnVelocity(source) if ((math.abs(ty) > 0.1 and math.abs(tz) > 0.001) or (math.abs(ty) > 0.001 and math.abs(tz) > 0.1)) then local vx,vy,vz = getElementVelocity(source) setVehicleTurnVelocity(source, 0, 0, 0) setElementVelocity(source, vx*1.01, vy*1.01, vz) end end)
Client Side
function renderMensages() local msgd = mensages if #msgd ~= 0 then local startY = screenW*0.5 local i = 1 repeat mData = msgd[i] local drawThis = true if i~= 1 then startY = startY + screenW*0.0425 end if mData[5] == 0 and mData[6] == 0 then mData[5] = - mData[4] - screenH*0.015 mData[6] = startY mData[7] = startY end local tick = getTickCount() - mData[3] local posX, posY, alpha if tick < 1000 then local progress = math.min(tick/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, 0, 0, 0, progress, "Linear") elseif tick >= 1000 and tick <= 7000 then mData[5] = 0 elseif tick > 7000 then local progress = math.min((tick - 7000)/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, - mData[4] - mData[4] - screenH*0.015, 0, 0, progress, "Linear") if progress >= 1 then table.remove(msgd, i) drawThis = false messagetick = getTickCount() end end local globalTick = getTickCount() - messagetick if drawThis then mData[7] = startY mData[6] = interpolateBetween(mData[6], 0, 0, mData[7], 0, 0, math.min(globalTick/1000,1), "Linear") posX = mData[5] posY = mData[6] alpha = 255 dxDrawRectangle(posX, posY, mData[4], screenW*0.04, tocolor(0, 0, 0, alpha*0.75), true) local r, g, b = 0, 255, 0 if mData[2] == "warning" then r, g, b = 255, 0, 0 end dxDrawRectangle(posX + mData[4], posY, screenH*0.010, screenW*0.04, tocolor(r, g, b, alpha*0.85), true) dxDrawText(mData[1], posX, posY, posX + mData[4], posY + screenW*0.04, tocolor(255, 255, 255, alpha), fontScale*0.05, Font_1, "center", "center", false, false, true, false, false) end i = i + 1 until i > #msgd mensages = msgd endendaddEventHandler("onClientRender", getRootElement(), renderMensages)
مايحتاج صحيح كلامك عشان كتبت اسم فانكشن في بيند كاي بس ب اخير مزبط
اعتقد اني سويته
bindKey("c","down", bounce)
بس مايجني ولا تنبيه ب اخير
جرب هالكود
function displayServerMessage(source, message, type) triggerClientEvent(source, "servermessages", getRootElement(), message, type) end
وتحت مثال عليه
displayServerMessage(source, "test.", "confirm") -- هذا عشان يكون اخضر displayServerMessage(source, "test.", "warning") -- كذا يكون احمر
او انك ببساطة تحط
التايب كذا
"warning"
مو كذا
warning
-
5 hours ago, liwahadri said:
ايش خطأ هنا ؟ ليش مايشتغل تريقر ؟
Client Side
bindKey("F4", "down", function() if not getElementData(localPlayer,"login") then return end if isDM() then carfade = (not carfade) if(carfade)then triggerClientEvent(source,'servermessages',source, 'TEST',warning) else triggerClientEvent(source,'servermessages',source, 'TEST',rec) end end end)
انا متصله ب سرفر
Server Side
mensages = {} messagetick = 0 function servermessages(message, type) table.insert(mensages, {message, type or "confirm", getTickCount(), dxGetTextWidth(message, fontScale*0.06, Font_1) + screenH*0.01, 0, 0, 0}) messagetick = getTickCount() end addEvent("servermessages", true) addEventHandler("servermessages", getRootElement(), servermessages) function renderMensages() local msgd = mensages if #msgd ~= 0 then local startY = screenW*0.5 local i = 1 repeat mData = msgd[i] local drawThis = true if i~= 1 then startY = startY + screenW*0.0425 end if mData[5] == 0 and mData[6] == 0 then mData[5] = - mData[4] - screenH*0.015 mData[6] = startY mData[7] = startY end local tick = getTickCount() - mData[3] local posX, posY, alpha if tick < 1000 then local progress = math.min(tick/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, 0, 0, 0, progress, "Linear") elseif tick >= 1000 and tick <= 7000 then mData[5] = 0 elseif tick > 7000 then local progress = math.min((tick - 7000)/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, - mData[4] - mData[4] - screenH*0.015, 0, 0, progress, "Linear") if progress >= 1 then table.remove(msgd, i) drawThis = false messagetick = getTickCount() end end local globalTick = getTickCount() - messagetick if drawThis then mData[7] = startY mData[6] = interpolateBetween(mData[6], 0, 0, mData[7], 0, 0, math.min(globalTick/1000,1), "Linear") posX = mData[5] posY = mData[6] alpha = 255 dxDrawRectangle(posX, posY, mData[4], screenW*0.04, tocolor(0, 0, 0, alpha*0.75), true) local r, g, b = 0, 255, 0 if mData[2] == "warning" then r, g, b = 255, 0, 0 end dxDrawRectangle(posX + mData[4], posY, screenH*0.010, screenW*0.04, tocolor(r, g, b, alpha*0.85), true) dxDrawText(mData[1], posX, posY, posX + mData[4], posY + screenW*0.04, tocolor(255, 255, 255, alpha), fontScale*0.05, Font_1, "center", "center", false, false, true, false, false) end i = i + 1 until i > #msgd mensages = msgd end end addEventHandler("onClientRender", getRootElement(), renderMensages)
وش سالفه شباب؟
ليش ثلاثة اند ؟ ماعتقد البايند يحتاج اند
-
triggerClientEvent
-
mensages = {} messagetick = 0 function servermessages(message, type) table.insert(mensages, {message, type or "confirm", getTickCount(), dxGetTextWidth(message, fontScale*0.06, Font_1) + screenH*0.01, 0, 0, 0}) messagetick = getTickCount() end addEvent("servermessages", true) addEventHandler("servermessages", getRootElement(), servermessages) function renderMensages() local msgd = mensages if #msgd ~= 0 then local startY = screenW*0.5 local i = 1 repeat mData = msgd[i] local drawThis = true if i~= 1 then startY = startY + screenW*0.0425 end if mData[5] == 0 and mData[6] == 0 then mData[5] = - mData[4] - screenH*0.015 mData[6] = startY mData[7] = startY end local tick = getTickCount() - mData[3] local posX, posY, alpha if tick < 1000 then local progress = math.min(tick/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, 0, 0, 0, progress, "Linear") elseif tick >= 1000 and tick <= 7000 then mData[5] = 0 elseif tick > 7000 then local progress = math.min((tick - 7000)/1000,1) mData[5] = interpolateBetween(mData[5], 0, 0, - mData[4] - mData[4] - screenH*0.015, 0, 0, progress, "Linear") if progress >= 1 then table.remove(msgd, i) drawThis = false messagetick = getTickCount() end end local globalTick = getTickCount() - messagetick if drawThis then mData[7] = startY mData[6] = interpolateBetween(mData[6], 0, 0, mData[7], 0, 0, math.min(globalTick/1000,1), "Linear") posX = mData[5] posY = mData[6] alpha = 255 dxDrawRectangle(posX, posY, mData[4], screenW*0.04, tocolor(0, 0, 0, alpha*0.75), true) local r, g, b = 0, 255, 0 if mData[2] == "warning" then r, g, b = 255, 0, 0 end dxDrawRectangle(posX + mData[4], posY, screenH*0.010, screenW*0.04, tocolor(r, g, b, alpha*0.85), true) dxDrawText(mData[1], posX, posY, posX + mData[4], posY + screenW*0.04, tocolor(255, 255, 255, alpha), fontScale*0.05, Font_1, "center", "center", false, false, true, false, false) end i = i + 1 until i > #msgd mensages = msgd end end addEventHandler("onClientRender", getRootElement(), renderMensages)
ذا الي تبيه انت لكن يطلع لك من اليسار مو من فوق
تقدر تسوي لما يضغط اف 2
servermessages('....')
والتايب عادي تقدر تتركه او انك تسويه warn
يطلع فيه rec احمر
تتركه يطلعلك اخضر
-
جرب تسوي
fileDelete('resourcename/filename.lua')
مساعدة
in البرمجة
Posted
سويت هذا الشيء لكن الغلط كان من عندي اني اعدل على نفس الملف لكن نسخة منه
ضايفها لغير سيرفر, مشكور.