iiv03 Posted November 24, 2019 Share Posted November 24, 2019 هلا معي مشكله هنا في الاول اذا رسترت الكود حقي يشتغل واذا كتبت امر مثل /dm cw أو wff يشتغل بس مشكله انه لو الأعب خرج ودخل مره ثاني مايجي الرندر؟ الا انا اكتب مره ثانيه الأمر وين خطأ؟ local CWMode = false local WFFMode = true function toggleSystem(playerSource,commandName,status,message,messageType) local playerName = getPlayerName(playerSource) local account = getPlayerAccount (playerSource) local account_name = getAccountName(account) if isObjectInACLGroup ( "user." .. account_name, aclGetGroup ( "Clanwar" )) or (isPlayerInACLGroup(playerSource, adminGroups) == true) then if not status then outputChatBox("#ffffffWrong Syntax: #334455/dm [cw/wff]",playerSource,255,255,255,true) return end if status == "cw" then outputChatBox("#ffffff| the Gamemode has been changed to CWMode #ffffffby "..playerName,getRootElement(),255,255,255,true) CWMode = true addCommandHandler("state", SystemCW) triggerClientEvent("EnableCW", resourceRoot) addCommandHandler("reset", onResetSettingCW) addCommandHandler("join1", joinHomeTeam) addCommandHandler("join2", joinEnemyTeam) WFFMode = false removeCommandHandler("state", SystemWFF) removeCommandHandler("reset", onResetSettingWFF) elseif status == "wff" then cancelEvent() outputChatBox("#ffffff| the Gamemode has been changed to WFFMode #ffffffby "..playerName,getRootElement(),255,255,255,true) CWMode = false removeCommandHandler("state", SystemCW) removeCommandHandler("reset", onResetSettingCW) triggerClientEvent("EnableWFF", resourceRoot) WFFMode = true addCommandHandler("state", SystemWFF) addCommandHandler("reset", onResetSettingWFF) addCommandHandler("join1", joinHomeTeam) addCommandHandler("join2", joinEnemyTeam) else outputChatBox("#ffffffWrong Syntax: #334455/dm [cw/wff]",playerSource,255,255,255,true) end else outputChatBox("Access Denied",playerSource,255,255,255,true) end end addCommandHandler("dm",toggleSystem) مسوي تريقر لين للكلينت كذا function toEnabledWFF() removeEventHandler("onClientRender", root, cw) addEventHandler("onClientRender", root, wff) end addEvent("EnableWFF", true) addEventHandler("EnableWFF", root, toEnabledWFF) function toEnabledCW() addEventHandler("onClientRender", root, cw) removeEventHandler("onClientRender", root, wff) end addEvent("EnableCW", true) addEventHandler("EnableCW", root, toEnabledCW) ياليت مساعده. مدري صراحه وين خطأ بموضوع ومافي ارور ب ديبوق Link to comment
3NAD Posted November 25, 2019 Share Posted November 25, 2019 Client: triggerServerEvent ( "onRequestCurrentGamemode", localPlayer ) Server: addEvent ( "onRequestCurrentGamemode", true ) addEventHandler ( "onRequestCurrentGamemode", root, function ( ) if CWMode then triggerClientEvent ( source, "EnableCW", resourceRoot ) elseif WFFMode then triggerClientEvent ( source, "EnableWFF", resourceRoot ) end end ) Link to comment
iiv03 Posted November 26, 2019 Author Share Posted November 26, 2019 (edited) 23 hours ago, 3NAD said: Client: triggerServerEvent ( "onRequestCurrentGamemode", localPlayer ) Server: addEvent ( "onRequestCurrentGamemode", true ) addEventHandler ( "onRequestCurrentGamemode", root, function ( ) if CWMode then triggerClientEvent ( source, "EnableCW", resourceRoot ) elseif WFFMode then triggerClientEvent ( source, "EnableWFF", resourceRoot ) end end ) هلا خوي عناد سويت كذا ومشكله لسى مزبط وين مشكله؟ server: addEventHandler("onPlayerJoin", root, function() if CWMode == true then triggerClientEvent("EnableCW", resourceRoot) elseif WFFMode == true then triggerClientEvent("EnableWFF", resourceRoot) else outputChatBox("| #ff0000ERROR: #ffffffLoading Script SystemCW",getRootElement(), 255,255,255,true) outputDebugString("There is a error in SystemCW", 0, 212,27,27) end end) client: function toEnabledWFF() removeEventHandler("onClientRender", getRootElement(), cw) addEventHandler("onClientRender", getRootElement(), wff) end addEvent("EnableWFF", true) addEventHandler("EnableWFF", root, toEnabledWFF) function toEnabledCW() addEventHandler("onClientRender", getRootElement(), cw) removeEventHandler("onClientRender", getRootElement(), wff) end addEvent("EnableCW", true) addEventHandler("EnableCW", root, toEnabledCW) المشكله في سرفر محلي لوكال زبط .. بس في سرفر عالمي مازبط كل ماخش يجني ارور انه مافي EnableCW ب كلينت سايد وهو موجود و معرف الحدث ب فاكشن addEvent("EnableCW", true) addEventHandler("EnableCW", getRootElement(), toEnabledCW) وش حل؟ Edited November 26, 2019 by xFabel Link to comment
3NAD Posted November 26, 2019 Share Posted November 26, 2019 onPlayerJoin ; اللاعب باقي ماحمل ملف الكلاينت ف لذلك الإيفنت ماراح يحصله Link to comment
iiv03 Posted November 26, 2019 Author Share Posted November 26, 2019 4 minutes ago, 3NAD said: onPlayerJoin ; اللاعب باقي ماحمل ملف الكلاينت ف لذلك الإيفنت ماراح يحصله أها فهمتك بس وش الحل؟ Link to comment
3NAD Posted November 26, 2019 Share Posted November 26, 2019 On 25/11/2019 at 16:05, 3NAD said: Client: triggerServerEvent ( "onRequestCurrentGamemode", localPlayer ) Server: addEvent ( "onRequestCurrentGamemode", true ) addEventHandler ( "onRequestCurrentGamemode", root, function ( ) if CWMode then triggerClientEvent ( source, "EnableCW", resourceRoot ) elseif WFFMode then triggerClientEvent ( source, "EnableWFF", resourceRoot ) end end ) هذا الحل Link to comment
iiv03 Posted November 26, 2019 Author Share Posted November 26, 2019 7 minutes ago, 3NAD said: triggerServerEvent ( "onRequestCurrentGamemode", localPlayer ) مافهمت هنا وش قصدك ب كلينت يعني وين احطه ذا؟ الحين اوك فهمنا ان كلينت متصل علي سرفر سايد . بس التريقر سرفر سايد رايح لين كلينت وين مكانه ذا؟ ولا قصدك احطه ب جيم مود لما يشتغل؟ ... Link to comment
3NAD Posted November 26, 2019 Share Posted November 26, 2019 الكود ذا حطه في ملف كلاينت بس و حق سيرفر سايد , هذا كلاينت إيفنت انت مسويه من اول 1 Link to comment
iiv03 Posted November 26, 2019 Author Share Posted November 26, 2019 6 minutes ago, 3NAD said: الكود ذا حطه في ملف كلاينت بس و حق سيرفر سايد , هذا كلاينت إيفنت انت مسويه من اول مشكوور حبيبي عنآد مأكنت داري اني اضيف افينت ثاني ب سرفر سايد ماقصرت حبيبي 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