Snakegold Posted August 23, 2018 Share Posted August 23, 2018 شباب بدي لما أكتب /join و انا في ديموشن 1 يكتبلي You are already in the event function onEventStart ( res ) outputChatBox ( "#FB00FF• Team Deathmatch #ffffffevent started. Type ''#FB00FF/join#ffffff'' #ffffffto join this event", getRootElement(), 255, 255, 255, true) end addEventHandler ( "onResourceStart", getRootElement(), onEventStart ) function changedimension ( source ) setElementDimension ( source, 1 ) -- set his dimension to 1 setElementPosition ( source, 260.8466796875, 1851.8400878906, 8.7578125 ) outputChatBox ( "#FB00FF• You have been joined the event", getRootElement(), 255, 255, 255, true) return end if getElementDimension ( source ) == 1 then outputChatBox ( "#FB00FF• You are already in the event", getRootElement(), 255, 255, 255, true) end addCommandHandler ( "join", changedimension ) function changedimension ( source ) setElementDimension ( source, 0 ) -- set his dimension to 1 setElementPosition ( source, 354.04452514648, 2532.6301269531, 16.720027923584 ) outputChatBox ( "#FB00FF• You have been left the event", getRootElement(), 255, 255, 255, true) end addCommandHandler ( "leave", changedimension ) Link to comment
KillerX Posted August 23, 2018 Share Posted August 23, 2018 function onEventStart ( res ) outputChatBox ( "#FB00FF• Team Deathmatch #ffffffevent started. Type ''#FB00FF/join#ffffff'' #ffffffto join this event", getRootElement(), 255, 255, 255, true) end addEventHandler ( "onResourceStart", getRootElement(), onEventStart ) function changedimension ( source ) if getElementDimension ( source ) == 1 then return outputChatBox ( "#FB00FF• You are already in the event", getRootElement(), 255, 255, 255, true);end setElementDimension ( source, 1 ) -- set his dimension to 1 setElementPosition ( source, 260.8466796875, 1851.8400878906, 8.7578125 ) outputChatBox ( "#FB00FF• You have been joined the event", getRootElement(), 255, 255, 255, true) return end addCommandHandler ( "join", changedimension ) function changedimension ( source ) setElementDimension ( source, 0 ) -- set his dimension to 1 setElementPosition ( source, 354.04452514648, 2532.6301269531, 16.720027923584 ) outputChatBox ( "#FB00FF• You have been left the event", getRootElement(), 255, 255, 255, true) end addCommandHandler ( "leave", changedimension ) 1 Link to comment
Snakegold Posted August 23, 2018 Author Share Posted August 23, 2018 تم الإصلاح ^^ شكرا Link to comment
KillerX Posted August 23, 2018 Share Posted August 23, 2018 Just now, Snakegold said: تم الإصلاح ^^ شكرا عفوا في خدمتك : ) 1 Link to comment
Snakegold Posted August 23, 2018 Author Share Posted August 23, 2018 أخي بدي لما اكتب /join بدخل في تيم function gimmeATeam(source, commandName, teamName) local newTeam = createTeam(teamName) -- create a new team with the specified name if newTeam then -- if it was successfully created setPlayerTeam(source, newTeam) -- add the player to the new team end end addCommandHandler("join", gimmeATeam) بس مو شغال debug: WARNING: event/server.lua:27: Bad argument @'createTeam'[Expected string at argument 1, got nil ] Link to comment
+Source|> Posted August 23, 2018 Share Posted August 23, 2018 6 minutes ago, Snakegold said: أخي بدي لما اكتب /join بدخل في تيم function gimmeATeam(source, commandName, teamName) local newTeam = createTeam(teamName) -- create a new team with the specified name if newTeam then -- if it was successfully created setPlayerTeam(source, newTeam) -- add the player to the new team end end addCommandHandler("join", gimmeATeam) بس مو شغال debug: WARNING: event/server.lua:27: Bad argument @'createTeam'[Expected string at argument 1, got nil ] جرب ذا function gimmeATeam(source) local newTeam = createTeam( "TestTeam", 255, 0, 0 ) -- create a new team with the specified name if newTeam then -- if it was successfully created setPlayerTeam(source, newTeam) -- add the player to the new team end end addCommandHandler("join", gimmeATeam) 1 Link to comment
Snakegold Posted August 23, 2018 Author Share Posted August 23, 2018 سويت الكود و شغال تعرف كيف أخليه يدخل تيم من التيمات الإثنين بس عشوائي؟ Random function createTeamsOnStart() Team1 = createTeam("Ballas", 155, 0, 155) -- change the 3 numbers(0,255,0), the first number is ColourR, the second is ColourG, and the last one is ColourB Team2 = createTeam("Grove Street", 0, 155, 0) end addEventHandler("onResourceStart", resourceRoot, createTeamsOnStart) -- we attach the function to this resource's root element function setteam (source) setPlayerTeam(source, Team1) end addCommandHandler ( "join", setteam ) Link to comment
KillerX Posted August 23, 2018 Share Posted August 23, 2018 (edited) Team1 = createTeam("Ballas", 155, 0, 155) Team2 = createTeam("Grove", 0, 155, 0) addCommandHandler('join', function(player) setElementData(resourceRoot,"any",math.random(0,1)) local Data = getElementData(resourceRoot,"any") if (Data == 1) then setPlayerTeam(player,Team1) outputChatBox('Ballas Team',player,255,0,0,true) elseif (Data == 0) then setPlayerTeam(player,Team2) outputChatBox('Grove Team',player,0,255,0,true) end end ) دي طريقة مش مجربها لاني علي جوال Edited August 23, 2018 by KillerX 1 Link to comment
KillerX Posted August 23, 2018 Share Posted August 23, 2018 Just now, Snakegold said: شكرا عفوا Link to comment
Snakegold Posted August 23, 2018 Author Share Posted August 23, 2018 أسف على الإزعاج ^^ سويت لوحة بس بدي لما يكون في ديموشن 0 ما يقدر يفتحها و اللوحة تفتح بكوماند function OpenWindow1(source) if ( getElementDimension ( source ) == 0 ) then outputChatBox ( "#FB00FF• You can't select weapons outside the event", getRootElement(), 255, 255, 255, true) return end if removeEventHandler("onClientRender",root,Lou) then removeEventHandler("onClientRender",root,Lou) guiSetVisible ( weaponWind, false ) showCursor(false) else addEventHandler("onClientRender",root,Lou) guiSetVisible ( weaponWind, true ) showCursor(true) end end addCommandHandler ( "select", OpenWindow1 ) وين المشكل؟ Link to comment
+1HidroNex Posted August 24, 2018 Share Posted August 24, 2018 (edited) 50 minutes ago, Snakegold said: أسف على الإزعاج ^^ سويت لوحة بس بدي لما يكون في ديموشن 0 ما يقدر يفتحها و اللوحة تفتح بكوماند function OpenWindow1(source) if ( getElementDimension ( source ) == 0 ) then outputChatBox ( "#FB00FF• You can't select weapons outside the event", getRootElement(), 255, 255, 255, true) return end if removeEventHandler("onClientRender",root,Lou) then removeEventHandler("onClientRender",root,Lou) guiSetVisible ( weaponWind, false ) showCursor(false) else addEventHandler("onClientRender",root,Lou) guiSetVisible ( weaponWind, true ) showCursor(true) end end addCommandHandler ( "select", OpenWindow1 ) وين المشكل؟ function OpenWindow1( ) if ( getElementDimension ( localPlayer ) == 0 ) then outputChatBox ( "#FB00FF• You can't select weapons outside the event", getRootElement(), 255, 255, 255, true) return end if removeEventHandler("onClientRender",root,Lou) then removeEventHandler("onClientRender",root,Lou) guiSetVisible ( weaponWind, false ) showCursor(false) else addEventHandler("onClientRender",root,Lou) guiSetVisible ( weaponWind, true ) showCursor(true) end end addCommandHandler ( "select", OpenWindow1 ) -- جرب Edited August 24, 2018 by +1HidroNex Link to comment
Snakegold Posted August 24, 2018 Author Share Posted August 24, 2018 شغال بس ما يكتب اي شي في الشات بدي إسئلك كمان متى تكتب thePlayer/localPlayer/Source? وبما شلت getRootElement() من outputchatbox صار شغال ممكن تقلي ايش الفرق؟ Link to comment
#[K]iLLeR<3 Posted August 24, 2018 Share Posted August 24, 2018 2 minutes ago, Snakegold said: شغال بس ما يكتب اي شي في الشات بدي إسئلك كمان متى تكتب thePlayer/localPlayer/Source? على حسب الحدث و المكان الي تستعمله فيه 1 Link to comment
Snakegold Posted August 24, 2018 Author Share Posted August 24, 2018 أين استطيع ان اجد الأحداث التي تطابقها؟ Link to comment
#[K]iLLeR<3 Posted August 24, 2018 Share Posted August 24, 2018 (edited) 1 minute ago, Snakegold said: أين استطيع ان اجد الأحداث التي تطابقها؟ على حسب المود او السكربت الي تسويه و عندك ذا القسم يشرح لك اي شي تبيه بس ابحث عنه ولو ما لقيت اسال و ما بقصروا معك https://forum.multitheftauto.com/forum/137-دروس-في-البرمجة/ Edited August 24, 2018 by #[K]iLLeR<3 Link to comment
Abdul KariM Posted August 24, 2018 Share Posted August 24, 2018 1 minute ago, Snakegold said: أين استطيع ان اجد الأحداث التي تطابقها؟ السؤال هذا انطرح 514834959621294595959520295 مره بالقسم دور وبتلاقي لو مكلف على نفسك وخاش قسم الشروحات بتحصل طلبك 1 Link to comment
+1HidroNex Posted August 24, 2018 Share Posted August 24, 2018 (edited) 7 minutes ago, Snakegold said: شغال بس ما يكتب اي شي في الشات بدي إسئلك كمان متى تكتب thePlayer/localPlayer/Source? outputChatBox ( "#FB00FF• You can't select weapons outside the event", 255, 255, 255, true) -- عدل هاذا الصطر الى عندك localplayer = Clinet Side source = على حسب الافنت الى بتستخدمه Edited August 24, 2018 by +1HidroNex 1 Link to comment
#[K]iLLeR<3 Posted August 24, 2018 Share Posted August 24, 2018 Just now, Abdul KariM said: السؤال هذا انطرح 514834959621294595959520295 مره بالقسم دور وبتلاقي لو مكلف على نفسك وخاش قسم الشروحات بتحصل طلبك شوي شوي على الراجل تراه جديد 1 Link to comment
Snakegold Posted August 24, 2018 Author Share Posted August 24, 2018 Just now, +1HidroNex said: outputChatBox ( "#FB00FF• You can't select weapons outside the event", 255, 255, 255, true) localplayer = Clinet Side source = على حسب الافنت الى بتستخدمه مشكور اخوي 1 minute ago, Abdul KariM said: السؤال هذا انطرح 514834959621294595959520295 مره بالقسم دور وبتلاقي لو مكلف على نفسك وخاش قسم الشروحات بتحصل طلبك أعصابك إهدى إهدى Link to comment
+1HidroNex Posted August 24, 2018 Share Posted August 24, 2018 1 minute ago, Snakegold said: مشكور اخوي أعصابك إهدى إهدى العفو اخوي , # Link to comment
N3xT Posted August 24, 2018 Share Posted August 24, 2018 2 hours ago, KillerX said: Team1 = createTeam("Ballas", 155, 0, 155) Team2 = createTeam("Grove", 0, 155, 0) addCommandHandler('join', function(player) setElementData(resourceRoot,"any",math.random(0,1)) local Data = getElementData(resourceRoot,"any") if (Data == 1) then setPlayerTeam(player,Team1) outputChatBox('Ballas Team',player,255,0,0,true) elseif (Data == 0) then setPlayerTeam(player,Team2) outputChatBox('Grove Team',player,0,255,0,true) end end ) دي طريقة مش مجربها لاني علي جوال سلامات ليه مستعمل الداتا؟ سويها بمتغير وبعدين تحقق من قيمة المتغير Link to comment
KillerX Posted August 24, 2018 Share Posted August 24, 2018 11 hours ago, N3xT said: سلامات ليه مستعمل الداتا؟ سويها بمتغير وبعدين تحقق من قيمة المتغير شكرا علي التنبية Link to comment
N3xT Posted August 24, 2018 Share Posted August 24, 2018 1 hour ago, KillerX said: شكرا علي التنبية العفو 1 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