Jump to content

طلب رقم 4


Master_MTA

Recommended Posts

السلام عليكم ورحمة الله وبركاته اليوم جبتلكم سؤال

كالعاده يلحس المخ زي ما متعودين مني هههههه الزبده خلنا نخش بالموضوع

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

انا ضفت له كلنت سايد الكلنت سايد ذا يحتوي على نافذه النافذه فيها جريد لست

طيب انا ابي لما الشخص يعكس الطريق او يزيد السرعه  ينحط عليه داتا وهاذا موجود مافيه مشاكل

لكن المشكلللللللللللللل المشكل

هو انه اذا دخل الماركر تطلعله اللوحه برضو ذي حليتها مافيها مشاكل

طيب المشكله وين المشكله في

ابيه يسوي اتيم تكست تمام

يجيب اذا اللاعب عليه مخالفه يحط اتيم تكست عليه

لو 2 يحط 2 اتيم تكست

وهكذا

تفضلو الاكواد

 

سيرفر سايد

 

 



yourSerial = 'A9292384E5978BD564EFBF5A57AA5292';


aTrucks = 
{ [ 499 ] = true ; [ 609 ] = true ; [ 498 ] = true ; [ 524 ] = true ; [ 532 ] = true ; [ 578 ] = true ;
  [ 486 ] = true ; [ 406 ] = true ; [ 573 ] = true ; [ 455 ] = true ; [ 588 ] = true ; [ 403 ] = true ;
  [ 514 ] = true ; [ 423 ] = true ; [ 414 ] = true ; [ 443 ] = true ; [ 515 ] = true ; [ 531 ] = true ;
  [ 456 ] = true ; [ 414 ] = true ; [ 459 ] = true ; [ 422 ] = true ; [ 482 ] = true ; [ 605 ] = true ;
  [ 530 ] = true ; [ 418 ] = true ; [ 572 ] = true ; [ 582 ] = true ; [ 440 ] = true ; [ 543 ] = true ;
  [ 583 ] = true ; [ 478 ] = true ; [ 554 ] = true ;
}

function getElementSpeed(element,unit)
	if (unit == nil) then unit = 0 end
	if (isElement(element)) then
		local x,y,z = getElementVelocity(element)
		if (unit=="mph" or unit==1 or unit =='1') then
			return (x^2 + y^2 + z^2) ^ 0.5 * 100
		else
			return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100
		end
	else
		--outputDebugString("Not an element. Can't get speed")
		return false
	end
end

function getPlayerFromSerial( sSerial )
	for _, ePlayer in next, getElementsByType 'player' do
		if ( getPlayerSerial( ePlayer ) == sSerial ) then
			return ePlayer
		end
	end
	return false
end

cColLeft = createColCuboid( 1773, 863, 2, 23, 1360, 8 );
createRadarArea( 1773, 863, 23, 1360, 0, 255, 0, 100 );
cColRight = createColCuboid( 1799, 863, 2, 23, 1360, 8 );
createRadarArea( 1799, 863, 23, 1360, 255, 0, 0, 100 );

cCuboid = createColCuboid( 2424, -1743, 0, 110, 110, 20 );
createRadarArea( 2424, -1743, 110, 110, 0, 244, 0, 100 );

