ميدوح Posted October 5, 2016 Share Posted October 5, 2016 السلام عليكم ورحمة الله وبركاته كيفكم؟ الكود الاولاني تبع شراء تمام Spoiler --- سيرفر --- --Marker Marker1 = createMarker (-721.40552, 951.16364, 12.13281, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler( "onMarkerHit", Marker1, function ( hitElement) if getElementType ( hitElement ) == "player" then triggerClientEvent(hitElement,"marker1",hitElement) end end) --Team addEventHandler("onResourceStart", resourceRoot,function() AdminTeam = createTeam ( "Team[1]", 0, 255, 0 ) end) --set buy team addEvent ("setTeam", true) addEventHandler ("setTeam", getRootElement(),function() if ( getPlayerMoney(source) >= 500) then takePlayerMoney(source,500) setPlayerTeam(source, AdminTeam) outputChatBox ( "^_^ Team") end end) --- كلنت --- wind1 = guiCreateWindow(164, 407, 400, 150, "team", false) guiSetVisible(wind1,false) label2 = guiCreateLabel(10, 25, 159, 124, "buy team $500", false, wind1) button1 = guiCreateButton(270, 110, 72, 33, "ok", false, wind1) addEventHandler("onClientGUIClick",button1,function() triggerServerEvent("setTeam",localPlayer) end) ---- Marker buy team addEvent( "marker1", true ) addEventHandler ( "marker1", getRootElement(),function () guiSetVisible(wind1,true) showCursor(true) end) الكود الثاني : ليش ماتظهر اللوحة؟ --- server --- Marker2 = createMarker (-720.82202, 963.37451, 12.13281, "cylinder", 1.5, 255, 255, 0, 170 ) addEventHandler( "onMarkerHit",Marker2 function ( hitElement) local playerTeam = getPlayerTeam ( source ) local theTeam = getTeamFromName ( playerTeam ) if ( theTeam ) then local players = getPlayersInTeam ( theTeam ) if getElementType ( hitElement ) == players then triggerClientEvent(hitElement,"marker2",hitElement) end end end ) --- كلنت --- wind2 = guiCreateWindow(164, 407, 400, 150, "gui", false) guiSetVisible(wind2,false) -- gui team addEvent( "marker2", true ) addEventHandler ( "marker2", getRootElement(),function () guiSetVisible(wind2,true) showCursor(true) end) Link to comment
!#NssoR_) Posted October 5, 2016 Share Posted October 5, 2016 (edited) بما ان الكود الاول شغال مافيه مشاكل ماله داعي تحطه ع العموم كودك جهة السيرفر يكون بهذا الشكل addEventHandler( "onMarkerHit",Marker2 function ( hitElement) if ( getElementType(hitElement) == 'player' and getPlayerTeam ( hitElement ) ) then if getPlayerTeam ( hitElement ) == getTeamFromName('SWAT') then triggerClientEvent(hitElement,"marker2",hitElement) end end end ) شوف سطر 4 غير كلمة سوات الي اسم التيم الي تبيه Edited October 5, 2016 by NssoR 1 Link to comment
ميدوح Posted October 5, 2016 Author Share Posted October 5, 2016 21 minutes ago, NssoR said: بما ان الكود الاول شغال مافيه مشاكل ماله داعي تحطه ع العموم كودك جهة السيرفر يكون بهذا الشكل addEventHandler( "onMarkerHit",Marker2 function ( hitElement) if ( getElementType(hitElement) == 'player' and getPlayerTeam ( hitElement ) ) then if getPlayerTeam ( hitElement ) == getTeamFromName('SWAT') then triggerClientEvent(hitElement,"marker2",hitElement) end end end ) شوف سطر 4 غير كلمة سوات الي اسم التيم الي تبيه شكرا على ردك السريع .بس عندي سؤال كيف يكون الخروج من الفريق ؟ Link to comment
!#NssoR_) Posted October 5, 2016 Share Posted October 5, 2016 اذا كنت تقصد انك تبي تطرد لاعب من اي تيم هو فيه تسوي زي كذا setPlayerTeam(source,nil) وطبعا كلمة سورس تكون ع حسب الحدث مو بكل الحالات تحطها سورس 2 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