Jump to content

jafar

Members
  • Posts

    1,434
  • Joined

  • Last visited

Everything posted by jafar

  1. function toggleFRWindow( ) if getPlayerTeam ( localPlayer ) and getPlayerTeam ( localPlayer ) ~= getTeamFromName ( "Hajwalah" ) then return end if isWindowOpen(wndMain) then showCursor(false) hideAllWindows() colorPicker.closeSelect() else showCursor(true) showAllWindows() end end
  2. لازم تستخدم tonumber لانه guiGetText راح يرسل القيمة string
  3. المشكلة من الإسل ..
  4. you're welcome.
  5. الكود كلنت ف كل لاعب بصير العد خاص فيه , فما يحتاج الجدول
  6. بالنسبة للطلب الأول , --WANTED LEVEL IF A PLAYER IS MURDERED BY A NON-COP, OR IF AN INNOCENT PERSON IS MURDERED BY A COP function aplayerdied( ammo, attacker, weapon, bodypart ) local glevel = getPlayerWantedLevel ( source ) if isElement(attacker) then if getPlayerTeam ( attacker ) and getPlayerTeam ( attacker ) == getTeamFromName ( "Police" ) then return end local wlevel = getPlayerWantedLevel( source ) if wlevel > 0 then if getElementParent(attacker) == kingCOP then setPlayerWantedLevel( source, 0 ) end end if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 6 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 6 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end setPlayerWantedLevel( source, 0 ) end addEventHandler ( "onPlayerWasted", getRootElement(), aplayerdied ) --WANTED LEVEL IF A POLICE OFFICER IS ATTACKED function assaultinganofficer ( attacker, weapon, bodypart, loss ) if isElement(attacker) then if getPlayerTeam ( attacker ) and getPlayerTeam ( attacker ) == getTeamFromName ( "Police" ) then return end if getElementParent(source) == kingCOP then if ( getElementType( attacker ) == "player" ) then if getElementParent(attacker) == kingCOP then return end elseif ( getElementType( attacker ) == "vehicle" ) then thedriver = getVehicleController( attacker ) if isElement(thedriver) then if getElementParent(thedriver) == kingCOP then return end end end if (getElementData ( source, "justdamaged" ) ~= "yes") and (source ~= attacker) then setElementData ( source, "justdamaged", "yes" ) local damagereset = setTimer ( resethurt, 20000, 1, source ) if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 1 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then local thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 1 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end end end end addEventHandler ( "onPlayerDamage", getRootElement(), assaultinganofficer ) function resethurt(source) if isElement(source) then setElementData ( source, "justdamaged", "none" ) end end --WANTED LEVEL IF SOMEONE OTHER THAN A COP JACKS SOMEONE function carjackcheck(theVehicle, seat, jacker) if isElement(jacker) then if getPlayerTeam ( jacker ) and getPlayerTeam ( jacker ) == getTeamFromName ( "Police" ) then return end if getElementParent(jacker) == kingCOP then return end local wlevel = getPlayerWantedLevel( jacker ) if wlevel < 4 then setPlayerWantedLevel( jacker, wlevel+1 ) end end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), carjackcheck ) --WANTED LEVEL IF NON-COP TRIES TO USE A COP CAR function copcarcheck(theVehicle, seat, jacked) if getElementParent(source) == kingCOP then return else if getPlayerTeam ( source ) and getPlayerTeam ( source ) == getTeamFromName ( "Police" ) then return end local carid = getElementModel( theVehicle ) if carid == 598 or carid == 596 or carid == 597 or carid == 427 or carid == 490 or carid == 599 then if (getElementData ( source, "currentstatus" ) ~= "underarrest" ) then local wlevel = getPlayerWantedLevel( source ) if wlevel < 4 then setPlayerWantedLevel( source, wlevel+1 ) end end end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), copcarcheck ) -- WANTED LEVEL IF A COP SEES SOMEONE DOING SOMETHING ILLEGAL -- TO MAKE THIS WORK WITH YOUR SCRIPT, SET A PLAYERS ELEMENT DATA "legalstatus" TO "illegal" WHILE DOING SOMETHING ILLEGAL -- DONT FORGET TO CHANGE IT TO SOMETHING ELSE AFTERWARDS THOUGH!! function inspection ( element ) if isElement(element) then if ( getElementType ( element ) == "player" ) then if getElementParent(source) == kingCOP then local wlevel = getPlayerWantedLevel( source ) if wlevel == 0 then if (getElementData ( element, "legalstatus" ) == "illegal" ) then if getPlayerTeam ( element ) and getPlayerTeam ( element ) == getTeamFromName ( "Police" ) then return end local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 15 ) then setPlayerWantedLevel ( element, 1 ) end end end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), inspection ) --STUFF TO MAKE BRIBE PICKUPS WORK function pickedUpWantedCheck ( player ) if ( getElementType(source) == "pickup" ) then if getPickupType ( source ) == 3 then if (getElementData ( source, "model" ) == "1247" ) then if getPlayerTeam ( player ) and getPlayerTeam ( player ) == getTeamFromName ( "Police" ) then return end local level = getPlayerWantedLevel(player) if ( level > 0 ) then setPlayerWantedLevel ( player, level-1 ) end end end end end addEventHandler ( "onPickupHit", getRootElement(), pickedUpWantedCheck ) الطلب الثاني , Teame = createTeam("Police", 0, 0, 255) CT = { [Teame] = true } CV = { [596] = true } function CopCar () setModelHandling(596, "driveType", "awd") setModelHandling(596, "engineType", "electric") setModelHandling(596, "numberOfGears", 3) setModelHandling(596, "collisionDamageMultiplier", 0.10) end addEventHandler("onResourceStart",resourceRoot,CopCar) function PoliceSet () local team = getTeamFromName ( "Police" ) if team then setPlayerTeam ( source, team ) setPlayerNametagColor ( source, 0, 0, 255 ) setElementModel(source, 281) outputChatBox("Welcome to the Police Job (by Price).",thePlayer) else local teamx = getTeamFromName ( "Police" ) if teamx then cancelEvent() outputChatBox("You do not need to use this again!", thePlayer) end end end addEvent("Police.saPDj", true) addEventHandler("Police.saPDj", root, PoliceSet ) function enterVehicle ( thePlayer, seat, jacked ) -- when a player enters a vehicle if getElementType ( thePlayer ) == "player" then if ( CV[getElementModel ( source )] ) and ( not CT[getPlayerTeam( thePlayer )] ) then -- if the vehicle is one of 4 police cars, and the skin is not a police skin removePedFromVehicle( thePlayer )-- force the player out of the vehicle outputChatBox("Only cops can use this car!", thePlayer) setPlayerWantedLevel(thePlayer,3) end end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) local pos = { {1577.5964355469, -1663.8574218750, 554.4553833}, {1578.0511474609, -1658.2720947266, 554.5078125}, {1578.0749511719, -1653.5701904297, 554.5078125}, {1578.4508056641, -1648.8651123047, 554.5078125}, {1577.1477050781, -1644.4810791016, 554.4553833}, {1576.9183349609, -1639.9044189453, 554.4553833}, {1577.1560058594, -1634.3852539063, 554.5078125}, {1555.5535888672, -1634.2465820313, 554.5078125}, {1555.5618896484, -1639.7027587891, 554.4553833}, {1554.8509521484, -1644.3057861328, 554.4553833}, {1555.1500244141, -1649.5153808594, 554.4553833}, {1555.0622558594, -1658.9534912109, 554.4553833}, {1554.9295654297, -1663.7783203125, 554.4553833}, {1576.7573242188, -1658.9750976563, 548.15625}, {1577.0715332031, -1654.1251220703, 548.15625}, {1577.1650390625, -1649.4708251953, 548.15625}, {1577.1300048828, -1644.3162841797, 548.15625}, {1577.5013427734, -1640.1445312500, 548.15625}, {1577.4721679688, -1634.8250732422, 548.15625}, {1555.2098388672, -1634.2298583984, 548.15625}, {1555.2615966797, -1639.5916748047, 548.15625}, {1555.0701904297, -1644.3499755859, 548.15625}, {1555.0847167969, -1648.9716796875, 548.15625}, {1554.9981689453, -1653.9688720703, 548.15625}, {1554.5999755859, -1658.9943847656, 548.15625}, {1554.5999755859, -1658.9943847656, 548.15625}, } function policeJob ( attacker, attackerweapon, bodypart, loss ) if attacker and getElementType(attacker) == "player" then theTeam = getPlayerTeam ( attacker ) theWL = getPlayerWantedLevel ( source ) theSkin = getElementModel ( attacker ) if (attackerweapon == 3) and (loss > 2 ) and (theWL >= 3) then if getTeamName( theTeam ) == "Police" or getTeamName( theTeam ) == "SWAT" or getTeamName( theTeam ) == "FBI" or getTeamName( theTeam ) == "ARMY" then local x,y,z = unpack(pos[math.random(#pos)]) setElementPosition(source,x,y,z) theName = getPlayerName ( source ) theCop = getPlayerName ( attacker ) outputChatBox ( "You have been jailed by "..theCop.. " for 5 Minutes.", source ) local playeraccount = getPlayerAccount ( attacker ) givePlayerMoney (attacker, 3000) setTimer ( setElementPosition, 300000, 1, source, 1544.4332275391, -1674.7698974609, 13.688399200439) setPlayerWantedLevel (source, 0) end end end end addEventHandler ("onPlayerDamage", getRootElement(), policeJob)
  7. addEventHandler ( "onClientGUIClick", button, function ( ) guiSetSelectedTab ( tabPanel, tab ); end );
  8. الي عدلته انه الشرطي ماتجي عليه نجوم .
  9. --WANTED LEVEL IF A PLAYER IS MURDERED BY A NON-COP, OR IF AN INNOCENT PERSON IS MURDERED BY A COP function aplayerdied( ammo, attacker, weapon, bodypart ) local glevel = getPlayerWantedLevel ( source ) if isElement(attacker) then if getPlayerTeam ( attacker ) and getPlayerTeam ( attacker ) == getTeamFromName ( "Police" ) then return end local wlevel = getPlayerWantedLevel( source ) if wlevel > 0 then if getElementParent(attacker) == kingCOP then setPlayerWantedLevel( source, 0 ) end end if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 6 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 6 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end setPlayerWantedLevel( source, 0 ) end addEventHandler ( "onPlayerWasted", getRootElement(), aplayerdied ) --WANTED LEVEL IF A POLICE OFFICER IS ATTACKED function assaultinganofficer ( attacker, weapon, bodypart, loss ) if isElement(attacker) then if getPlayerTeam ( attacker ) and getPlayerTeam ( attacker ) == getTeamFromName ( "Police" ) then return end if getElementParent(source) == kingCOP then if ( getElementType( attacker ) == "player" ) then if getElementParent(attacker) == kingCOP then return end elseif ( getElementType( attacker ) == "vehicle" ) then thedriver = getVehicleController( attacker ) if isElement(thedriver) then if getElementParent(thedriver) == kingCOP then return end end end if (getElementData ( source, "justdamaged" ) ~= "yes") and (source ~= attacker) then setElementData ( source, "justdamaged", "yes" ) local damagereset = setTimer ( resethurt, 20000, 1, source ) if ( getElementType( attacker ) == "player" ) then local wlevel = getPlayerWantedLevel( attacker ) if wlevel < 1 then setPlayerWantedLevel( attacker, wlevel+1 ) end elseif ( getElementType( attacker ) == "vehicle" ) then local thekiller = getVehicleController( attacker ) if isElement(thekiller) then local wlevel = getPlayerWantedLevel ( thekiller ) if wlevel < 1 then setPlayerWantedLevel( thekiller, wlevel+1 ) end end end end end end end addEventHandler ( "onPlayerDamage", getRootElement(), assaultinganofficer ) function resethurt(source) if isElement(source) then setElementData ( source, "justdamaged", "none" ) end end --WANTED LEVEL IF SOMEONE OTHER THAN A COP JACKS SOMEONE function carjackcheck(theVehicle, seat, jacker) if isElement(jacker) then if getPlayerTeam ( jacker ) and getPlayerTeam ( jacker ) == getTeamFromName ( "Police" ) then return end if getElementParent(jacker) == kingCOP then return end local wlevel = getPlayerWantedLevel( jacker ) if wlevel < 4 then setPlayerWantedLevel( jacker, wlevel+1 ) end end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), carjackcheck ) --WANTED LEVEL IF NON-COP TRIES TO USE A COP CAR function copcarcheck(theVehicle, seat, jacked) if getElementParent(source) == kingCOP then return else local carid = getElementModel( theVehicle ) if carid == 598 or carid == 596 or carid == 597 or carid == 427 or carid == 490 or carid == 599 then if (getElementData ( source, "currentstatus" ) ~= "underarrest" ) then if getPlayerTeam ( source ) and getPlayerTeam ( source ) == getTeamFromName ( "Police" ) then return end local wlevel = getPlayerWantedLevel( source ) if wlevel < 4 then setPlayerWantedLevel( source, wlevel+1 ) end end end end end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), copcarcheck ) -- WANTED LEVEL IF A COP SEES SOMEONE DOING SOMETHING ILLEGAL -- TO MAKE THIS WORK WITH YOUR SCRIPT, SET A PLAYERS ELEMENT DATA "legalstatus" TO "illegal" WHILE DOING SOMETHING ILLEGAL -- DONT FORGET TO CHANGE IT TO SOMETHING ELSE AFTERWARDS THOUGH!! function inspection ( element ) if isElement(element) then if ( getElementType ( element ) == "player" ) then if getElementParent(source) == kingCOP then local wlevel = getPlayerWantedLevel( source ) if wlevel == 0 then if (getElementData ( element, "legalstatus" ) == "illegal" ) then if getPlayerTeam ( element ) and getPlayerTeam ( element ) == getTeamFromName ( "Police" ) then return end local cx, cy, cz = getElementPosition ( source ) local px, py, pz = getElementPosition ( element ) if ( getDistanceBetweenPoints3D ( cx, cy, cz, px, py, pz ) < 15 ) then setPlayerWantedLevel ( element, 1 ) end end end end end end end addEventHandler ( "onPlayerTarget", getRootElement(), inspection ) --STUFF TO MAKE BRIBE PICKUPS WORK function pickedUpWantedCheck ( player ) if ( getElementType(source) == "pickup" ) then if getPickupType ( source ) == 3 then if (getElementData ( source, "model" ) == "1247" ) then if getPlayerTeam ( player ) and getPlayerTeam ( player ) == getTeamFromName ( "Police" ) then return end local level = getPlayerWantedLevel(player) if ( level > 0 ) then setPlayerWantedLevel ( player, level-1 ) end end end end end addEventHandler ( "onPickupHit", getRootElement(), pickedUpWantedCheck )
  10. الكككوود كامل ماليه علاقة بالي تبيه ,, استخدم مود GUIEditor لإنشاء dxDrawText ثم ابدأ بوضع الأكواد للعد التنازلي
  11. لحد الحين عندك خطأ , بما أن التايمر في وظيفة لوحدها , لازم تستخدم اللوب ^ + بالنسبة حق اذا ضغط انتر , ف الكود موجود onPlayerVehicleExit لأن من الأساس اذا ضغطت على انتر راح يخرج من السيارة واذا خرج على طول بيموت , يمكن الوظيفة ذي ماتضبط اذا كان اللاعب معدل على الستنق حق الخروج
  12. onClientMarkerHit onClientRender setElementFrozen setTimer dxDrawText
  13. # لما يححط انتر موجودة , + ما فهمت تبي بعد 30 ثانيةة . + سويت لك حق الموية Race = { Players = { }; Vehicles = { }; Position = { [1] = { x, y, z }; [2] = { x, y, z }; [3] = { x, y, z }; [4] = { x, y, z }; [5] = { x, y, z }; }; Cars = { { 432 }; { 432 }; }; }; local Timer setRaceStats = function ( stats ) if stats then setElementData ( resourceRoot, "RaceStarted", true ) else Race.Players = 0 setElementData ( resourceRoot, "RaceStarted", false ) outputChatBox ( "* تم إفتتاح السباق", root, 255, 255, 0, true ) end end checkPlayers = function ( ) if Race.Players < 2 then for i, v in ipairs ( Race.Vehicles ) do local player = getElementData ( v, "Owner" ) if player then killPed ( player ) end destroyElement ( v ) end outputChatBox ( "* تم إلغاء السباق بسبب قلة اللاعبين", root, 255, 0, 0, true ) end end getPlayerVehicle = function ( element ) if element then local type = getElementType if type ( element ) == "player" or type ( element ) == "ped" then if isPedInVehicle ( element ) then local vehicle = getPedOccupiedVehicle ( element ) if getVehicleController ( vehicle ) == element then return vehicle end return false end return false end return false end return false end addEventHandler ( "onPlayerChat", root, function ( msg ) if string.find ( msg, "سباق" ) then if getElementData ( resourceRoot, "RaceStarted" ) then return outputChatBox ( "* لم ينتهي السباق بعد", source, 255, 0, 0, true ) end if Race.Players < 5 then if not Race.Vehicles[source] then Race.Players = Race.Players+1 if Race.Players == 5 then setRaceStats ( true ) if isTimer ( Timer ) then killTimer ( Timer ) end else if not isTimer ( Timer ) then Timer = setTimer ( checkPlayers, 60000, 1 ) end end Race.Vehicles[source] = createVehicle ( Race.Cars[math.random(#Race.Cars)][1], Race.Position[Race.Players][1], Race.Position[Race.Players][2], Race.Position[Race.Players][3] ) setElementDimension ( Race.Vehicles[source], 1 ) setElementDimension ( source, 1 ) setTimer ( warpPedIntoVehicle, 100, 1, source, Race.Vehicles[source] ) setElementData ( Race.Vehicles[source], "Owner", source ) end else outputChatBox ( "* أكتمل العدد", source, 255, 0, 0, true ) end end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end ) addEventHandler ( "onElementDestroy", resourceRoot, function ( ) if getElementType ( source ) == "vehicle" then if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if Race.Vehicles[source] then if isElement ( Race.Vehicles[source] ) then destroyElement ( Race.Vehicles[source] ) else if Race.Players == 1 then setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end Race.Vehicles[source] = nil end end ) addEventHandler ( "onVehicleExit", resourceRoot, function ( player ) if getVehicleController ( source ) == player then killPed ( player ) destroyElement ( source ) end end ) addEventHandler ( "onPlayerWasted", root, function ( ) local vehicle = getPlayerVehicle ( source ) if vehicle then local player = getElementData ( vehicle, "Owner" ) if player then if player == source then destroyElement ( vehicle ) end end end end ) setTimer ( function ( ) if isElement( Race.Vehicles[source] ) and isElementInWater( Race.Vehicles[source] ) and getVehicleController ( source ) == player then killPed ( source ) destroyElement ( Race.Vehicles[source] ) end end, 1000, 0 ) setRaceStats ( false ) انت مو معرف لا source ولا player ~~
  14. https://forum.multitheftauto.com/viewtopic.php?f=161&t=68120
  15. كفؤؤؤؤؤؤ اخي شكرا علي المساعده تم التجربه ويعمل ميه علي ميه العفو
  16. -- Server Side ! markers = { {1585.4683837891,-1677.7601318359,4.5}, {1601.015625,-1709.9270019531,4.5}, {1544.4505615234,-1645.6096191406,4.5}, {1546.0128173828,-1609.8051757813,12.5}, {1599.4171142578,-1610.4891357422,12.5}, {1600.0526123047,-1627.7546386719,12.5}, --{ x, y, z }, } for i,v in ipairs (markers) do marker = createMarker(v[1], v[2], v[3], "cylinder", get("markerSize"), get("markerColorR"), get("markerColorG"), get("markerColorB"), get("markerAlpha")) end veh = {} addEvent ("getCar", true) addEventHandler ("getCar", getRootElement(), function(car) if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end ) addEventHandler ( "onPlayerQuit", getRootElement(), function () if veh[source] and isElement( veh[source] ) then destroyElement( veh[source] ) veh[source] = nil end end) function markerHit (hitPlayer, matchingDimension) if isPedInVehicle (hitPlayer) then return end if getElementType(hitPlayer) == "player" then if getPlayerTeam ( hitPlayer ) and getPlayerTeam ( hitPlayer ) == getTeamFromName ( "Police" ) then triggerClientEvent ("openMean2000", hitPlayer) end end end addEventHandler ("onMarkerHit", resourceRoot, markerHit) function markerLeave (hitPlayer, matchingDimension) if getElementType(hitPlayer) == "player" then triggerClientEvent ("closeopenMean2000", hitPlayer) end end addEventHandler ("onMarkerLeave", resourceRoot, markerLeave)
  17. -- Client Side # addEventHandler ( "onClientResourceStart", resourceRoot, function ( ) tzwer = guiCreateLabel ( 619, 138, 156, 20, "ادخل النص هنا", false ) guiLabelSetColor ( tzwer, math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) setTimer ( function ( ) guiLabelSetColor ( tzwer, math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) end, 50, 0 ) end )
  18. حبيبي روح سو مود الاختطاف حق سيرفرك بعدين تعال
  19. https://community.multitheftauto.com/in ... ls&id=6625
  20. تأكد انك كاتب سباق في الشات بدون /
  21. جهالة على فكرة قامر مدري قيمر متى راح يسوي الاختطاف حقكم هههههه
  22. GUIEditor_Window = {} GUIEditor_Window[1] = guiCreateWindow(221,290,352,204,"اللوحه الاولا",false) GUIEditor_Window[2] = guiCreateWindow(169,76,459,213,"اللوحه الثانيه",false) window2 = guiCreateButton(45,50,264,103,"Window-2",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) bindKey ( "F2" , "down" , function() guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end) addEventHandler ( "onClientGUIClick", window2, function ( ) if not guiGetVisible ( GUIEditor_Window[2] ) then guiSetVisible ( GUIEditor_Window[2], true ) guiBringToFront ( GUIEditor_Window[2] ) guiSetEnabled ( source, false ) end end )
  23. GUIEditor_Window = {} GUIEditor_Window[1] = guiCreateWindow(221,290,352,204,"اللوحه الاولا",false) GUIEditor_Window[2] = guiCreateWindow(169,76,459,213,"اللوحه الثانيه",false) window2 = guiCreateButton(45,50,264,103,"Window-2",false,GUIEditor_Window[1]) guiSetVisible(GUIEditor_Window[1],false) guiSetVisible(GUIEditor_Window[2],false) bindKey ( "F2" , "down" , function() guiSetVisible ( GUIEditor_Window[1], not guiGetVisible ( GUIEditor_Window[1] ) ) showCursor ( guiGetVisible ( GUIEditor_Window[1] ) ) end) addEventHandler ( "onClientGUIClick", window2, function ( ) if not guiGetVisible ( GUIEditor_Window[2] ) then guiSetVisible ( GUIEditor_Window[2], true ) guiBringToFront ( GUIEditor_Window[2] ) end end )
  24. getPlayerFromAccount الوظيفة تقوم بجلب اللاعب عن طريق حسابه , ويجب أن يكون اللاعب قد سجل الدخول وإلا لن تعمل الوظيفة Syntax player getPlayerFromAccount ( string account ) Function Source getPlayerFromAccount = function ( account ) if account then account = tostring ( account ) local player for k, p in ipairs ( getElementsByType( "player" ) ) do if not isGuestAccount ( getPlayerAccount ( p ) ) then if getAccountName ( getPlayerAccount ( p ) ) == account then player = p end else return false end end return player else return false end end Example addEventHandler ( "onPlayerWasted", root, function ( ) outputChatBox ( "Wasted !", getPlayerFromAccount ( getPlayerAccount ( source ) ) ) end )
×
×
  • Create New...