Jump to content

استفسار


Recommended Posts

 

NBox = guiCreateEdit(199, 79, 100, 32, "", false, iPrestege.window[1] );
addEventHandler("onClientGUIComboBoxAccepted",root,
  function ()
    if source == NBox then
      triggerServerEvent("Markun")
      end
    end 
)

 

واضفت هذا في السيرفر تحت  حدث دخول الماركر

        aMarker = createMarker ( aX,aY,aZ-1,'cylinder',1.25,aR,aG,aB,255 );
        setElementData ( aMarker,'aMarkerType',aType );
        if getElementData ( source,'aGotThePos' ) then
        removeElementData ( source,'aGotThePos' )
        aSetMessage ( '[UsefulPanel] The '..aMessage..' Marker Created Successfully!',source,0,255,0 );
        setElementDimension ( aMarker, 100 )
           end
    end
);

addEvent("Markun",true)
addEventHandler("Markun",root,
function ()
local Numder = tonumber ( guiGetText ( NBox ) )
    value = value + 1
if value > then
return
if variable >= 1 limit then
destroyElement (aMarker)
end
end
    end
)

 

ابي انا احدد في الايديت كم شخص يدخل الماركر وثم ينحذف من نفسة

Edited by GTA San
Link to comment

عجزت افهم الكود من التخبيص عالعموم جرب

    NBox = guiCreateEdit(199, 79, 100, 32, "", false, iPrestege.window[1] );
    addEventHandler("onClientGUIComboBoxAccepted",root,
      function ()
        if source == NBox then -- هنا المفروض يكون اسم الكومبو بوكس
		local No = guiGetText(NBox)
          triggerServerEvent("Markun",localplayer,No)
          end
        end 
    )
	value = 0
    addEvent("Markun",true)
    addEventHandler("Markun",root,
    function (No)
        value = value + 1
    if value >= tonumber ( No ) then
    destroyElement (aMarker)
    end
        end
    )

 

  • Thanks 1
Link to comment
1 hour ago, *RayaN-Alharbi. said:

عجزت افهم الكود من التخبيص عالعموم جرب


    NBox = guiCreateEdit(199, 79, 100, 32, "", false, iPrestege.window[1] );
    addEventHandler("onClientGUIComboBoxAccepted",root,
      function ()
        if source == NBox then -- هنا المفروض يكون اسم الكومبو بوكس
		local No = guiGetText(NBox)
          triggerServerEvent("Markun",localplayer,No)
          end
        end 
    )

	value = 0
    addEvent("Markun",true)
    addEventHandler("Markun",root,
    function (No)
        value = value + 1
    if value >= tonumber ( No ) then
    destroyElement (aMarker)
    end
        end
    )

 

 

 

ماشتغل معي بس تراة ايديت بوس بس حطيت حدث كومبو بوكس لان مااعرفت ششحط 

Link to comment
20 minutes ago, N3xT said:

عطني الحدث الخاص بدخول الماركر

onMarkerHit

هذأ هوة

 

