-
Posts
1,363 -
Joined
-
Last visited
Everything posted by Max+
-
--ClientSide , function justForTest() end function msToTimeStr( ms ) if not ms then return '' end local s = math.floor( ms / 1000 ) local seconds = tostring( math.fmod( s, 60 ) ) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring( math.floor( s / 60 ) ) if #minutes == 1 then minutes = '0' .. minutes end return minutes .. ':' .. seconds end myTimer = setTimer( justForTest, 180*1000, 1 ) addEventHandler( "onClientRender", root, function( ) if isTimer( myTimer ) then remaining, _, _ = getTimerDetails(myTimer) remaining = msToTimeStr( remaining ) if remaining then dxDrawText( remaining, 120, 442, 350, 300, tocolor(255, 255, 255, 255), 1.0, "pricedown", "left", "top", false, false, true, false, false) end end end ) local Bscore = 0 local Wscore = 0 addEventHandler("onClientPlayerWasted", function ( killer ) local kteam = getPlayerTeam(killer) if(getTeamName(kteam) == "Team1")then Wscore = Wscore + 1 elseif(getTeamName(kteam) == "Team2") then Bscore = Bscore + 1 end end ) function onRender() local team = getPlayerTeam(localPlayer) if(getTeamName(team) == "Team1" or getTeamName(team) == "Team2") then dxDrawText("Team1:"..tostring(Bscore), 0, 500, 319, 426, tocolor(0, 0, 0, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) dxDrawText("Team2:"..tostring(Wscore), 0, 600, 319, 426, tocolor(255, 255, 255, 255), 1.00, "pricedown", "center", "center", true, true, true, true, false) end end addEventHandler("onClientRender", root, onRender)
-
addEventHandler( 'onClientResourceStart', resourceRoot, function ( ) if getElementDimension ( localPlayer ) ~= 666 then --- if he is not in 666 then setWaterColor(0,0,255) setSkyGradient(0,0,0,0,0,0) outputChatBox ( ' * Sky , Water Change to normal *', 255, 0, 0 ) ----- set it to normal else --- if he is in 666 then setWaterColor(255,0,0) setSkyGradient(0,0,0,0,0,0) outputChatBox ( ' * Sky , Water Changed to Custom *', 255, 0, 0 ) end end )
-
why do it very hard with triggers and etc ? while you can use it all in ClientSide ?
-
nope , becuase its all client Events .. remove the serverSide scripts , and /debugscript 3 to see if there is any erros ?
-
--- ClientSide all of it , addEventHandler('onClientPlayerWasted', root, function ( attacker ) if ( attacker and attacker ~= source ) and getPlayerTeam(getTeamName( attacker ) == 'Team1' ) then setElementData ( attacker, Wscore +1 ) elseif ( attacker and attacker ~= source ) and getPlayerTeam(getTeamName( attacker ) == 'Team2' ) then setElementData ( attacker, Bscore + 1 ) end end ) addEventHandler("onClientRender", root, function() dxDrawRectangle(60, 320, 250, 175, tocolor(0, 0, 0, 175), true) dxDrawText("Score", 225, 325, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 365, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("Mortes:", 70, 405, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) dxDrawText("TEMPO:", 70, 450, 73, 340, tocolor(255, 255, 255, 255), 1.1, "default", "left", "top", false, false, true, false, false) end ) function justForTest() end function msToTimeStr( ms ) if not ms then return '' end local s = math.floor( ms / 1000 ) local seconds = tostring( math.fmod( s, 60 ) ) if #seconds == 1 then seconds = '0' .. seconds end local minutes = tostring( math.floor( s / 60 ) ) if #minutes == 1 then minutes = '0' .. minutes end return minutes .. ':' .. seconds end myTimer = setTimer( justForTest, 180*1000, 1 ) addEventHandler( "onClientRender", root, function( ) if isTimer( myTimer ) then remaining, _, _ = getTimerDetails(myTimer) remaining = msToTimeStr( remaining ) if remaining then dxDrawText( remaining, 120, 442, 350, 300, tocolor(255, 255, 255, 255), 1.0, "pricedown", "left", "top", false, false, true, false, false) end end end ) local Bscore = 0 local Wscore = 0 function onRender() if ( getPlayerTeam( localPlayer ) and getPlayerTeam( localPlayer ) == getTeamFromName ( "Team1" ) ) or ( getPlayerTeam( localPlayer ) and getPlayerTeam( localPlayer ) == getTeamFromName ( "Team2" ) ) then dxDrawText("Team2", 70, 340, 319, 426, tocolor(0, 255, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) dxDrawText("Team1", 70, 380, 319, 426, tocolor(255, 0, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(tostring(Bscore), 240, 340, 319, 426, tocolor(0, 255, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) dxDrawText(tostring(Wscore), 240, 380, 319, 426, tocolor(255, 0, 0, 255), 1.4, "default-bold", "left", "top", false, false, true, false, false) end end addEventHandler("onClientRender", root, onRender) Edited #
-
كود الكلينت صحيح مافيه مشكلة , لاكن المشكلة عنده من السيرفر سايد . . .
-
ايه بيد يركب عليهم تضبط .. اما اوبجكت مالظاهر. ..
-
well , iam not very good at dx , becuase i use labels easy , but what i post will do the job without your code , it will change auto ..
-
اي ينكسر لو ماينكسر ماسوو الافنت ذا https://wiki.multitheftauto.com/wiki/On ... bjectBreak طيب ليه مسوي حدث وكود طويل وانت تقدر تستخدم هالوظيفه : setObjectBreakable ?? ع العموم بالتوفيق . هاذا بعد يضبط بس ماشفت الفنكشن والله . لاني ماقد برمجة بالاوبجكت يقدر يستخدم اكثر من طريقه . .
-
function drawDX () X,Y = guiGetScreenSize () X = X * (2.5/3) Y = Y * (1/4) dxDrawText ( getElementData(getLocalPlayer(),"secondsRemaining"), X, Y, X, Y, tocolor(255, 255, 255, 255), 5) end function showDX () addEventHandler ( "onClientRender", getRootElement(), drawDX ) end addEvent ( "showDX", true ) addEventHandler ( "showDX", getRootElement(), showDX ) function hideDX () removeEventHandler ( "onClientRender", getRootElement(), drawDX ) end addEvent ( "hideDX", true ) addEventHandler ( "hideDX", getRootElement(), hideDX ) segundos = 30000 timerEnabled = false function onS () if timerEnabled then setElementData(source,"secondsRemaining",tostring(segundos)) triggerClientEvent ( source, "showDX", source) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onS ) function escreve () timerEnabled = true for i,v in pairs(getElementsByType("player")) do setElementData(v,"secondsRemaining",tostring(segundos)) triggerClientEvent ( v, "showDX", v ) end setTimer(countDown,1000,30) end addCommandHandler("inciarcontador",escreve) function countDown() segundos = segundos -1 for i,v in pairs(getElementsByType("player")) do setElementData(v,"secondsRemaining",tostring(segundos)) end if segundos == 0 then triggerClientEvent ( "hideDX", getRootElement() ) timerEnabled = false end end function onStart () timerEnabled = false end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), onStart )
-
والله انا ماني قايل له شي ولا زعلان بس ليه يضحك ؟ يقول لي خطا كذا وكذا اما ضحك ذي تعتبر اهانه وحنا نسولف على الكسر اما دم اكيد مأتتأثر . . ض1 = فيس زعلآن ولا فيس بصحح لك ؟ ذذ = فيس يبكي ؟ اذا غلطت عليك حقي علي وعلى راسي بأنتظار صاحب الموضوع . . .
-
segundos = 30 replace it with 30000 = 3 min ,
-
والله انا ماني قايل له شي ولا زعلان بس ليه يضحك ؟ يقول لي خطا كذا وكذا اما ضحك ذي تعتبر اهانه وحنا نسولف على الكسر اما دم اكيد مأتتأثر . . ي رجال عوافي , العيال فهموك غلط يمكن عالعموم انا بأنتظار القيم مود حقك ان شاء الله يكون روعه وياليت تسوي موضوع عنه وش هو بالتفصيل
-
اي ينكسر لو ماينكسر ماسوو الافنت ذا https://wiki.multitheftauto.com/wiki/On ... bjectBreak
-
والله انا ماني قايل له شي ولا زعلان بس ليه يضحك ؟ يقول لي خطا كذا وكذا اما ضحك ذي تعتبر اهانه وحنا نسولف على الكسر اما دم اكيد مأتتأثر . .
-
زي ماتوقعت انك تبي تستبدل الاوبجكت بحيوانات . . والله بالنسبة للاستبدال الاوبجكت مدري لو اوامر الــ txd تضبط ولا لا , بس اذا تبي تمنعه من الحركة ومأيتاثر شوف كودي الاول استبدل 1337 برقم الاوبجكت اللي تبي + زاحف طيب لو الاوبجكت صندوق ماينكسر ؟ " على حسب الاوبجكت " وحسن .. انا ماقلت شي صحح لي بس مو تضحك علي . كلن يعرف نفسه قبل مايضحك على الثاني وعلى راسي انت وزاحف .
-
حسان الضحك ماله داعي ؟ ترا لك مواضيع غبيه قبل ماتصير زي كذا . . + addEventHandler ( 'onClientPedDamage', root, function ( attacker ) if ( getElementType ( attacker ) == 'player') then cancelEvent ( ) outputChatBox (' * You Cant Damage a Ped ! * ', 255, 255, 0 ) end end ) addEventHandler('onClientResourceStart', resourceRoot, function ( ) local nMax = createPed( 120,5540.6654, 1020.55122, 1240.545 ) setElementFrozen ( nMax , true ) end ) فهاوه الاوبجكت ماله دم بس لو سوا صندوق وانكسر ؟ على حسب الاوبجكت اللي يسويه
-
ياخي هاذا اللي يقصده .... addEventHandler ( 'onClientObjectDamage', root, function ( attacker ) if ( getElementType ( attacker ) == 'player') then cancelEvent ( ) outputChatBox (' * You Cant Damage an Object * ', 255, 255, 0 ) end end ) addEventHandler('onClientResourceStart', resourceRoot, function ( ) local nMax = createObject( 1337,5540.6654, 1020.55122, 1240.545 ) setElementFrozen ( nMax , true ) end )
-
in f8 debugscript 3 + make sure it's serverside in Meta.xml
-
طيب وين الدم بالموضوع ؟ ض1 + ماقد شفت ذا الايفنت ؟ https://wiki.multitheftauto.com/wiki/On ... jectDamage + البيد ذي شخصيات فقط ! مالها علاقه بالاوبجكت ذذ
-
yes , exactly it will Only work when it's pressed , if you you want to detect it witout press and unpress you Can't
-
iam sure you didn't give it admin rights put the resourceName in the admin Acl becuase banPlayer need rights , and yeah i fogot to remove the ads, with cancelEvent () #
-
اتوقع ذا اللي يقصده تابل .. addEventHandler( 'onClientExplosion', root, function ( nMax, theType, x1, y1, z1) if ( getElementType(nMax) == "player" ) and ( theType == 10 )then for _, Max in ipairs (getElementsByType ( 'vehicle' )) do if ( getElementModel ( Max ) == 432 ) then local x, y, z = getElementPosition ( Max ) if ( getDistanceBetweenPoints3D(x1, y1, z1, x, y, z) <= 3 ) then if( getElementHealth( Max ) < 500 ) then blowVehicle ( Max ) end end end end end end )
