GTA San Posted June 11, 2018 Share Posted June 11, 2018 (edited) 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 June 11, 2018 by GTA San Link to comment
#Major . Posted June 12, 2018 Share Posted June 12, 2018 عجزت افهم الكود من التخبيص عالعموم جرب 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 ) 1 Link to comment
GTA San Posted June 12, 2018 Author Share Posted June 12, 2018 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
N3xT Posted June 12, 2018 Share Posted June 12, 2018 عطني الحدث الخاص بدخول الماركر onMarkerHit 1 Link to comment
GTA San Posted June 12, 2018 Author Share Posted June 12, 2018 (edited) 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 June 12, 2018 by GTA San Link to comment
GTA San Posted June 12, 2018 Author Share Posted June 12, 2018 (edited) 2 minutes ago, N3xT said: مافيه غيره؟ مافية الا ذا بالسيرفر االكلنت مافية خخير شر Edited June 12, 2018 by GTA San Link to comment
N3xT Posted June 12, 2018 Share Posted June 12, 2018 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 ); 1 Link to comment
GTA San Posted June 12, 2018 Author Share Posted June 12, 2018 تسلم الف واجهتني مشاكل ي اخوي لاسويت الماركر مع العدد في الايديت يصير مايكسب فلوس ولكن لو سويت ماركر بدون ماكتب شي في الايديت يضبط ويجي فلوس والشي الاخر لو كتبت عدد في الايديت ثم سويت ماركر يرفض يجي خطاء ديبوق , يعني يجبرني اني اسوي ماركر اول ثم اكتب العدد في الايديت او لزم اكتب صفر ثم واضغط الزر وثم اكتب العدد الجديد ’ بس ياخوي اهم شي المشكلة الاولى مايجي فلوس مع تتحديد الرقم 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
N3xT Posted June 12, 2018 Share Posted June 12, 2018 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 ); 1 Link to comment
GTA San Posted June 12, 2018 Author Share Posted June 12, 2018 (edited) 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 June 12, 2018 by GTA San Link to comment
N3xT Posted June 12, 2018 Share Posted June 12, 2018 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 ); 1 Link to comment
GTA San Posted June 12, 2018 Author Share Posted June 12, 2018 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 ); لا لا ما اصددق ضبط زمان وانا حاول فيها ممدري شققلك ي شييخخ الله يسعدك ويجعل ايامك وسنينك كلها اعياد مسرات 1 Link to comment
GTA San Posted June 12, 2018 Author Share Posted June 12, 2018 1 hour ago, N3xT 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