setTimer( 
	function( )
		for _, v in next, getElementsByType 'vehicle' do
			local gOccupant = getVehicleOccupant( v )
			if gOccupant and isElementWithinColShape( v, cColLeft ) then
				local gHandling = getVehicleHandling( v )
				local gModel = getElementModel( v )
				local _, _, gRotation = getElementRotation( v )
				local gSpeed = getElementSpeed( v )
				if ( gRotation > 300 ) or ( gRotation < 90 ) then
					setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) + 1 )
					if getElementData( gOccupant, '3KS' ) >= 2 then
						triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  قيادة المركبة بالاتجاه المعاكس !', 0, 200, 0 )
						destroyElement( v )
						killPed( gOccupant, gOccupant )
						takePlayerMoney( gOccupant, 400 )
						setElementData( gOccupant, '3KS', 0 )
						local gPlayer = getPlayerFromSerial( yourSerial )
						if ( gPlayer ) then
							givePlayerMoney( gPlayer, 400 )
						end
					end
				elseif ( gSpeed > 499 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  تجاوز السرعة المحددة !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 1000 )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 1000 )
					end
				elseif ( aTrucks[ gModel ] ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] قيادة مركبة اشغال عامة بدون ترخيص !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 600 )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 600 )
					end
				elseif ( gSpeed == 0 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] وقوف المركبة في أماكن غير مخصصة للوقوف !', 0, 200, 0 )
					takePlayerMoney( gOccupant, 200 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 200 )
					end	
				else 
					if getElementData( gOccupant, '3KS' ) ~= 0 then
					setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) - 1 )
					end
				end
			elseif gOccupant and isElementWithinColShape( v, cColRight ) then
				local gHandling = getVehicleHandling( v )
				local gModel = getElementModel( v )
				local _, _, gRotation = getElementRotation( v )
				local gSpeed = getElementSpeed( v ) 
				if ( gRotation < 200 ) and not( gRotation < 60 ) then
					setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) + 1 )
					if getElementData( gOccupant, '3KS' ) >= 2 then
						triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  قيادة المركبة بالاتجاه المعاكس !', 0, 200, 0 )
						destroyElement( v )
						killPed( gOccupant, gOccupant )
						takePlayerMoney( gOccupant, 400 )
						setElementData( gOccupant, '3KS', 0 )
						local gPlayer = getPlayerFromSerial( yourSerial )
						if ( gPlayer ) then
							givePlayerMoney( gPlayer, 400 )
						end
					end
				elseif ( gSpeed > 699 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  تجاوز السرعة المحددة !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 1000 )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 1000 )
					end
				elseif ( aTrucks[ gModel ] ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] قيادة مركبة اشغال عامة بدون ترخيص !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 600 )
					setElementData( gOccupant, '3KS', 0 )	
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 600 )
					end
				elseif ( gSpeed == 0 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] وقوف المركبة في أماكن غير مخصصة للوقوف !', 0, 200, 0 )
					takePlayerMoney( gOccupant, 200 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 200 )
					end
				else 
					if getElementData( gOccupant, '3KS' ) ~= 0 then
						setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) - 1 )
					end
				end
			elseif isElementWithinColShape( v, cCuboid ) then
				destroyElement( v )		
			--elseif isElementWithinColShape ( v, ColProt ) then
				--destroyElement ( v )				
			end
		end
	end, 10000, 0 
)



master = createMarker(3483.73608,-1943.34888,12.18125-1,"cylinder",2,255,255,255)

addEventHandler("onMarkerHit",master,
function(thePlayer)

triggerClientEvent(thePlayer,"openwndmq",thePlayer)


end
)

 

 

كلنت سايد

 

 

local screenW, screenH = guiGetScreenSize()
        wnd = guiCreateWindow((screenW - 783) / 2, (screenH - 417) / 2, 783, 417, "نظام المخالفات لسيرفر الملووك بواسطة ماستر", false)
        guiWindowSetSizable(wnd, false)
guiSetVisible(wnd,false)
        grid = guiCreateGridList(51, 46, 684, 246, false, wnd)
        ok = guiCreateButton(54, 332, 255, 57, "سداد المخالفه", false, wnd)
        close12 = guiCreateButton(464, 332, 255, 57, "اغلاق", false, wnd)    
addEvent("openwndmq",true)
		addEventHandler("openwndmq",root,
		function()
		local master55 = getElementData( source, '3KS' ) or 0
		guiSetVisible(wnd,true)
showCursor ( true )
		
		end
		)
		addEventHandler("onClientGUIClick",root,
		function()
if source == close12 then

		guiSetVisible(wnd,false)
showCursor ( false )
		end
		end
		)

@Default

@iPrestege

@3NAD

@Abdul KariM

 

احدى محاولاتي تحت التجربه

addEvent("openwndmq",true)
		addEventHandler("openwndmq",root,
		function()
		local column = guiGridListAddColumn( grid, "المخالفات", 0.9 )
		local row = guiGridListAddRow ( grid )
		local master55 = getElementData( source, '3KS' ) or 0
		 guiGridListSetItemText ( grid, row, column, master55, false, false )
		guiSetVisible(wnd,true)
showCursor ( true )
		
		end
		)

@TAPL

Edited by Master_MTA
Link to comment
33 minutes ago, Master_MTA said:

السلام عليكم ورحمة الله وبركاته اليوم جبتلكم سؤال

كالعاده يلحس المخ زي ما متعودين مني هههههه الزبده خلنا نخش بالموضوع

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

انا ضفت له كلنت سايد الكلنت سايد ذا يحتوي على نافذه النافذه فيها جريد لست