addEventHandler ( 'onMarkerHit',resourceRoot,
    function ( aPlayer )
        if aPlayer and getElementType ( aPlayer ) == 'player' then
        if getElementData ( aPlayer,'aRemoverAdmin' ) == true then return false end
        if getElementData ( source,'aMarkerType' ) == 1 then
   	  --  givePlayerMoney( aPlayer,aRandomMoney );	
	  
	  
	  	setElementData(aPlayer, "xp", (getElementData(aPlayer, "xp") or 0) + 10)
		setElementData(aPlayer, "Money", (getElementData(aPlayer, "Money") or 0) + 50000)


		
		setElementDimension( aPlayer, 0 )
			setElementPosition( aPlayer, 1232.6940917969,-1334.7413330078,14.1244764328 )
	  
        elseif getElementData ( source,'aMarkerType' ) == 2 then
        giveWeapon ( aPlayer,tonumber ( aRandomWeapons [ math.random ( #aRandomWeapons ) ] ),aRandomAmmo,true );
        elseif getElementData ( source,'aMarkerType' ) == 3 and not isPedInVehicle ( aPlayer ) then
        if aPlayerVehicle [aPlayer] and isElement ( aPlayerVehicle [aPlayer] ) then
        destroyElement ( aPlayerVehicle [aPlayer] );
        aPlayerVehicle [aPlayer] = nil
    	end;
        aPos = Vector3 ( getElementPosition( aPlayer ) );
        aPlayerVehicle [aPlayer] = createVehicle ( tonumber ( aRandomVehicles [ math.random ( #aRandomVehicles ) ] ),aPos.x+5,aPos.y,aPos.z );
        warpPedIntoVehicle ( aPlayer,aPlayerVehicle [aPlayer] );
        elseif getElementData ( source,'aMarkerType' ) == 4 then
        setElementHealth ( aPlayer,100 );
        elseif getElementData ( source,'aMarkerType' ) == 5 then
        setPedArmor ( aPlayer,100 );
        elseif getElementData ( source,'aMarkerType' ) == 6 then
        killPed ( aPlayer );
        elseif getElementData ( source,'aMarkerType' ) == 7 and isPedInVehicle ( aPlayer ) then
        fixVehicle( getPedOccupiedVehicle( aPlayer ) );
        end
    end
end
);

 

Edited by GTA San
Link to comment

Client:

NBox = guiCreateEdit(199, 79, 100, 32, "", false, iPrestege.window[1] );

addEventHandler("onClientGUIClick", root,
	function ()
		if ( source == الزر ) then
			local text = guiGetText ( NBox )
			if ( text ) then
				triggerServerEvent("max:marker", localPlayer, tonumber(text))
			end
		end
    end 
)

Server:

local maxPlayers = 0
local i = 0
addEvent("max:marker", true)
addEventHandler("max:marker", root,
	function ( number )
		if ( number ) then
			maxPlayers = number
			i = 0
		end
	end
)


addEventHandler ( 'onMarkerHit',resourceRoot,
    function ( aPlayer )
        if aPlayer and getElementType ( aPlayer ) == 'player' then
			if getElementData ( aPlayer,'aRemoverAdmin' ) == true then return false end
			if ( maxPlayers ~= 0 ) then
				i = i + 1
				if ( i >= maxPlayers ) then
					if ( isElement ( source ) ) then
						destroyElement ( source )
						return
					end
				end
			else
				if getElementData ( source,'aMarkerType' ) == 1 then
					--  givePlayerMoney( aPlayer,aRandomMoney );	 
					setElementData(aPlayer, "xp", (getElementData(aPlayer, "xp") or 0) + 10)
					setElementData(aPlayer, "Money", (getElementData(aPlayer, "Money") or 0) + 50000)
					exports["guimessages"]:outputServer(root, "#E9E206 MoNey: 50000 Xp: 100  #00FF00:[ " .. getPlayerName(aPlayer) .. " ]:  #0000FF فائز بالمسأبقة" ,30, 171, 210)
					setElementDimension( aPlayer, 0 )
					setElementPosition( aPlayer, 1232.6940917969,-1334.7413330078,14.1244764328 )
					destroyElement ( source )
				elseif getElementData ( source,'aMarkerType' ) == 2 then
					giveWeapon ( aPlayer,tonumber ( aRandomWeapons [ math.random ( #aRandomWeapons ) ] ),aRandomAmmo,true );
				elseif getElementData ( source,'aMarkerType' ) == 3 and not isPedInVehicle ( aPlayer ) then
					if aPlayerVehicle [aPlayer] and isElement ( aPlayerVehicle [aPlayer] ) then
						destroyElement ( aPlayerVehicle [aPlayer] );
						aPlayerVehicle [aPlayer] = nil
					end;
					aPos = Vector3 ( getElementPosition( aPlayer ) );
					aPlayerVehicle [aPlayer] = createVehicle ( tonumber ( aRandomVehicles [ math.random ( #aRandomVehicles ) ] ),aPos.x+5,aPos.y,aPos.z );
					warpPedIntoVehicle ( aPlayer,aPlayerVehicle [aPlayer] );
				elseif getElementData ( source,'aMarkerType' ) == 4 then
					setElementHealth ( aPlayer,100 );
				elseif getElementData ( source,'aMarkerType' ) == 5 then
					setPedArmor ( aPlayer,100 );
				elseif getElementData ( source,'aMarkerType' ) == 6 then
					killPed ( aPlayer );
				elseif getElementData ( source,'aMarkerType' ) == 7 and isPedInVehicle ( aPlayer ) then
					fixVehicle( getPedOccupiedVehicle( aPlayer ) );
				end
			end
		end
	end
);

 

  • Thanks 1
Link to comment

تسلم الف

واجهتني مشاكل ي اخوي

لاسويت الماركر مع العدد في الايديت يصير مايكسب فلوس

ولكن لو سويت ماركر بدون ماكتب شي في الايديت يضبط ويجي فلوس

والشي الاخر لو كتبت عدد في الايديت ثم سويت ماركر يرفض  يجي خطاء ديبوق , يعني يجبرني اني اسوي ماركر اول ثم اكتب العدد في الايديت او لزم اكتب صفر ثم واضغط الزر

وثم اكتب العدد الجديد ’ بس ياخوي اهم شي المشكلة الاولى مايجي فلوس مع تتحديد الرقم

 

local maxPlayers = 0
local i = 0
addEvent("max:marker", true)
addEventHandler("max:marker", root,
	function ( number )
		if ( number ) then
			maxPlayers = number
			i = 0
		end
	end
)


addEventHandler ( 'onMarkerHit',resourceRoot,
    function ( aPlayer )
        if aPlayer and getElementType ( aPlayer ) == 'player' then
			if getElementData ( aPlayer,'aRemoverAdmin' ) == true then return false end
			if ( maxPlayers ~= 0 ) then
				i = i + 1
				if ( i >= maxPlayers ) then
					if ( isElement ( source ) ) then
						destroyElement ( source )
						return
					end
				end
			else
				if getElementData ( source,'aMarkerType' ) == 1 then
					--  givePlayerMoney( aPlayer,aRandomMoney );	 
					setElementData(aPlayer, "xp", (getElementData(aPlayer, "xp") or 0) + 10)
					setElementData(aPlayer, "Money", (getElementData(aPlayer, "Money") or 0) + 50000)
					exports["guimessages"]:outputServer(root, "#E9E206 MoNey: 50000 Xp: 100  #00FF00:[ " .. getPlayerName(aPlayer) .. " ]:  #0000FF فائز بالمسأبقة" ,30, 171, 210)
					setElementDimension( aPlayer, 0 )
					setElementPosition( aPlayer, 1232.6940917969,-1334.7413330078,14.1244764328 )
				
				elseif getElementData ( source,'aMarkerType' ) == 2 then
					giveWeapon ( aPlayer,tonumber ( aRandomWeapons [ math.random ( #aRandomWeapons ) ] ),aRandomAmmo,true );
				elseif getElementData ( source,'aMarkerType' ) == 3 and not isPedInVehicle ( aPlayer ) then
					if aPlayerVehicle [aPlayer] and isElement ( aPlayerVehicle [aPlayer] ) then
						destroyElement ( aPlayerVehicle [aPlayer] );
						aPlayerVehicle [aPlayer] = nil
					end;
					aPos = Vector3 ( getElementPosition( aPlayer ) );
					aPlayerVehicle [aPlayer] = createVehicle ( tonumber ( aRandomVehicles [ math.random ( #aRandomVehicles ) ] ),aPos.x+5,aPos.y,aPos.z );
					warpPedIntoVehicle ( aPlayer,aPlayerVehicle [aPlayer] );
				elseif getElementData ( source,'aMarkerType' ) == 4 then
					setElementHealth ( aPlayer,100 );
				elseif getElementData ( source,'aMarkerType' ) == 5 then
					setPedArmor ( aPlayer,100 );
				elseif getElementData ( source,'aMarkerType' ) == 6 then
					killPed ( aPlayer );
				elseif getElementData ( source,'aMarkerType' ) == 7 and isPedInVehicle ( aPlayer ) then
					fixVehicle( getPedOccupiedVehicle( aPlayer ) );
				end
			end
		end
	end
);

 

29 minutes ago, N3xT said:

مافيه غيره؟

بس هذي مشكلة

Link to comment
local maxPlayers = 0
local i = 0
addEvent("max:marker", true)
addEventHandler("max:marker", root,
	function ( number )
		if ( number ) then
			maxPlayers = number
			i = 0
		end
	end
)


addEventHandler ( 'onMarkerHit',resourceRoot,
    function ( aPlayer )
        if aPlayer and getElementType ( aPlayer ) == 'player' then
			if getElementData ( aPlayer,'aRemoverAdmin' ) == true then return false end
			if ( maxPlayers ~= 0 ) then
				i = i + 1
				if ( i >= maxPlayers ) then
					if ( isElement ( source ) ) then
						destroyElement ( source )
					end
				end
			else
				if ( source and getElementType(source) == "marker" ) then
					if getElementData ( source,'aMarkerType' ) == 1 then
						--  givePlayerMoney( aPlayer,aRandomMoney );	 
						setElementData(aPlayer, "xp", (getElementData(aPlayer, "xp") or 0) + 10)
						setElementData(aPlayer, "Money", (getElementData(aPlayer, "Money") or 0) + 50000)
						exports["guimessages"]:outputServer(root, "#E9E206 MoNey: 50000 Xp: 100  #00FF00:[ " .. getPlayerName(aPlayer) .. " ]:  #0000FF فائز بالمسأبقة" ,30, 171, 210)
						setElementDimension( aPlayer, 0 )
						setElementPosition( aPlayer, 1232.6940917969,-1334.7413330078,14.1244764328 )
					
					elseif getElementData ( source,'aMarkerType' ) == 2 then
						giveWeapon ( aPlayer,tonumber ( aRandomWeapons [ math.random ( #aRandomWeapons ) ] ),aRandomAmmo,true );
					elseif getElementData ( source,'aMarkerType' ) == 3 and not isPedInVehicle ( aPlayer ) then
						if aPlayerVehicle [aPlayer] and isElement ( aPlayerVehicle [aPlayer] ) then
							destroyElement ( aPlayerVehicle [aPlayer] );
							aPlayerVehicle [aPlayer] = nil
						end;
						aPos = Vector3 ( getElementPosition( aPlayer ) );
						aPlayerVehicle [aPlayer] = createVehicle ( tonumber ( aRandomVehicles [ math.random ( #aRandomVehicles ) ] ),aPos.x+5,aPos.y,aPos.z );
						warpPedIntoVehicle ( aPlayer,aPlayerVehicle [aPlayer] );
					elseif getElementData ( source,'aMarkerType' ) == 4 then
						setElementHealth ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 5 then
						setPedArmor ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 6 then
						killPed ( aPlayer );
					elseif getElementData ( source,'aMarkerType' ) == 7 and isPedInVehicle ( aPlayer ) then
						fixVehicle( getPedOccupiedVehicle( aPlayer ) );
					end
				end
			end
		end
	end
);

 

  • Thanks 1
Link to comment
13 minutes ago, N3xT said:

local maxPlayers = 0
local i = 0
addEvent("max:marker", true)
addEventHandler("max:marker", root,
	function ( number )
		if ( number ) then
			maxPlayers = number
			i = 0
		end
	end
)


addEventHandler ( 'onMarkerHit',resourceRoot,
    function ( aPlayer )
        if aPlayer and getElementType ( aPlayer ) == 'player' then
			if getElementData ( aPlayer,'aRemoverAdmin' ) == true then return false end
			if ( maxPlayers ~= 0 ) then
				i = i + 1
				if ( i >= maxPlayers ) then
					if ( isElement ( source ) ) then
						destroyElement ( source )
					end
				end
			else
				if ( source and getElementType(source) == "marker" ) then
					if getElementData ( source,'aMarkerType' ) == 1 then
						--  givePlayerMoney( aPlayer,aRandomMoney );	 
						setElementData(aPlayer, "xp", (getElementData(aPlayer, "xp") or 0) + 10)
						setElementData(aPlayer, "Money", (getElementData(aPlayer, "Money") or 0) + 50000)
						exports["guimessages"]:outputServer(root, "#E9E206 MoNey: 50000 Xp: 100  #00FF00:[ " .. getPlayerName(aPlayer) .. " ]:  #0000FF فائز بالمسأبقة" ,30, 171, 210)
						setElementDimension( aPlayer, 0 )
						setElementPosition( aPlayer, 1232.6940917969,-1334.7413330078,14.1244764328 )
					
					elseif getElementData ( source,'aMarkerType' ) == 2 then
						giveWeapon ( aPlayer,tonumber ( aRandomWeapons [ math.random ( #aRandomWeapons ) ] ),aRandomAmmo,true );
					elseif getElementData ( source,'aMarkerType' ) == 3 and not isPedInVehicle ( aPlayer ) then
						if aPlayerVehicle [aPlayer] and isElement ( aPlayerVehicle [aPlayer] ) then
							destroyElement ( aPlayerVehicle [aPlayer] );
							aPlayerVehicle [aPlayer] = nil
						end;
						aPos = Vector3 ( getElementPosition( aPlayer ) );
						aPlayerVehicle [aPlayer] = createVehicle ( tonumber ( aRandomVehicles [ math.random ( #aRandomVehicles ) ] ),aPos.x+5,aPos.y,aPos.z );
						warpPedIntoVehicle ( aPlayer,aPlayerVehicle [aPlayer] );
					elseif getElementData ( source,'aMarkerType' ) == 4 then
						setElementHealth ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 5 then
						setPedArmor ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 6 then
						killPed ( aPlayer );
					elseif getElementData ( source,'aMarkerType' ) == 7 and isPedInVehicle ( aPlayer ) then
						fixVehicle( getPedOccupiedVehicle( aPlayer ) );
					end
				end
			end
		end
	end
);

 

 

الحين المشكلة بس يوم اكتب رقم في الايديت واكبس الزر مايجي فلوس

ويوم اسوي ماركر وما اكتب شي ب الايديت يجي

ومافي اخطاء

Edited by GTA San
Link to comment
local maxPlayers = 0
local i = 0
addEvent("max:marker", true)
addEventHandler("max:marker", root,
	function ( number )
		if ( number ) then
			maxPlayers = number
			i = 0
		end
	end
)


addEventHandler ( 'onMarkerHit',resourceRoot,
    function ( aPlayer )
        if aPlayer and getElementType ( aPlayer ) == 'player' then
			if getElementData ( aPlayer,'aRemoverAdmin' ) == true then return false end
				if ( maxPlayers ~= 0 ) then
					i = i + 1
					if ( i >= maxPlayers ) then
						if ( isElement ( source ) ) then
							destroyElement ( source )
						end
					end
				end
				if ( source and getElementType(source) == "marker" ) then
					if getElementData ( source,'aMarkerType' ) == 1 then
						--  givePlayerMoney( aPlayer,aRandomMoney );	 
						setElementData(aPlayer, "xp", (getElementData(aPlayer, "xp") or 0) + 10)
						setElementData(aPlayer, "Money", (getElementData(aPlayer, "Money") or 0) + 50000)
						exports["guimessages"]:outputServer(root, "#E9E206 MoNey: 50000 Xp: 100  #00FF00:[ " .. getPlayerName(aPlayer) .. " ]:  #0000FF فائز بالمسأبقة" ,30, 171, 210)
						setElementDimension( aPlayer, 0 )
						setElementPosition( aPlayer, 1232.6940917969,-1334.7413330078,14.1244764328 )
					
					elseif getElementData ( source,'aMarkerType' ) == 2 then
						giveWeapon ( aPlayer,tonumber ( aRandomWeapons [ math.random ( #aRandomWeapons ) ] ),aRandomAmmo,true );
					elseif getElementData ( source,'aMarkerType' ) == 3 and not isPedInVehicle ( aPlayer ) then
						if aPlayerVehicle [aPlayer] and isElement ( aPlayerVehicle [aPlayer] ) then
							destroyElement ( aPlayerVehicle [aPlayer] );
							aPlayerVehicle [aPlayer] = nil
						end;
						aPos = Vector3 ( getElementPosition( aPlayer ) );
						aPlayerVehicle [aPlayer] = createVehicle ( tonumber ( aRandomVehicles [ math.random ( #aRandomVehicles ) ] ),aPos.x+5,aPos.y,aPos.z );
						warpPedIntoVehicle ( aPlayer,aPlayerVehicle [aPlayer] );
					elseif getElementData ( source,'aMarkerType' ) == 4 then
						setElementHealth ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 5 then
						setPedArmor ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 6 then
						killPed ( aPlayer );
					elseif getElementData ( source,'aMarkerType' ) == 7 and isPedInVehicle ( aPlayer ) then
						fixVehicle( getPedOccupiedVehicle( aPlayer ) );
					end
				end
		end
	end
);

 

  • Thanks 1
Link to comment
5 minutes ago, N3xT said:

local maxPlayers = 0
local i = 0
addEvent("max:marker", true)
addEventHandler("max:marker", root,
	function ( number )
		if ( number ) then
			maxPlayers = number
			i = 0
		end
	end
)


addEventHandler ( 'onMarkerHit',resourceRoot,
    function ( aPlayer )
        if aPlayer and getElementType ( aPlayer ) == 'player' then
			if getElementData ( aPlayer,'aRemoverAdmin' ) == true then return false end
				if ( maxPlayers ~= 0 ) then
					i = i + 1
					if ( i >= maxPlayers ) then
						if ( isElement ( source ) ) then
							destroyElement ( source )
						end
					end
				end
				if ( source and getElementType(source) == "marker" ) then
					if getElementData ( source,'aMarkerType' ) == 1 then
						--  givePlayerMoney( aPlayer,aRandomMoney );	 
						setElementData(aPlayer, "xp", (getElementData(aPlayer, "xp") or 0) + 10)
						setElementData(aPlayer, "Money", (getElementData(aPlayer, "Money") or 0) + 50000)
						exports["guimessages"]:outputServer(root, "#E9E206 MoNey: 50000 Xp: 100  #00FF00:[ " .. getPlayerName(aPlayer) .. " ]:  #0000FF فائز بالمسأبقة" ,30, 171, 210)
						setElementDimension( aPlayer, 0 )
						setElementPosition( aPlayer, 1232.6940917969,-1334.7413330078,14.1244764328 )
					
					elseif getElementData ( source,'aMarkerType' ) == 2 then
						giveWeapon ( aPlayer,tonumber ( aRandomWeapons [ math.random ( #aRandomWeapons ) ] ),aRandomAmmo,true );
					elseif getElementData ( source,'aMarkerType' ) == 3 and not isPedInVehicle ( aPlayer ) then
						if aPlayerVehicle [aPlayer] and isElement ( aPlayerVehicle [aPlayer] ) then
							destroyElement ( aPlayerVehicle [aPlayer] );
							aPlayerVehicle [aPlayer] = nil
						end;
						aPos = Vector3 ( getElementPosition( aPlayer ) );
						aPlayerVehicle [aPlayer] = createVehicle ( tonumber ( aRandomVehicles [ math.random ( #aRandomVehicles ) ] ),aPos.x+5,aPos.y,aPos.z );
						warpPedIntoVehicle ( aPlayer,aPlayerVehicle [aPlayer] );
					elseif getElementData ( source,'aMarkerType' ) == 4 then
						setElementHealth ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 5 then
						setPedArmor ( aPlayer,100 );
					elseif getElementData ( source,'aMarkerType' ) == 6 then
						killPed ( aPlayer );
					elseif getElementData ( source,'aMarkerType' ) == 7 and isPedInVehicle ( aPlayer ) then
						fixVehicle( getPedOccupiedVehicle( aPlayer ) );
					end
				end
		end
	end
);

 

 

لا لا ما اصددق ضبط زمان وانا حاول فيها

ممدري شققلك ي شييخخ الله يسعدك ويجعل ايامك وسنينك كلها اعياد مسرات  

:)

 

  • Like 1
Link to comment
1 hour ago, N3xT 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...