Jump to content

مشكله رندر مايضهر اذا لاعب خش سرفر .!


iiv03

Recommended Posts

هلا معي مشكله هنا في الاول اذا رسترت الكود حقي يشتغل

واذا كتبت امر مثل

/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

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
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 by xFabel
Link to comment
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
7 minutes ago, 3NAD said:

triggerServerEvent ( "onRequestCurrentGamemode", localPlayer )

مافهمت هنا وش قصدك ب كلينت

يعني وين احطه ذا؟ الحين اوك فهمنا ان كلينت متصل علي سرفر سايد .

بس التريقر سرفر سايد رايح لين كلينت وين مكانه ذا؟

ولا قصدك احطه ب جيم مود لما يشتغل؟ ... ?

Link to comment
6 minutes ago, 3NAD said:

الكود ذا حطه في ملف كلاينت بس

 

و حق سيرفر سايد , هذا كلاينت إيفنت انت مسويه من اول

مشكوور حبيبي عنآد مأكنت داري اني اضيف افينت ثاني ب سرفر سايد ماقصرت حبيبي  ❤️

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...