طيب انا ابي لما الشخص يعكس الطريق او يزيد السرعه  ينحط عليه داتا وهاذا موجود مافيه مشاكل

لكن المشكلللللللللللللل المشكل

هو انه اذا دخل الماركر تطلعله اللوحه برضو ذي حليتها مافيها مشاكل

طيب المشكله وين المشكله في

ابيه يسوي اتيم تكست تمام

يجيب اذا اللاعب عليه مخالفه يحط اتيم تكست عليه

لو 2 يحط 2 اتيم تكست

وهكذا

تفضلو الاكواد

 

سيرفر سايد

 

 


yourSerial = 'A9292384E5978BD564EFBF5A57AA5292';


aTrucks = 
{ [ 499 ] = true ; [ 609 ] = true ; [ 498 ] = true ; [ 524 ] = true ; [ 532 ] = true ; [ 578 ] = true ;
  [ 486 ] = true ; [ 406 ] = true ; [ 573 ] = true ; [ 455 ] = true ; [ 588 ] = true ; [ 403 ] = true ;
  [ 514 ] = true ; [ 423 ] = true ; [ 414 ] = true ; [ 443 ] = true ; [ 515 ] = true ; [ 531 ] = true ;
  [ 456 ] = true ; [ 414 ] = true ; [ 459 ] = true ; [ 422 ] = true ; [ 482 ] = true ; [ 605 ] = true ;
  [ 530 ] = true ; [ 418 ] = true ; [ 572 ] = true ; [ 582 ] = true ; [ 440 ] = true ; [ 543 ] = true ;
  [ 583 ] = true ; [ 478 ] = true ; [ 554 ] = true ;
}

function getElementSpeed(element,unit)
	if (unit == nil) then unit = 0 end
	if (isElement(element)) then
		local x,y,z = getElementVelocity(element)
		if (unit=="mph" or unit==1 or unit =='1') then
			return (x^2 + y^2 + z^2) ^ 0.5 * 100
		else
			return (x^2 + y^2 + z^2) ^ 0.5 * 1.61 * 100
		end
	else
		--outputDebugString("Not an element. Can't get speed")
		return false
	end
end

function getPlayerFromSerial( sSerial )
	for _, ePlayer in next, getElementsByType 'player' do
		if ( getPlayerSerial( ePlayer ) == sSerial ) then
			return ePlayer
		end
	end
	return false
end

cColLeft = createColCuboid( 1773, 863, 2, 23, 1360, 8 );
createRadarArea( 1773, 863, 23, 1360, 0, 255, 0, 100 );
cColRight = createColCuboid( 1799, 863, 2, 23, 1360, 8 );
createRadarArea( 1799, 863, 23, 1360, 255, 0, 0, 100 );

cCuboid = createColCuboid( 2424, -1743, 0, 110, 110, 20 );
createRadarArea( 2424, -1743, 110, 110, 0, 244, 0, 100 );

setTimer( 
	function( )
		for _, v in next, getElementsByType 'vehicle' do
			local gOccupant = getVehicleOccupant( v )
			if gOccupant and isElementWithinColShape( v, cColLeft ) then
				local gHandling = getVehicleHandling( v )
				local gModel = getElementModel( v )
				local _, _, gRotation = getElementRotation( v )
				local gSpeed = getElementSpeed( v )
				if ( gRotation > 300 ) or ( gRotation < 90 ) then
					setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) + 1 )
					if getElementData( gOccupant, '3KS' ) >= 2 then
						triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  قيادة المركبة بالاتجاه المعاكس !', 0, 200, 0 )
						destroyElement( v )
						killPed( gOccupant, gOccupant )
						takePlayerMoney( gOccupant, 400 )
						setElementData( gOccupant, '3KS', 0 )
						local gPlayer = getPlayerFromSerial( yourSerial )
						if ( gPlayer ) then
							givePlayerMoney( gPlayer, 400 )
						end
					end
				elseif ( gSpeed > 499 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  تجاوز السرعة المحددة !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 1000 )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 1000 )
					end
				elseif ( aTrucks[ gModel ] ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] قيادة مركبة اشغال عامة بدون ترخيص !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 600 )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 600 )
					end
				elseif ( gSpeed == 0 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] وقوف المركبة في أماكن غير مخصصة للوقوف !', 0, 200, 0 )
					takePlayerMoney( gOccupant, 200 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 200 )
					end	
				else 
					if getElementData( gOccupant, '3KS' ) ~= 0 then
					setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) - 1 )
					end
				end
			elseif gOccupant and isElementWithinColShape( v, cColRight ) then
				local gHandling = getVehicleHandling( v )
				local gModel = getElementModel( v )
				local _, _, gRotation = getElementRotation( v )
				local gSpeed = getElementSpeed( v ) 
				if ( gRotation < 200 ) and not( gRotation < 60 ) then
					setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) + 1 )
					if getElementData( gOccupant, '3KS' ) >= 2 then
						triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  قيادة المركبة بالاتجاه المعاكس !', 0, 200, 0 )
						destroyElement( v )
						killPed( gOccupant, gOccupant )
						takePlayerMoney( gOccupant, 400 )
						setElementData( gOccupant, '3KS', 0 )
						local gPlayer = getPlayerFromSerial( yourSerial )
						if ( gPlayer ) then
							givePlayerMoney( gPlayer, 400 )
						end
					end
				elseif ( gSpeed > 699 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. ']  تجاوز السرعة المحددة !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 1000 )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 1000 )
					end
				elseif ( aTrucks[ gModel ] ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] قيادة مركبة اشغال عامة بدون ترخيص !', 0, 200, 0 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					takePlayerMoney( gOccupant, 600 )
					setElementData( gOccupant, '3KS', 0 )	
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 600 )
					end
				elseif ( gSpeed == 0 ) then
					triggerClientEvent( root, 'doOutputMessage', root, '[ ساهر ]: [x' .. getPlayerName( gOccupant ): gsub ( "#%x%x%x%x%x%x", "" ).. '] وقوف المركبة في أماكن غير مخصصة للوقوف !', 0, 200, 0 )
					takePlayerMoney( gOccupant, 200 )
					destroyElement( v )
					killPed( gOccupant, gOccupant )
					setElementData( gOccupant, '3KS', 0 )
					local gPlayer = getPlayerFromSerial( yourSerial )
					if ( gPlayer ) then
						givePlayerMoney( gPlayer, 200 )
					end
				else 
					if getElementData( gOccupant, '3KS' ) ~= 0 then
						setElementData( gOccupant, '3KS',( getElementData( gOccupant, '3KS' ) or 0 ) - 1 )
					end
				end
			elseif isElementWithinColShape( v, cCuboid ) then
				destroyElement( v )		
			--elseif isElementWithinColShape ( v, ColProt ) then
				--destroyElement ( v )				
			end
		end
	end, 10000, 0 
)



master = createMarker(3483.73608,-1943.34888,12.18125-1,"cylinder",2,255,255,255)

addEventHandler("onMarkerHit",master,
function(thePlayer)

triggerClientEvent(thePlayer,"openwndmq",thePlayer)


end
)

 

 

كلنت سايد

 

 

local screenW, screenH = guiGetScreenSize()
        wnd = guiCreateWindow((screenW - 783) / 2, (screenH - 417) / 2, 783, 417, "نظام المخالفات لسيرفر الملووك بواسطة ماستر", false)
        guiWindowSetSizable(wnd, false)
guiSetVisible(wnd,false)
        grid = guiCreateGridList(51, 46, 684, 246, false, wnd)
        ok = guiCreateButton(54, 332, 255, 57, "سداد المخالفه", false, wnd)
        close12 = guiCreateButton(464, 332, 255, 57, "اغلاق", false, wnd)    
addEvent("openwndmq",true)
		addEventHandler("openwndmq",root,
		function()
		local master55 = getElementData( source, '3KS' ) or 0
		guiSetVisible(wnd,true)
showCursor ( true )
		
		end
		)
		addEventHandler("onClientGUIClick",root,
		function()
if source == close12 then

		guiSetVisible(wnd,false)
showCursor ( false )
		end
		end
		)

@Default

@iPrestege

@3NAD

@Abdul KariM

 

احدى محاولاتي تحت التجربه

addEvent("openwndmq",true)
		addEventHandler("openwndmq",root,
		function()
		local column = guiGridListAddColumn( grid, "المخالفات", 0.9 )
		local row = guiGridListAddRow ( grid )
		local master55 = getElementData( source, '3KS' ) or 0
		 guiGridListSetItemText ( grid, row, column, master55, false, false )
		guiSetVisible(wnd,true)
showCursor ( true )
		
		end
		)

@TAPL

تم الحل يغلق زبطت الطريقه

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...