Jump to content

Search the Community

Showing results for tags 'help'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

  1. So i have a problem, with GUIs. I made two GUIs and i should separate them, because the first GUI affects the second GUI. On the first GUI, i have two buttons. GUIEditor.button[1] and GUIEditor.button[2] On the second GUI, i have buttons two, starting from GUIEditor.button[1]. So the problem is, that the second GUI's buttons, aren't working, because it calls the function of the first GUI's buttons. The two scripts are in two files. So how could i separate them, so they don't have any effect on each other?
  2. Gabriele01

    DayZ help

    Hello guys again I have a idiot error in my server :)) Error: [2016-12-28 18:53:03] ERROR: DayZ\login.lua:284: bad argument #1 to 'ipairs' (table expected, got nil) Code : local spawnPositions = { {-278.6669921875,-2882.1572265625,32.104232788086}, {-958.5595703125,-2887.9912109375,64.82421875}, {-1816.9375,-2748.18359375,1.7327127456665}, {-2816.166015625,-2439.0546875,2.4004096984863}, {-2941.5673828125,-1206.2373046875,2.7848854064941}, {-2911.51171875,-895.22265625,2.4013109207153}, {-2185.6669921875,2957.380859375,11.474840164185}, {272.2265625,2928.505859375,1.3713493347168}, {2803.943359375,595.9365234375,7.7612648010254}, {2883.7509765625,-178.4658203125,3.2714653015137}, {-233.46484375,-1735.8173828125,1.5520644187927}, {-1056.8720703125,2939.068359375,42.311294555664}, } local playerDataTable = { {"alivetime"}, {"skin"}, {"MAX_Slots"}, {"bandit"}, {"blood"}, {"food"}, {"thirst"}, {"temperature"}, {"currentweapon_1"}, {"currentweapon_2"}, {"currentweapon_3"}, {"bleeding"}, {"brokenbone"}, {"pain"}, {"cold"}, {"infection"}, {"humanity"}, {"zombieskilled"}, {"headshots"}, {"murders"}, {"banditskilled"}, {"Wood Pile"}, {"Bandage"}, {"Water Bottle"}, {"Pasta Can"}, {"Beans Can"}, {"Burger"}, {"Box of Matches"}, {"M1911 Mag"}, {"M9 SD Mag"}, {"Desert Eagle Mag"}, {"M1911"}, {"M9 SD"}, {"Winchester 1866"}, {"PDW"}, {"Hunting Knife"}, {"Hatchet"}, {"Pizza"}, {"Morphine"}, {"Soda Bottle"}, {"Empty Gas Canister"}, {"Full Gas Canister"}, {"Roadflare"}, {"Milk"}, {"PDW Mag"}, {"MP5A5 Mag"}, {"AK Mag"}, {"M4 Mag"}, {"Tear Gas"}, {"Grenade"}, {"Desert Eagle"}, {"Sawn-Off Shotgun"}, {"SPAZ-12 Combat Shotgun"}, {"MP5A5"}, {"Watch"}, {"Medic Kit"}, {"Heat Pack"}, {"Lee Enfield"}, {"PDW"}, --{"TEC-9"}, {"AK-47"}, --{"M136 Rocket Launcher"}, {"Blood Bag"}, {"GPS"}, {"Map"}, {"Toolbox"}, {"Wire Fence"}, {"Tire"}, {"Engine"}, {"Tank Parts"}, {"M136 Rocket"}, {"CZ 550 Mag"}, {"Lee Enfield Mag"}, {"M4"}, {"CZ 550"}, --{"Heat-Seeking RPG"}, {"Satchel"}, {"Infrared Goggles"}, {"Night Vision Goggles"}, {"Tent"}, {"Raw Meat"}, {"Cooked Meat"}, {"Camouflage Clothing"}, {"Ghillie Suit"}, {"Civilian Clothing"}, {"Survivor Clothing"}, {"Painkiller"}, {"Binoculars"}, {"Empty Water Bottle"}, {"Empty Soda Cans"}, {"Scruffy Burgers"}, {"1866 Slug"}, {"2Rnd. Slug"}, {"SPAZ-12 Pellet"}, {"Radio Device"}, {"Baseball Bat"}, {"Shovel"}, {"Golf Club"}, {"Radio Device"}, {"Parachute"}, } function playerLogin(username, pass, player) local playerID = getAccountData(getPlayerAccount(player),"playerID") account = getPlayerAccount(player) local x,y,z = getAccountData(account,"last_x"),getAccountData(account,"last_y"),getAccountData(account,"last_z") local skin = getAccountData(account,"skin") createZombieTable (player) if getAccountData(account,"isDead") then spawnDayZPlayer(player) return end spawnPlayer (player, x,y,z+0.5, math.random(0,360), skin, 0, 0) setElementFrozen(player, true) fadeCamera (player, true) setCameraTarget (player, player) setTimer( function(player) if isElement(player) then setElementFrozen(player, false) end end,500,1,player) playerCol = createColSphere(x,y,z,1.5) setElementData(player,"playerCol",playerCol) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) for i, v in ipairs ( clothSlots ) do local elementData = getAccountData(account,v) setElementData(player,v,elementData) if type(elementData) == "string" then local objData = clothesObjects[elementData] if objData then local helmet = createObject(objData[1], x, y, z) setElementData ( source, v.."Object", helmet ) attachElementToBone(helmet, source, objData[2], objData[3], objData[4], objData[5], objData[6], objData[7], objData[8]) end end end for i,data in ipairs(playerDataTable) do local elementData = getAccountData(account,data[1]) if not elementData then if data[1] == "brokenbone" or data[1] == "pain" or data[1] == "cold" or data[1] == "infection" or data[1] == "currentweapon_1" or data[1] == "currentweapon_2" or data[1] == "currentweapon_3" or data[1] == "bandit" then elementData = elementData else elementData = 0 end end setElementData(player,data[1],elementData) end setElementData(player,"logedin",true) --Weapons --Old Weapons local weapon = getElementData(player,"currentweapon_1") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), true ) end local weapon = getElementData(player,"currentweapon_2") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end local weapon = getElementData(player,"currentweapon_3") if weapon then local ammoData,weapID = getWeaponAmmoType (weapon) giveWeapon(player,weapID,getElementData(player,ammoData), false ) end setElementModel(player, getElementData(player,"skin")) setElementData(player,"admin",getAccountData(account,"admin") or false) setElementData(player,"supporter",getAccountData(account,"supporter") or false) triggerClientEvent(player, "onClientPlayerDayZLogin", player) end addEvent("onPlayerDayZLogin", true) addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin) function playerRegister(username, pass, player) local number = math.random(table.size(spawnPositions)) local x,y,z = spawnPositions[number][1],spawnPositions[number][2],spawnPositions[number][3] spawnPlayer (player, x,y,z, math.random(0,360), 281, 0, 0) fadeCamera (player, true) setCameraTarget (player, player) playerCol = createColSphere(x,y,z,1.5) attachElements ( playerCol, player, 0, 0, 0 ) setElementData(playerCol,"parent",player) setElementData(playerCol,"player",true) ---------------------------------- --Player Items on Start for i,data in ipairs(playerDataTable) do if data[1] =="Bandaj" then setElementData(player,data[1],2) elseif data[1] =="Ağrı Kesici" then setElementData(player,data[1],1) elseif data[1] =="MAX_Slots" then setElementData(player,data[1],8) elseif data[1] =="skin" then setElementData(player,data[1],281) elseif data[1] =="blood" then setElementData(player,data[1],12000) elseif data[1] =="temperature" then setElementData(player,data[1],37) elseif data[1] =="brokenbone" then setElementData(player,data[1],false) elseif data[1] =="pain" then setElementData(player,data[1],false) elseif data[1] =="cold" then setElementData(player,data[1],false) elseif data[1] =="infection" then setElementData(player,data[1],false) elseif data[1] =="food" then setElementData(player,data[1],100) elseif data[1] =="thirst" then setElementData(player,data[1],100) elseif data[1] =="currentweapon_1" then setElementData(player,data[1],false) elseif data[1] =="currentweapon_2" then setElementData(player,data[1],false) elseif data[1] =="currentweapon_3" then setElementData(player,data[1],false) elseif data[1] =="bandit" then setElementData(player,data[1],false) elseif data[1] =="humanity" then setElementData(player,data[1],2500) else setElementData(player,data[1],0) end end account = getAccount(username) local value = getAccounts() local value = #value setElementData(player,"playerID",value+1) setAccountData(account,"playerID",value+1) setElementData(player,"logedin",true) createZombieTable (player) end addEvent("onPlayerDayZRegister", true) addEventHandler("onPlayerDayZRegister", getRootElement(), playerRegister) function saveAccounts () -- Save in the database local account = getPlayerAccount(source) if account then for i,data in ipairs(playerDataTable) do setAccountData(account,data[1],getElementData(source,data[1])) end for i, v in ipairs ( clothSlots ) do setAccountData(account,v,getElementData(source,v)) end local x,y,z = getElementPosition(source) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) destroyElement(getElementData(source,"playerCol")) end setElementData(source,"logedin",false) end addEventHandler ( "onPlayerQuit", getRootElement(), saveAccounts ) function saveAccounts2 () -- Save in the database for i, player in ipairs(getElementsByType("player")) do local account = getPlayerAccount(player) if account then for i,data in ipairs(playerDataTable) do setAccountData(account,data[1],getElementData(player,data[1])) end for i, v in ipairs ( clothSlots ) do setAccountData(account,v,getElementData(source,v)) end local x,y,z = getElementPosition(player) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) end --setElementData(player,"logedin",false) end end addEventHandler ( "onResourceStop", getRootElement(), saveAccounts2 ) -------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------- local vehicleDataTable = { {"MAX_Slots"}, {"Tire_inVehicle"}, {"Engine_inVehicle"}, {"Parts_inVehicle"}, {"fuel"}, {"Wood Pile"}, {"Bandage"}, {"Water Bottle"}, {"Pasta Can"}, {"Beans Can"}, {"Burger"}, {"Box of Matches"}, {"M1911 Mag"}, {"M1911"}, {"M9 SD"}, {"Desert Eagle Mag"}, {"Winchester 1866"}, {"PDW"}, {"Hunting Knife"}, {"Morphine"}, {"Hatchet"}, {"Pizza"}, {"Soda Bottle"}, {"Empty Gas Canister"}, {"Full Gas Canister"}, {"Roadflare"}, {"Milk"}, {"PDW Mag"}, {"MP5A5 Mag"}, {"AK Mag"}, {"M4 Mag"}, {"Tear Gas"}, {"Grenade"}, {"Desert Eagle"}, {"Sawn-Off Shotgun"}, {"SPAZ-12 Combat Shotgun"}, {"MP5A5"}, {"Watch"}, {"Medic Kit"}, {"Heat Pack"}, {"Lee Enfield"}, --{"TEC-9"}, {"AK-47"}, --{"M136 Rocket Launcher"}, {"Blood Bag"}, {"GPS"}, {"Map"}, {"Toolbox"}, {"Wire Fence"}, {"Tire"}, {"Engine"}, {"Tank Parts"}, {"M136 Rocket"}, {"CZ 550 Mag"}, {"Lee Enfield Mag"}, {"M4"}, {"CZ 550"}, --{"Heat-Seeking RPG"}, {"Satchel"}, {"Infrared Goggles"}, {"Night Vision Goggles"}, {"Tent"}, {"Raw Meat"}, {"Cooked Meat"}, {"Camouflage Clothing"}, {"Ghillie Suit"}, {"Civilian Clothing"}, {"Survivor Clothing"}, {"Painkiller"}, {"Binoculars"}, {"Empty Water Bottle"}, {"Empty Soda Cans"}, {"Scruffy Burgers"}, {"1866 Slug"}, {"2Rnd. Slug"}, {"SPAZ-12 Pellet"}, {"Assault Pack (ACU)"}, {"Alice Pack"}, {"Czech Backpack"}, {"Coyote Backpack"}, {"Radio Device"}, {"Baseball Bat"}, {"Shovel"}, {"Golf Club"}, {"Parachute"}, } --local vehicleManager = getAccount("vehicleManager","ds4f9$") --if not vehicleManager then --addAccount("vehicleManager","ds4f9$") --end function saveallvehicles(ps,command) counter = 0 counterTent = 0 --counterSafe = 0 local vehicleManager = getAccount("vehicleManager","Lfybkxbybxrby112") --local vehicleManager = getAccount("vehicleManager") for i, col in ipairs (getElementsByType("colshape")) do local veh = getElementData(col,"vehicle") local helicrash = getElementData(col,"helicrash") local hospitalbox = getElementData(col,"hospitalbox") --local ammobox = getElementData(col,"ammobox") local tent = getElementData(col,"tent") -- local safe = getElementData ( col,"safe") if veh and not helicrash or veh and not hospitalbox then if tent then counterTent = counterTent +1 account = getAccount("tent_number_"..counterTent,"Lfybkxbybxrby112") or false if not account then account = addAccount("tent_number_"..counterTent,"Lfybkxbybxrby112") end local tent = getElementData(col,"parent") local x,y,z = getElementPosition(tent) local rx,ry,rz = getElementRotation(tent) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) setAccountData(account,"last_rx",rx) setAccountData(account,"last_ry",ry) setAccountData(account,"last_rz",rz) for i, data in ipairs(vehicleDataTable) do setAccountData(account,data[1],getElementData(col,data[1])) end else counter = counter +1 account = getAccount("vehicle_number_"..counter,"ds4f9$") or false if not account then account = addAccount("vehicle_number_"..counter,"ds4f9$") end setAccountData(account,"spawn_x",getElementData(col,"spawn")[2]) setAccountData(account,"spawn_y",getElementData(col,"spawn")[3]) setAccountData(account,"spawn_z",getElementData(col,"spawn")[4]) for i, data in ipairs(vehicleDataTable) do setAccountData(account,data[1],getElementData(col,data[1])) end local vehicle = getElementData(col,"parent") local model = getElementModel(vehicle) local x,y,z = getElementPosition(vehicle) local rx,ry,rz = getElementRotation(vehicle) local health = getElementHealth(vehicle) setAccountData(account,"last_x",x) setAccountData(account,"last_y",y) setAccountData(account,"last_z",z) setAccountData(account,"last_rx",rx) setAccountData(account,"last_ry",ry) setAccountData(account,"last_rz",rz) setAccountData(account,"health",health) setAccountData(account,"model",model) setAccountData(account,"isExploded",getElementData(vehicle,"isExploded") or false) end end end setAccountData(vehicleManager,"vehicleamount",counter) setAccountData(vehicleManager,"tentamount",counterTent) end addEventHandler("onResourceStop", getResourceRootElement(getThisResource()), saveallvehicles) function doBackup () --outputChatBox ("Резервное копирование сервера. Просим не выходить с сервера во Yaşam Süresi NETWORK.",getRootElement(),27, 89, 224,true) saveallvehicles() --outputChatBox ("Продолжайте!",getRootElement(),27, 89, 224,true) end function checkDoBackup () if gameplayVariables["backupenabled"] then setTimer(doBackup,gameplayVariables["backupinterval"],0) end end checkDoBackup() function createVehicleOnServerStart() local vehicleManager = getAccount("vehicleManager","ds4f9$") for i = 1, (getAccountData(vehicleManager,"vehicleamount") or 0) do wastedVehicle = false vehicle = getAccount("vehicle_number_"..i,"ds4f9$") if not vehicle then break end if getAccountData(vehicle,"isExploded") == true then setAccountData(vehicle,"health",1000) wastedVehicle = true end local veh = createVehicle(getAccountData(vehicle,"model"),getAccountData(vehicle,"last_x"),getAccountData(vehicle,"last_y"),getAccountData(vehicle,"last_z"),getAccountData(vehicle,"last_rx"),getAccountData(vehicle,"last_ry"),getAccountData(vehicle,"last_rz")) vehCol = createColSphere(getAccountData(vehicle,"last_x"),getAccountData(vehicle,"last_y"),getAccountData(vehicle,"last_z"),4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",getAccountData(vehicle,"MAX_Slots")) xxx,yyy,zzz = getAccountData(vehicle,"spawn_x"),getAccountData(vehicle,"spawn_y"),getAccountData(vehicle,"spawn_z") setElementData(vehCol,"spawn",{getAccountData(vehicle,"model"),xxx,yyy,zzz}) if wastedVehicle then if getAccountData(vehicle,"model") == 497 then item_id = math.random(table.size(hunterSpawns)) xxx,yyy,zzz = hunterSpawns[item_id][1],hunterSpawns[item_id][2],hunterSpawns[item_id][3] end if getAccountData(vehicle,"model") == 487 then local item_id = math.random(table.size(maverikSpawns)) x,y,z = maverikSpawns[item_id][1],maverikSpawns[item_id][2],maverikSpawns[item_id][3] end setElementPosition(veh,xxx,yyy,zzz+1) setElementRotation(veh,0,0,0) --Motor + Tekerlek + Yakıt Deposu local tires,engine,parts = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tekerlek_inVehicle",math.random(0,tires)) setElementData(vehCol,"Motor_inVehicle",math.random(0,engine)) setElementData(vehCol,"Parts_inVehicle",math.random(0,parts)) end --others setElementData(vehCol,"fuel",getAccountData(vehicle,"fuel")) if not wastedVehicle then for i, data in ipairs(vehicleDataTable) do setElementData(vehCol,data[1],getAccountData(vehicle,data[1])) end else if getElementModel(veh) == 433 or getElementModel(veh) == 470 then for i,items in ipairs(lootItems["helicrashsides"]) do local randomNumber = math.random(1,10) if randomNumber == 5 then setElementData(vehCol,items[1],math.random(1,2)) end end end setElementData(vehCol,"fuel",10) end end for i = 1, (getAccountData(vehicleManager,"tentamount") or 0) do tentData = getAccount("tent_number_"..i,"ds4f9$") if not tentData then break end tent = createObject(3243,getAccountData(tentData,"last_x"),getAccountData(tentData,"last_y"),getAccountData(tentData,"last_z"),0,0,(getAccountData(tentData,"last_rz") or 0)) setObjectScale(tent,1.3) tentCol = createColSphere(getAccountData(tentData,"last_x"),getAccountData(tentData,"last_y"),getAccountData(tentData,"last_z"),4) attachElements ( tentCol, tent, 0, 0, 0 ) setElementData(tentCol,"parent",tent) setElementData(tent,"parent",tentCol) setElementData(tentCol,"tent",true) setElementData(tentCol,"vehicle",true) setElementData(tentCol,"MAX_Slots",100) for i, data in ipairs(vehicleDataTable) do setElementData(tentCol,data[1],getAccountData(tentData,data[1])) end end end addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), createVehicleOnServerStart)
  3. function tesztlel() local random = math.random(1, 7) --change as appropriate if random == 1 then guiSetVisible(nyer, true) guiSetText(szveg, "Nyereményed: MINIGUN \n\nVárunk vissza 12 óra múlva. ;)\nHasználd egészséggel a nyereményed!") --guiSetVisible(GUIEditorwindow, false) triggerServerEvent("giveWeapon", getLocalPlayer(), group) local currentState = guiGetProperty( GUIEditorgomb1, "Disabled" ) if currentState == "True" then guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) else guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) end elseif random == 2 then guiSetVisible(nyer, true) guiSetText(szveg, "Nyereményed: GOD MODE \n\nVárunk vissza 12 óra múlva. ;)\nHasználd egészséggel a nyereményed!") function godmode ( ) cancelEvent ( ) end addEventHandler ( "onClientGUIClick", button2, function ( ) addEventHandler ( "onClientPlayerDamage", localPlayer, godmode ) toggleControl ( 'fire', false ) toggleControl ( 'action', false ) end ,false ) local currentState = guiGetProperty( GUIEditorgomb1, "Disabled" ) if currentState == "True" then guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) else guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) end elseif random == 3 then guiSetVisible(nyer, true) guiSetText(szveg, "Nyereményed: FEGYVERCSOMAG \n\nVárunk vissza 12 óra múlva. ;)\nHasználd egészséggel a nyereményed!") --guiSetVisible(GUIEditorwindow, false) triggerServerEvent("giveWeapon1", getLocalPlayer(), group) local currentState = guiGetProperty( GUIEditorgomb1, "Disabled" ) if currentState == "True" then guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) else guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) end elseif random == 4 then guiSetVisible(nyer, true) guiSetText(szveg, "Nyereményed: HALH.AUTÓ \n\nVárunk vissza 12 óra múlva. ;)\nHasználd egészséggel a nyereményed!") --guiSetVisible(GUIEditorwindow, false) local car = getPedOccupiedVehicle(localPlayer) if source == button3 then if isVehicleDamageProof(car) == false then setVehicleDamageProof(car, true) else if isVehicleDamageProof(car) == true then setVehicleDamageProof(car, false) end end end local currentState = guiGetProperty( GUIEditorgomb1, "Disabled" ) if currentState == "True" then guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) else guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) end elseif random == 5 then guiSetVisible(nyer, true) guiSetText(szveg, "Nyereményed: TANK \n\nVárunk vissza 12 óra múlva. ;)\nHasználd egészséggel a nyereményed!") --guiSetVisible(GUIEditorwindow, false) triggerServerEvent("tank",getLocalPlayer(),0,255,0,"Ezt a tankot addig használhatod amíg szeretnéd, vigyázz rá, mert 12 óráig nem kapsz újat.") local currentState = guiGetProperty( GUIEditorgomb1, "Disabled" ) if currentState == "True" then guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) else guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) end elseif random == 6 then group = "writing" triggerServerEvent("addToGroup", getLocalPlayer(), group) guiSetVisible(nyer, true) guiSetText(szveg, "Nyereményed: SZÍNESÍRÁS \n\nVárunk vissza 12 óra múlva. ;)\nHasználd egészséggel a nyereményed!") local currentState = guiGetProperty( GUIEditorgomb1, "Disabled" ) if currentState == "True" then guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) else guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) end elseif random == 7 then guiSetVisible(nyer, true) guiSetText(szveg, "Nyereményed: SEMMI! XD \n\nNe bánkódj!\n12 óra múlva hátha kapsz valamit! XD") local currentState = guiGetProperty( GUIEditorgomb1, "Disabled" ) if currentState == "True" then guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) else guiSetProperty( GUIEditorgomb1, "Disabled", "True" ) end end end addEventHandler("onClientGUIClick", GUIEditorgomb1, tesztlel) I want, when the user click on the button, give a thing, and disable button and do not get it again gift
  4. How can I move a player naturally from one point to another? setElementPosition
  5. Hello friends, I ask your help, because I want to give an animation to a login, I want the login panel to come down from above to the center of the player screen.. please help me
  6. Hello everyone, I have been trying to make the radar/minimap on my server less lonely. The only things that appear there are the player icons. Nothing Else, unless you are close to something. There goes my issue, is there a way to show all of the available blips in the radar? I don't mind it being crowded. I just need for all of the blips to show on the radar even if we are not close to it. I don't know why the player icons are shown no matter what and the rest are not. So any help is appreciated. I [I AM A COMPLETE NOOB AND DO NOT KNOW HOW TO CODE AT ALL] Notes: I am running a small server, just for my friends and I, nothing special. MTA 1.5.3
  7. Hi, i need some help. Im developing a WEB system for MTA. A script write some text on acl, but when server stop, its saves own acl, how can i prevent that?
  8. Hello friends, How can I put this message as it is in this image? function onEscapeBankZone(ele, matchingDimension) if (ele and ele.type == "player") then if (ele:getData("escapedbr") and ele.team.name == "Criminals") then exports.TGdx:new(ele, "mission passed! $30,000 and 20 crim XP", 0, 255, 0)
  9. I cant seem to find a solution to have a toggle system for a sound to play. For Example: If i press "b" The sirens should go off, if i press "b" again it should stop. This is what I want to happen. when i press "b" the siren should sound, and when i press "b" again the siren should stop. CODE (Client-Side) --Sirens Section function sound003 (player) local sound = playSound("Sirens/Sound_003.wav") setSoundVolume(sound, 0.3) end addCommandHandler("sound003", sound003) bindKey("num_1", "down", "sound003") function sound012 (player) local sound = playSound("Sirens/Sound_012.wav") setSoundVolume(sound, 0.3) end addCommandHandler("sound012", sound012) bindKey("n", "down", "sound012") every time I press the bindKey it keeps spamming the sound.
  10. basically everything is all right but he dont give that "Press j to inventory" and no tires/engines inside.... Need help whit this. I have no errors. Server side: ---------------------------Motos ----------------- addEvent ("vehicle", true) addEvent ("carBuyy", true) addEventHandler ("carBuyy", getRootElement(), function(id2, cost2, name2, vehCol, veh, x, y, z, sRz) local account = getPlayerAccount(source) if (getPlayerMoney (source) >= tonumber(cost2)) then outputChatBox ("You bought " ..name2.. " for"..cost2, source, 255, 255, 0, false) outputChatBox ("price: $" .. cost2, source, 0, 255, 0, false) takePlayerMoney (source, tonumber (cost2)) local x,y,z = getElementPosition (source) local vehicle = createVehicle (id2, x, y, z, 0, 0, sRz ) local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(id2,x,y,z) vehCol = createColSphere(x,y,z,1.5) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",6) local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{id2,x,y,z}) --others setElementData(vehCol,"fuel",10) warpPedIntoVehicle(source, vehicle) else outputChatBox ("Sorry, you don't have"..cost2.."$", source, 255, 0, 0, false) end end ) -- Modify The coordenates And blips local varkers = {} local nums = 0 cordinatess = { {-2504.19653 ,732.67963 , 35}, {-2101.19824 , -2257.89087 , 30}, {2040.43188, 2269.98828, 10}, {241.55659 , -154.18588 , 1}, } for i, h in pairs(cordinatess) do nums = nums + 1 varkers[nums] = createMarker(h[1], h[2], h[3], "cylinder", 1.5, 254, 0, 0, 170 ) createBlip(h[1], h[2], h[3], 55, 0, 0, 0, 255, 10, 0, 500 ) end function entro_al_marcadorrr ( hitElement ) triggerClientEvent(hitElement, "AbrirrSids", hitElement) outputChatBox("Make sure, you have extra tires or engine!!!", hitElement) end addEventHandler ( "onMarkerHit", resourceRoot, entro_al_marcadorrr ) hunterSpawns = { {-1185.9775390625,26.4111328125,14.1484375}, {-1724.5830078125,2559.3544921875,104.09127807617}, {615.744140625,850.1572265625,-43.009014129639}, {232.5283203125,1950.3583984375,17.640625}, {-1050.5859375,1968.033203125,120.66523742676}, {2821.03515625,2809.6689453125,10.8203125}, {1949.9912109375,-2631.44140625,13.546875}, {-756.53979492188,-2137.5471191406,26.463499069214}, } pickupSpawns = { {-2479.6240234375,2223.6669921875,4.84375}, {-92.9951171875,2823.0908203125,76.721649169922}, {-2448.99609375,-1335.8662109375,310.97662353516}, {-173.2470703125,-2635.5341796875,26.608192443848}, {2108.447265625,-1600.916015625,13.552597045898}, {2452.7392578125,1607.9833984375,10.8203125}, {-1800.8984375,-1950.9736328125,93.561332702637}, } patriotSpawns = { {-1473.5791015625,320.2294921875,7.1875}, {-1373.998046875,460.62109375,7.1875}, {419.150390625,2186.087890625,39.499450683594}, {2821.1796875,793.4658203125,10.8984375}, } sanchezSpanws = { {-812.470703125,-2629.912109375,90.105056762695}, {-1729.8525390625,-1940.3154296875,99.840209960938}, {-2130.90234375,178.4375,35.257678985596}, {-2656.7333984375,1352.4873046875,7.0596733093262}, {-1598.302734375,2694.947265625,55.07092666626}, {-809.96484375,2430.037109375,156.97012329102}, {2920.38671875,2486.0087890625,10.8203125}, {505.732421875,-291.8681640625,20.00952911377}, {-428.8828125,-694.8310546875,19.14847946167}, {1190.41015625,-2109.0341796875,64.738548278809}, {1658.9716796875,-1069.0224609375,23.906229019165}, } barracksSpawns = { {86.486328125,1950.9013671875,17.846803665161}, {440.185546875,1464.173828125,6.3338670730591}, } coachSpawns = { {-1971.4619140625,97.4658203125,27.6875}, {1735.8720703125,1429.0693359375,10.797702789307}, {2797.1318359375,-1868.8359375,9.8603811264038}, {1941.900390625,1975.1904296875,7.59375}, } fisherBootSpawns = { {2463.3984375,-2719.638671875,-0.55000001192093}, {-1577.4873046875,182.353515625,-0.53995263576508}, {-806.80859375,2233.7001953125,40.049976348877}, {-127.4453125,-779.6923828125,-0.55000001192093}, } bikeSpawns = { {194.685546875,-120.2333984375,1.5497757196426}, {173.0146484375,-95.0634765625,1.5516006946564}, {2369.9599609375,29.712890625,28.0416431427}, {710.87109375,-566.7548828125,16.3359375}, {1109.6025390625,-1667.6689453125,13.615442276001}, {2014.6689453125,-1113.4013671875,26.203125}, {2447.41015625,-1967.1845703125,13.546875}, {2633.7236328125,1835.291015625,11.0234375}, {1489.3974609375,2681.54296875,10.8203125}, {-2428.5654296875,2280.875,4.984375}, {-2501.0869140625,2224.880859375,4.9861993789673}, {-2142.8515625,-2457.84765625,30.625}, {-2456.078125,-141.115234375,26.112222671509}, {-1881.4453125,954.3837890625,35.171875}, } maverikSpawns = { {-1495.888671875,-2691.40234375,57.325229644775}, {-2688.42578125,1471.634765625,7.1875}, {-1534.28125,2842.9482421875,97.463409423828}, {2221.8583984375,-1344.396484375,23.984273910522}, } tentSpawns = { {-2845.060546875,2761.2509765625,242.69204711914}, {-1095.94921875,-1450.958984375,126.92543029785}, {2607.1357421875,-510.4755859375,80.744903564453}, {-1509.2333984375,-1986.443359375,50.071846008301}, } heliCrashSites = { {-1360.0478515625,-1070.7314453125,160.4069519043}, {-421.4619140625,-1284.4345703125,33.740924835205}, {-2357.654296875,-1634.3623046875,483.703125}, {979.0849609375,160.59375,28.935249328613}, {-2057.2294921875,2781.73828125,163.12780761719}, {826.90234375,2803.6259765625,74.863929748535}, {2577.7060546875,-650.541015625,136.37449645996}, } hospitalPacks = { {-2670.87890625,636.8984375,14.453125}, {-2637.0556640625,635.03125,14.453125}, {-1515.669921875,2519.166015625,56.0703125}, {-1513.888671875,2519.5908203125,56.064819335938}, {-1528.8955078125,2516.724609375,55.986171722412}, {2022.1650390625,-1402.6806640625,17.18045425415}, {2042.7001953125,-1409.4775390625,17.1640625}, {-316.5478515625,1051.6494140625,20.340259552002}, {-337.9541015625,1049.490234375,19.739168167114}, {-331.5849609375,1046.037109375,26.012474060059}, {-307.0419921875,1045.27734375,26.012474060059}, {1171.490234375,-1310.560546875,13.986573219299}, {1171.609375,-1306.556640625,13.996350288391}, {1158.5048828125,-1326.333984375,31.503561019897}, {1159.80078125,-1323.9013671875,31.498970031738}, {1238.7119140625,328.2431640625,19.7555103302}, {1229.365234375,311.1435546875,24.7578125}, {-2204.07421875,-2309.58203125,31.375}, {1615.939453125,1818.0537109375,10.8203125}, {1601.9443359375,1816.736328125,10.8203125}, {1590.0166015625,1792.0234375,30.46875}, {1607.3232421875,1776.7412109375,37.3125}, {2107.7626953125,926.16015625,10.8203125}, {2116.12890625,925.7705078125,10.9609375}, {2122.1865234375,925.3193359375,10.8203125}, } patrolPoints = { {-1603.2197265625,-2712.736328125,48.9453125}, {2465.748046875,-2215.55859375,13.546875}, {2473.439453125,-2215.56640625,13.546875}, {2480.0732421875,-2216.140625,13.546875}, {2487.24609375,-2215.5966796875,13.546875}, {2494.1005859375,-2215.5859375,13.546875}, {-1686.6728515625,408.9970703125,7.3984375}, {-1682.34375,412.9384765625,7.3984375}, {-1680.0263671875,402.3642578125,7.3984375}, {-1675.84375,406.4677734375,7.3984375}, {-1670.5615234375,411.8359375,7.3984375}, {-1666.2392578125,416.2509765625,7.3984375}, {-1672.7939453125,422.81640625,7.3984375}, {-1677.20703125,418.46484375,7.3984375}, {-2410.7021484375,969.9091796875,45.4609375}, {-2410.744140625,975.220703125,45.4609375}, {-2410.837890625,980.5302734375,45.4609375}, {-1329.3046875,2668.5126953125,50.46875}, {-1328.7314453125,2673.90625,50.0625}, {-1327.0185546875,2679.3876953125,50.46875}, {-1327.3798828125,2684.62890625,50.0625}, {1940.7099609375,-1778.5244140625,13.390598297119}, {1940.6552734375,-1774.908203125,13.390598297119}, {1940.630859375,-1771.728515625,13.390598297119}, {1940.7080078125,-1767.3837890625,13.390598297119}, {-1477.921875,1868.138671875,32.639846801758}, {-1466.1552734375,1869.0048828125,32.6328125}, {-1464.5224609375,1861.3828125,32.639846801758}, {-1477.4599609375,1860.5205078125,32.6328125}, {-735.9208984375,2744.0087890625,47.2265625}, {-739.0439453125,2744.2421875,47.165451049805}, {377.6953125,2601.1083984375,16.484375}, {624.5263671875,1676.25390625,6.9921875}, {620.2958984375,1681.2431640625,6.9921875}, {616.248046875,1686.4169921875,7.1875}, {612.783203125,1691.1650390625,7.1875}, {609.2060546875,1696.201171875,7.1875}, {605.8505859375,1700.978515625,7.1875}, {602.27734375,1706.3603515625,7.1875}, {2141.037109375,2742.734375,10.960174560547}, {2142.3115234375,2752.6982421875,10.96019744873}, {2147.9521484375,2752.3203125,10.8203125}, {2152.60546875,2751.953125,10.8203125}, {2152.984375,2743.85546875,10.8203125}, {2147.75,2743.7392578125,10.8203125}, {-97.6298828125,-1175.0283203125,2.4990689754486}, {-90.74609375,-1177.853515625,2.2021217346191}, {-84.75390625,-1163.853515625,2.3359375}, {-91.5771484375,-1160.5732421875,2.4453125}, {-1606.525390625,-2717.2138671875,48.9453125}, {-1609.7109375,-2721.544921875,48.9453125}, {-1599.83203125,-2708.302734375,48.9453125}, {-2246.314453125,-2558.8212890625,32.0703125}, {-2241.3125,-2561.3662109375,32.0703125}, {-1132.2880859375,-135.0986328125,14.14396572113}, {-1153.529296875,-156.373046875,14.1484375}, {-1142.826171875,-145.67578125,14.14396572113}, {655.611328125,-557.9912109375,16.501491546631}, {655.6572265625,-572.1728515625,16.501491546631}, {1601.791015625,2203.90625,11.060997009277}, {1596.806640625,2203.4345703125,10.8203125}, {1590.197265625,2203.4853515625,10.8203125}, {1589.4775390625,2195.43359375,10.8203125}, {1596.125,2194.294921875,10.8203125}, {1601.6591796875,2194.3369140625,10.8203125}, {2206.8466796875,2470.47265625,10.8203125}, {2206.94140625,2474.75,10.8203125}, {2206.9267578125,2478.86328125,10.8203125}, {2198.06640625,2480.6953125,10.8203125}, {2197.541015625,2475.791015625,10.995170593262}, {2197.609375,2471.9169921875,10.995170593262}, {2120.8251953125,915.4833984375,10.8203125}, {2115.1181640625,915.44140625,10.8203125}, {2109.076171875,915.4228515625,10.8203125}, {2109.22265625,924.8779296875,10.9609375}, {2114.9404296875,924.8857421875,10.9609375}, {2119.5126953125,925.2861328125,10.9609375}, {2645.7197265625,1112.7802734375,10.8203125}, {2639.984375,1112.56640625,10.8203125}, {2634.828125,1112.3466796875,10.9609375}, {2634.1826171875,1101.9482421875,10.8203125}, {2636.7509765625,1101.6748046875,10.8203125}, {2643.5126953125,1101.81640625,10.8203125}, {2209.576171875,2469.8251953125,10.8203125}, {2208.8310546875,2475.09375,10.8203125}, {1005.078125,-901.7490234375,42.216625213623}, {993.025390625,-902.474609375,42.222496032715}, } lootItems = { ["helicrashsides"] = { {"Night Vision Goggles",368,1,90,10}, {"Rocket Launcher",359,1,90,5}, {"Heat-Seeking RPG",360,1,90,4}, {"Lighter",328,0.4,90,2}, {"Pistol",346,1,90,10}, {"Silenced Pistol",347,1,90,7}, {"Shotgun",349,1,90,6}, {"Uzi",352,1,90,5.5}, {"Knife",335,1,90,4}, {"Katana",339,1,90,3}, {"Pizza",1582,1,0,2}, {"Soda Bottle",2647,1,0,2}, {"Empty Patrol Canister",1650,1,0,2}, {"Roadflare",324,1,90,2}, {"Milk",2856,1,0,1}, {"Painkiller",2709,0.5,0,4}, {"Empty Soda Cans",2673,0.5,0,2}, {"Scruffy Burgers",2675,0.5,0,3}, {"Grenade",342,1,0,4}, {"Parachute",342,1,0,80}, {"Sawn-Off Shotgun",350,1,90,5}, {"SPAZ-12 Combat Shotgun",351,1,90,4}, {"MP5",353,1,90,6}, {"Watch",2710,1,0,4}, {"Heat Pack",1576,1,0,3}, {"Wire Fence",933,0.25,0,1}, {"Country Rifle",357,1,90,6}, {"Alice Backpack",3026,1,0,4}, {"Night Vision Goggles",368,1,90,1.5}, --{"Binocular",369,1,0,4}, {"Tire",1073,1,0,2}, {"Morphine",1579,1,0,4}, {"Army Skin",1577,1,0,4.5}, {"Civilian Skin",1577,1,0,3}, {"TEC-9",372,1,90,4}, {"AK-47",355,1,90,7}, {"GPS",2976,0.15,0,3}, {"Map",1277,0.8,90,7}, {"Toolbox",2969,0.5,0,1}, {"Engine",929,0.3,0,2}, {"Tent",1279,1,0,4.5}, {"Sniper Skin",1577,1,0,1.5}, {"M4",356,1,90,1}, {"Sniper Rifle",358,1,90,1.5}, {"Infrared Goggles",369,1,90,3}, {"Small Backpack",3026,0.5,0,5}, {"Coyote Backpack",3026,1.3,0,2}, --{"Thermal GPS",2976,0.2,0,3}, --{"GPS Jammer",2976,0.2,0,4}, }, ["hospital"] = { {"Medic Kit",2891,0.7,0}, {"Heat Pack",1576,1,0}, {"Bandage",1578,0.5,0}, {"Blood Bag",1580,1,0}, {"Morphine",1579,1,0}, {"Blood Bag",1580,1,0}, {"Medic Kit",2891,0.7,0}, {"Blood Bag",1580,1,0}, {"Painkiller",1580,1,0}, }, } vehicleAddonsInfo = { {422,4,1}, {470,4,1}, {468,2,1}, {433,6,1}, {437,6,1}, {509,0,0}, {487,0,1}, {497,0,1}, {453,0,1}, } function getVehicleAddonInfos (id) for i,veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2],veh[3] end end end function createHeliCrashSite() if cargoCol then destroyElement(getElementData(cargoCol,"parent")) destroyElement(cargoCol) end local item_id = math.random(table.size(heliCrashSites)) local x,y,z = heliCrashSites[item_id][1],heliCrashSites[item_id][2],heliCrashSites[item_id][3] cargobob = createVehicle(548,x,y,z,nil,nil,nil) setElementHealth(cargobob,0) setElementFrozen(cargobob,true) cargoCol = createColSphere(x,y,z,3) setElementData(cargoCol,"parent",cargobob) setElementData(cargoCol,"helicrash",true) setElementData(cargoCol,"MAX_Slots",0) for i, item in ipairs(lootItems["helicrashsides"]) do local value = math.percentChance (item[5]*3.5,math.random(1,2)) setElementData(cargoCol,item[1],value) --weapon Ammo local ammoData,weapID = getWeaponAmmoType (item[1],true) if ammoData and value > 0 then setElementData(cargoCol,ammoData,math.random(1,2)) end end setTimer(createHeliCrashSite,3600000,1) end createHeliCrashSite() function updateHospitals () for i,box in pairs(hospitalCol) do for _,items in ipairs(lootItems["hospital"]) do setElementData(hospitalCol[i],items[1],math.random(1,5)) end end setTimer(updateHospitals,3600000,1) end hospitalCol = {} function createHospitalPacks() number1 = 0 for i,box in ipairs(hospitalPacks) do number1 = number1+1 local x,y,z = box[1],box[2],box[3] object = createObject(1558,x,y,z,nil,nil,nil) hospitalCol[i] = createColSphere(x,y,z,2) setElementData(hospitalCol[i],"parent",object) setElementData(hospitalCol[i],"hospitalbox",true) setElementData(hospitalCol[i],"MAX_Slots",20) for _,items in ipairs(lootItems["hospital"]) do local randomNumber = math.random(1,10) if randomNumber >= 2 then setElementData(hospitalCol[i],items[1],math.random(1,5)) end end end setTimer(updateHospitals,3600000,1) end createHospitalPacks() for i,patrol in ipairs(patrolPoints) do local x,y,z = patrol[1],patrol[2],patrol[3] patrolCol = createColSphere(x,y,z,3) setElementData(patrolCol,"patrolstation",true) end dayzVehicles = {} function spawnDayZVehicles() if getElementData(getRootElement(),"serverhasloadvehicles") then return end for i,veh in ipairs(pickupSpawns) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(422,x,y,z) vehCol = createColSphere(x,y,z,2) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",20) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{422,x,y,z}) --others setElementData(vehCol,"fuel",10) end for i,veh in ipairs(patriotSpawns) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(470,x,y,z) vehCol = createColSphere(x,y,z,2.5) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",38) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{470,x,y,z}) --others setElementData(vehCol,"fuel",10) for i,items in ipairs(lootItems["helicrashsides"]) do local randomNumber = math.random(1,10) if randomNumber == 5 then setElementData(vehCol,items[1],1) end end end for i,veh in ipairs(sanchezSpanws) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(468,x,y,z) vehCol = createColSphere(x,y,z,1.5) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",6) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{468,x,y,z}) --others setElementData(vehCol,"fuel",10) end for i,veh in ipairs(barracksSpawns) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(433,x,y,z) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",64) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{433,x,y,z}) --others setElementData(vehCol,"fuel",10) for i,items in ipairs(lootItems["helicrashsides"]) do local randomNumber = math.random(1,10) if randomNumber == 5 then setElementData(vehCol,items[1],math.random(1,2)) end end end for i,veh in ipairs(coachSpawns) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(437,x,y,z) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",56) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{437,x,y,z}) --others setElementData(vehCol,"fuel",10) end for i,veh in ipairs(fisherBootSpawns) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(453,x,y,z) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",30) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{453,x,y,z}) --others setElementData(vehCol,"fuel",10) end for i,veh in ipairs(bikeSpawns) do local x,y,z = veh[1],veh[2],veh[3] veh = createVehicle(509,x,y,z) vehCol = createColSphere(x,y,z,2) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",0) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{509,x,y,z}) --others setElementData(vehCol,"fuel",0) end for i,tent in ipairs(tentSpawns) do local x,y,z = tent[1],tent[2],tent[3] tent = createObject(3243,x,y,z-1) setObjectScale(tent,0.5) tentCol = createColSphere(x,y,z,4) attachElements ( tentCol, tent, 0, 0, 0 ) setElementData(tentCol,"parent",tent) setElementData(tent,"parent",tentCol) setElementData(tentCol,"tent",true) setElementData(tentCol,"vehicle",true) setElementData(tentCol,"MAX_Slots",30) end --Maverik local item_id = math.random(table.size(maverikSpawns)) local x,y,z = maverikSpawns[item_id][1],maverikSpawns[item_id][2],maverikSpawns[item_id][3] hunter = createVehicle(487,x,y,z) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, hunter, 0, 0, 0 ) setElementData(vehCol,"parent",hunter) setElementData(hunter,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",10) --Engine + Tires local tires,engine = getVehicleAddonInfos (487) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{487,x,y,z}) --others setElementData(vehCol,"fuel",10) --Police Maverik local item_id = math.random(table.size(hunterSpawns)) local x,y,z = hunterSpawns[item_id][1],hunterSpawns[item_id][2],hunterSpawns[item_id][3] hunter = createVehicle(497,x,y,z) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, hunter, 0, 0, 0 ) setElementData(vehCol,"parent",hunter) setElementData(hunter,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",10) --Engine + Tires local tires,engine = getVehicleAddonInfos (497) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{497,x,y,z}) --others setElementData(vehCol,"fuel",10) end --spawnDayZVehicles() function spawnVehiclePack (ps,cmd) if getElementData(ps,"admin") then spawnDayZVehicles() end end addCommandHandler("svp",spawnVehiclePack) function notifyAboutExplosion() local col = getElementData(source,"parent") local x1,y1,z1 = getElementPosition(source) id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4] setTimer(respawnDayZVehicle,1800000,1,id,x,y,z,source,col,getElementData(col,"MAX_Slots")) setElementData(col,"deadVehicle",true) setElementData(source,"isExploded",true) createExplosion (x1+4,y1+1,z1,4) createExplosion (x1+2,y1-4,z1,4) createExplosion (x1-1,y1+5,z1,4) createExplosion (x1-4,y1,z1-2,4) end addEventHandler("onVehicleExplode", getRootElement(), notifyAboutExplosion) function respawnVehiclesInWater (vehiclesInWater) for i,veh in ipairs(vehiclesInWater) do if getElementModel(veh) == 453 then break end local col = getElementData(veh,"parent") id,x,y,z = getElementData(col,"spawn")[1],getElementData(col,"spawn")[2],getElementData(col,"spawn")[3],getElementData(col,"spawn")[4] respawnDayZVehicle(id,x,y,z,veh,col,getElementData(col,"MAX_Slots")) end end addEvent("respawnVehiclesInWater",true) addEventHandler("respawnVehiclesInWater",getRootElement(),respawnVehiclesInWater) function checkVehicleInWater () local randomPlayer = getRandomPlayer() triggerClientEvent(randomPlayer,"checkVehicleInWaterClient",randomPlayer) end setTimer(checkVehicleInWater,1800000,0) --1800000 function respawnDayZVehicle(id,x,y,z,veh,col,max_slots) if id == 497 then local item_id = math.random(table.size(hunterSpawns)) x,y,z = hunterSpawns[item_id][1],hunterSpawns[item_id][2],hunterSpawns[item_id][3] end if id == 487 then local item_id = math.random(table.size(maverikSpawns)) x,y,z = maverikSpawns[item_id][1],maverikSpawns[item_id][2],maverikSpawns[item_id][3] end destroyElement(veh) destroyElement(col) veh = createVehicle(id,x,y,z+1) vehCol = createColSphere(x,y,z,4) attachElements ( vehCol, veh, 0, 0, 0 ) setElementData(vehCol,"parent",veh) setElementData(veh,"parent",vehCol) setElementData(vehCol,"vehicle",true) setElementData(vehCol,"MAX_Slots",max_slots) --Engine + Tires local tires,engine = getVehicleAddonInfos (getElementModel(veh)) setElementData(vehCol,"Tire_inVehicle",math.random(0,tires)) setElementData(vehCol,"Engine_inVehicle",math.random(0,engine)) --vehicle_indentifikation setElementData(vehCol,"spawn",{id,x,y,z}) --others setElementData(vehCol,"fuel",10) if id == 433 then for i,items in ipairs(lootItems["helicrashsides"]) do local randomNumber = math.random(1,10) if randomNumber == 5 then setElementData(vehCol,items[1],math.random(1,2)) end end elseif id == 470 then for i,items in ipairs(lootItems["helicrashsides"]) do local randomNumber = math.random(1,10) if randomNumber == 5 then setElementData(vehCol,items[1],math.random(1,2)) end end end end vehicleAddonsInfo = { {422,4,1}, {470,4,1}, {468,2,1}, {433,6,1}, {437,6,1}, {509,0,0}, {487,0,1}, {497,0,1}, {453,0,1}, } vehicleFuelInfo = { {422,0.25}, {470,0.1}, {468,0.1}, {433,0.5}, {437,0.5}, {509,0}, {487,0.25}, {497,0.25}, {453,0.1}, } function getVehicleAddonInfos (id) for i,veh in ipairs(vehicleAddonsInfo) do if veh[1] == id then return veh[2],veh[3] end end end function onPlayerEnterDayzVehicle(veh,seat) local col = getElementData(veh,"parent") local id = getElementModel(veh) if not seat == 1 then return end local tires,engine = getVehicleAddonInfos (id) setVehicleEngineState ( veh, false ) setElementData(veh,"maxfuel",getVehicleMaxFuel(col)) setElementData(veh,"needtires",tires) setElementData(veh,"needengines",engine) if ((getElementData(col,"Tire_inVehicle") or 0) < tonumber(tires)) then setVehicleEngineState ( veh, false ) return end if ((getElementData(col,"Engine_inVehicle") or 0) < tonumber(engine)) then setVehicleEngineState ( veh, false ) return end if (getElementData(col,"fuel") or 0) <= 1 then if not getElementModel(veh) == 509 then triggerClientEvent (source, "displayClientInfo", source,"Vehicle","There is no fuel in this Vehicle",22,255,0) setVehicleEngineState ( veh, false ) return end end setVehicleEngineState ( veh, true ) bindKey(source,"k","down",setEngineStateByPlayer) outputChatBox("Press 'k' to change the engine status.",source) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onPlayerEnterDayzVehicle ) function onPlayerExitDayzVehicle(veh,seat) if seat == 0 then setVehicleEngineState ( veh, false ) unbindKey(source,"k","down",setEngineStateByPlayer) end end addEventHandler ( "onPlayerVehicleExit", getRootElement(), onPlayerExitDayzVehicle ) function getVehicleFuelRemove (id) for i,veh in ipairs(vehicleFuelInfo) do if veh[1] == id then return veh[2] end end end function setVehiclesFuelPerMinute () for i,veh in ipairs(getElementsByType("vehicle")) do if getVehicleEngineState(veh) == true then if getElementData(getElementData(veh,"parent"),"fuel") >= 0 then setElementData(getElementData(veh,"parent"),"fuel",getElementData(getElementData(veh,"parent"),"fuel")-getVehicleFuelRemove(getElementModel(veh))) else setVehicleEngineState ( veh, false ) end end end end setTimer(setVehiclesFuelPerMinute,20000,0) function isVehicleReadyToStart2 (veh) if getElementData(getElementData(veh,"parent"),"fuel") >= 1 then local tires,engine = getVehicleAddonInfos (getElementModel(veh)) if (getElementData(getElementData(veh,"parent"),"Tire_inVehicle") or 0) > tonumber(tires) and (getElementData(getElementData(veh,"parent"),"Engine_inVehicle") or 0) > tonumber(engine) then setVehicleEngineState ( veh, true ) end end setTimer(isVehicleReadyToStart2,1000,1,veh) end repairTimer = {} function repairVehicle (veh) if repairTimer[veh] then triggerClientEvent (source, "displayClientInfo", source,"Vehicle",getVehicleName(veh).." is already going to be repaired",255,22,0) return end local health = math.floor(getElementHealth(veh)) repairTimer[veh] = setTimer(fixVehicleDayZ,(1000-health)*120,1,veh,source) setElementFrozen (veh,true) setElementData(veh,"repairer",source) setElementData(source,"repairingvehicle",veh) setPedAnimation (source,"SCRATCHING","sclng_r",nil,true,false) triggerClientEvent (source, "displayClientInfo", source,"Vehicle","You started repairing "..getVehicleName(veh),22,255,0) end addEvent("repairVehicle",true) addEventHandler("repairVehicle",getRootElement(),repairVehicle) function fixVehicleDayZ(veh,player) setElementHealth(veh,1000) fixVehicle (veh) setPedAnimation(player,false) setElementFrozen (veh,false) repairTimer[veh] = nil setElementData(veh,"repairer",nil) setElementData(player,"repairingvehicle",nil) triggerClientEvent (player, "displayClientInfo", player,"Vehicle","You finished repairing "..getVehicleName(veh),22,255,0) end function stopFixxingWhileMoving() local veh = getElementData(source,"repairingvehicle") setPedAnimation(source) setElementFrozen (veh,false) setElementData(veh,"repairer",nil) setElementData(source,"repairingvehicle",nil) triggerClientEvent (source, "displayClientInfo", source,"Vehicle","You stopped repairing "..getVehicleName(veh),255,22,0) killTimer(repairTimer[veh]) repairTimer[veh] = nil end addEvent("onClientMovesWhileAnimation",true) addEventHandler("onClientMovesWhileAnimation",getRootElement(),stopFixxingWhileMoving) function debugFixxing() for i,veh in ipairs(getElementsByType("vehicle")) do if getElementData(veh,"repairer") == source then outputDebugString("Vehicle repairer disconnected - destgroyed tables") killTimer(repairTimer[veh]) setElementFrozen (veh,false) repairTimer[veh] = nil setElementData(veh,"repairer",nil) end end end addEventHandler("onPlayerQuit",getRootElement(),debugFixxing) function setEngineStateByPlayer (playersource) local veh = getPedOccupiedVehicle (playersource) setVehicleEngineState (veh, not getVehicleEngineState(veh)) if getElementData(getElementData(veh,"parent"),"fuel") <= 0 then return end if getVehicleEngineState(veh) == true then triggerClientEvent (playersource, "displayClientInfo", playersource,"Vehicle","You started the Engine.",22,255,0) else triggerClientEvent (playersource, "displayClientInfo", playersource,"Vehicle","You stopped the Engine. ",255,22,0) end end client side: --- Tabla para los carros syntax = id,precio local motoss = { {487, 1}; --Add More vehicles, Syntax: {ID, PRICE} {509, 40000}; {481, 45000}; {462, 50000}; {521, 150000}; {463, 90000}; {510, 70000}; {470, 1}; {461, 1}; {448, 50000}; {468, 1}; {586, 17000} } --- Its decompiled For your Use, Please Comment, Rate! lagUII = guiCreateWindow(24, 145, 215, 372, "Shop", false) guiWindowSetSizable(lagUII, false) guiSetAlpha(lagUII, 0.84) guiSetProperty(lagUII, "CaptionColour", "FFFD0000") gridMotos = guiCreateGridList(0.04, 0.10, 0.91, 0.81, true, lagUII) guiGridListSetSelectionMode(gridMotos,0) nombres = guiGridListAddColumn(gridMotos, "Vehiculos", 0.5) precios = guiGridListAddColumn(gridMotos, "Precios", 0.5) compros = guiCreateButton(11, 341, 92, 18, "Comprar", false, lagUII) guiSetFont(compros, "default-bold-small") guiSetProperty(compros, "NormalTextColour", "FF031AFB") cierras = guiCreateButton(113, 341, 92, 18, "Cerrar", false, lagUII) guiSetFont(cierras, "default-bold-small") guiSetProperty(cierras, "NormalTextColour", "FF05F811") guiSetVisible(lagUII, false) for i,v in ipairs (motoss) do local carNames = getVehicleNameFromModel (v[1]) local row = guiGridListAddRow (gridMotos) guiGridListSetItemText (gridMotos, row, 1, carNames, false, true) guiGridListSetItemText (gridMotos, row, 2, tostring(v[2]), false, true) end function onClientCarBuyy (button, state, absoluteX, absoluteYe) if (source == compros) then guiSetVisible (lagUII, false) showCursor (false) if (guiGridListGetSelectedItem (gridMotos)) then local carNames = guiGridListGetItemText (gridMotos, guiGridListGetSelectedItem (gridMotos), 1) local carIDs = getVehicleModelFromName (carNames) local carCosts = guiGridListGetItemText (gridMotos, guiGridListGetSelectedItem (gridMotos), 2) triggerServerEvent ("carBuyy", getLocalPlayer(), carIDs, carCosts, carNames) end end end addEventHandler ("onClientGUIClick", compros, onClientCarBuyy) --- function closeShops() if guiGetVisible(lagUII) then guiSetVisible(lagUII,false) showCursor(false) end end addEventHandler ("onClientGUIClick", cierras, closeShops, false) function abrirsr( ) guiSetVisible (lagUII, true) guiSetVisible (lagUI, false) showCursor(true) end addEvent( "AbrirrSids", true ) addEventHandler( "AbrirrSids", localPlayer, abrirsr ) --[[ #---------------------------------------------------------------# ----* DayZ MTA Script menu_client.lua *---- ----* This Script is owned by Marwin, you are not allowed to use or own it. ----* Owner: Marwin W., Germany, Lower Saxony, Otterndorf ----* Skype: xxmavxx96 ----* *---- #---------------------------------------------------------------# ]] --Create Scroll Menü local spalten = {} local spalteGuiImage = {} local spalteGuiText = {} local optionsTable = { ["player"] = { {"Give Painkillers"}, {"Give Bandage"}, {"Give Morphine"}, }, } spalten[1] = "" spalten[2] = "" spalten[3] = "" spalten[4] = "" spalteGuiImage[1] = guiCreateStaticImage(0,0.45,0.1,0.025,"images/scrollmenu_1.png",true) spalteGuiImage[2] = guiCreateStaticImage(0,0.475,0.1,0.025,"images/scrollmenu_1.png",true) spalteGuiImage[3] = guiCreateStaticImage(0,0.5,0.1,0.025,"images/scrollmenu_1.png",true) spalteGuiImage[4] = guiCreateStaticImage(0,0.525,0.1,0.025,"images/scrollmenu_1.png",true) spalteGuiText[1] = guiCreateLabel(0.05,0.05,0.995,0.95,spalten[1],true,spalteGuiImage[1]) spalteGuiText[2] = guiCreateLabel(0.05,0.05,0.995,0.95,spalten[2],true,spalteGuiImage[2]) spalteGuiText[3] = guiCreateLabel(0.05,0.05,0.995,0.95,spalten[3],true,spalteGuiImage[3]) spalteGuiText[4] = guiCreateLabel(0.05,0.05,0.995,0.95,spalten[4],true,spalteGuiImage[4]) --guiLabelSetColor (spalteGuiText[1],50,255,50) guiSetVisible(spalteGuiImage[1],false) guiSetVisible(spalteGuiImage[2],false) guiSetVisible(spalteGuiImage[3],false) guiSetVisible(spalteGuiImage[4],false) ------------------------------------------------------------------------------ --MENU function showClientMenuItem(arg1,arg2,arg3,arg4) local number = 0 if arg1 == "Take" then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Take "..arg2) if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem",arg2) end if arg1 == "stop" then disableMenu() refreshLoot(false) end if arg1 == "Helicrashsite" then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Gear (Helicrash)") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem","helicrashsite") end if arg1 == "Hospitalbox" then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Gear (Hospitalbox)") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem","hospitalbox") end if arg1 == "Vehicle" then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Gear ("..arg2..")") guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) setElementData(spalteGuiText[number],"usedItem","vehicle") if getElementData(getElementData(arg3,"parent"),"tent") then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Remove Tent") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem","tent") return end --2 if getElementHealth(arg3) < 1000 and getElementHealth(arg3) >= 50 and getElementData(getLocalPlayer(),"Toolbox") >= 1 then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Repair ("..arg2..")") setElementData(spalteGuiText[number],"usedItem","repairvehicle") end end if arg1 == "Player" then --1 if getElementData(arg2,"bleeding") > 0 and getElementData(getLocalPlayer(),"Bandage") >= 1 then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Give Bandage") guiLabelSetColor (spalteGuiText[1],50,255,50) setElementData(spalteGuiText[1],"markedMenuItem",true) setElementData(spalteGuiText[number],"usedItem","bandage") end if getElementData(arg2,"blood") < 11900 and getElementData(getLocalPlayer(),"Blood Bag") >= 1 then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Give Blood Pack") setElementData(spalteGuiText[number],"usedItem","giveblood") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end end end if arg1 == "Dead" then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Gear ("..arg2..")") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem","dead") number = number+1 setElementData(spalteGuiText[number],"usedItem","deadreason") guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Check Body") end if arg1 == "Fireplace" then if getElementData(getLocalPlayer(),"Raw Meat") >= 1 then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Cook Meat") guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) setElementData(spalteGuiText[number],"usedItem","fireplace") end end if arg1 == "Patrol" then if getElementData(getLocalPlayer(),"Empty Patrol Canister") >= 1 then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Refill (Empty Patrol Canister)") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem","patrolstation") end end if arg1 == "Wirefence" then if getElementData(getLocalPlayer(),"Toolbox") >= 1 then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Remove Wirefence") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem","wirefence") end end if arg1 == "Gear" then number = number+1 guiSetVisible(spalteGuiImage[number],true) guiSetText(spalteGuiText[number],"Gear") if number == 1 then guiLabelSetColor (spalteGuiText[number],50,255,50) setElementData(spalteGuiText[number],"markedMenuItem",true) end setElementData(spalteGuiText[number],"usedItem","itemloot") end end addEvent("showClientMenuItem",true) addEventHandler("showClientMenuItem",getLocalPlayer(),showClientMenuItem) function PlayerScrollMenu (key,keyState,arg) if ( keyState == "down" ) then if not guiGetVisible(spalteGuiImage[2]) then return end if arg == "up" then if getElementData(spalteGuiText[1],"markedMenuItem") then setElementData(spalteGuiText[1],"markedMenuItem",false) setElementData(spalteGuiText[2],"markedMenuItem",true) guiLabelSetColor (spalteGuiText[2],50,255,50) guiLabelSetColor (spalteGuiText[1],255,255,255) elseif getElementData(spalteGuiText[2],"markedMenuItem") then setElementData(spalteGuiText[2],"markedMenuItem",false) setElementData(spalteGuiText[1],"markedMenuItem",true) guiLabelSetColor (spalteGuiText[1],50,255,50) guiLabelSetColor (spalteGuiText[2],255,255,255) end elseif arg == "down" then if getElementData(spalteGuiText[1],"markedMenuItem") then setElementData(spalteGuiText[1],"markedMenuItem",false) setElementData(spalteGuiText[2],"markedMenuItem",true) guiLabelSetColor (spalteGuiText[2],50,255,50) guiLabelSetColor (spalteGuiText[1],255,255,255) elseif getElementData(spalteGuiText[2],"markedMenuItem") then setElementData(spalteGuiText[2],"markedMenuItem",false) setElementData(spalteGuiText[1],"markedMenuItem",true) guiLabelSetColor (spalteGuiText[1],50,255,50) guiLabelSetColor (spalteGuiText[2],255,255,255) end end end end bindKey ( "mouse_wheel_up", "down", PlayerScrollMenu, "up" ) bindKey ( "mouse_wheel_down", "down", PlayerScrollMenu, "down" ) function disableMenu() guiSetVisible(spalteGuiImage[1],false) guiSetVisible(spalteGuiImage[2],false) guiSetVisible(spalteGuiImage[3],false) guiSetVisible(spalteGuiImage[4],false) setElementData(spalteGuiText[1],"markedMenuItem",false) setElementData(spalteGuiText[2],"markedMenuItem",false) setElementData(spalteGuiText[3],"markedMenuItem",false) setElementData(spalteGuiText[4],"markedMenuItem",false) setNewbieInfo (false,"","") end addEvent("disableMenu",true) addEventHandler("disableMenu",getLocalPlayer(),disableMenu) ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ --TAKE OBJECT FUNCTIONS function getPlayerInCol(tab) for theKey,thePlayer in ipairs(tab) do if thePlayer ~= getLocalPlayer() then return true end end return false end isInFirePlace = false function onPlayerTargetPickup (theElement) if theElement == getLocalPlayer() then if getElementData(source,"parent") == getLocalPlayer() then return end local player = getPlayerInCol(getElementsWithinColShape ( source, "player" )) if getPedOccupiedVehicle(getLocalPlayer()) then return end isInFirePlace = false setElementData(spalteGuiText[2],"markedMenuItem",false) setElementData(spalteGuiText[1],"markedMenuItem",true) guiLabelSetColor (spalteGuiText[1],50,255,50) guiLabelSetColor (spalteGuiText[2],255,255,255) if getElementData(source,"player") then showClientMenuItem("Player",getElementData(source,"parent")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) return end if player then return end if getElementData(source,"patrolstation") then showClientMenuItem("Patrol") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Patrolstation","Press '-' or 'middle-mouse' to refill a Canister.\n Required: Empty Patrol Canister",source) return end if getElementData(source,"wirefence") then showClientMenuItem("Wirefence") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Wirefence","Press '-' or 'middle-mouse' to remove the fence.\n Required: Toolbox",source) return end if getElementData(source,"fireplace") then showClientMenuItem("Fireplace") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Fireplace","Press '-' or 'middle-mouse' to cook meat.\n Required: Raw Meat",source) isInFirePlace = true return end if getElementData(source,"deadman") then showClientMenuItem("Dead",getElementData(source,"playername")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..getElementData(source,"playername")..")") setNewbieInfo (true,"Gear","Press J to open the Gear",source) return end if getElementData(source,"item") then showClientMenuItem("Take",getElementData(source,"item")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",false) setNewbieInfo (true,"Item pickup","Press '-' or 'middle-mouse' to pick up the item.",source) return end if getElementData(source,"helicrash") then showClientMenuItem("Helicrashsite","helicrash") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear (Helicrash)") setNewbieInfo (true,"Gear","Press J to open the Gear",source) return end if getElementData(source,"hospitalbox") then showClientMenuItem("Hospitalbox","hospitalbox") setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear (Hospitalbox)") setNewbieInfo (true,"Gear","Press J to open the Hospitalbox",source) return end if getElementData(source,"vehicle") then if not getElementData(source,"deadVehicle") then showClientMenuItem("Vehicle",(getVehicleName(getElementData(source,"parent")) or "Tent"),getElementData(source,"parent")) setElementData(getLocalPlayer(),"currentCol",source) setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear ("..(getVehicleName(getElementData(source,"parent")) or "Tent")..")") setNewbieInfo (true,"Gear","Press J to open the Gear",source) return end end if getElementData(source,"itemloot") then showClientMenuItem("Gear") setElementData(getLocalPlayer(),"loot",true) setElementData(getLocalPlayer(),"lootname","Gear") setElementData(getLocalPlayer(),"currentCol",source) setNewbieInfo (true,"Gear","Press J to open the Gear",source) return end showClientMenuItem("stop") end end addEventHandler("onClientColShapeHit",getRootElement(),onPlayerTargetPickup) function onPlayerTargetPickup (theElement) if theElement == getLocalPlayer() then local players = getElementsWithinColShape ( source, "player" ) if players == getLocalPlayer() then --[[return ]]end showClientMenuItem("stop") setElementData(getLocalPlayer(),"loot",false) setElementData(getLocalPlayer(),"currentCol",false) setNewbieInfo (false,"","") isInFirePlace = false end end addEventHandler("onClientColShapeLeave",getRootElement(),onPlayerTargetPickup) --Newbie Infos local screenWidth, screenHeight = guiGetScreenSize() local newbieShow = false local newbieHead = "-" local newbieText = "-" local newbiePosition = 0,0,0 function setNewbieInfo (show,head,text,element) newbieShow = show newbieHead = head newbieText = text newbiePosition = element end addEventHandler("onClientRender", getRootElement(), function() if newbieShow == false then return end local x,y,z = getElementPosition(newbiePosition) local x,y = getScreenFromWorldPosition (x,y,z) local length = dxGetTextWidth(newbieText,1,"default-bold") dxDrawRectangle ( x-length/2-screenWidth*0.01,y, screenWidth*0.02+length, screenHeight*0.1, tocolor (33,33,33,100) ) dxDrawingColorText(newbieHead,x-length/2-screenWidth*0.01,y, x+length/2+screenWidth*0.01, y+screenHeight*0.03, tocolor(22,255,22,120),0.5, 1.1, "default-bold", "center", "center") dxDrawingColorText(newbieText,x-length/2-screenWidth*0.01,y+screenHeight*0.03, x+length/2+screenWidth*0.01, y+screenHeight*0.07, tocolor(255,255,255,120),0.5, 1, "default-bold", "center", "center") end ) function fireRaiseTemperature () if isInFirePlace then if getElementData(getLocalPlayer(),"temperature") <= 38 then setElementData(getLocalPlayer(),"temperature",getElementData(getLocalPlayer(),"temperature")+0.25) end end end setTimer(fireRaiseTemperature,10000,0) ------------------------------------------------------------------------------ unbindKey("mouse3","both") function onPlayerPressMiddleMouse (key,keyState) if ( keyState == "down" ) then if not guiGetVisible(spalteGuiText[1]) then return end local itemName = getMenuMarkedItem() if itemName == "helicrashsite" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear (Helicrash)" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "itemloot" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "wirefence" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Remove Wirefence" triggerServerEvent("removeWirefence",getLocalPlayer(),getElementData(col,"parent")) disableMenu() return end if itemName == "hospitalbox" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear (Hospitalbox)" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "vehicle" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear ("..(getVehicleName(getElementData(col,"parent")) or "Tent")..")" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "repairvehicle" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("repairVehicle",getLocalPlayer(),getElementData(col,"parent")) disableMenu() return end if itemName == "tent" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("removeTent",getLocalPlayer(),getElementData(col,"parent")) disableMenu() return end if itemName == "fireplace" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("addPlayerCookMeat",getLocalPlayer()) disableMenu() return end if itemName == "bandage" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent")) disableMenu() return end if itemName == "giveblood" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerGiveMedicObject",getLocalPlayer(),itemName,getElementData(col,"parent")) disableMenu() return end if itemName == "dead" then local col = getElementData(getLocalPlayer(),"currentCol") local gearName = "Gear ("..getElementData(col,"playername")..")" refreshLoot(col,gearName) showInventoryManual() return end if itemName == "deadreason" then local col = getElementData(getLocalPlayer(),"currentCol") outputChatBox(getElementData(col,"deadreason"),255,255,255,true) return end if itemName == "patrolstation" then local col = getElementData(getLocalPlayer(),"currentCol") setElementData(getLocalPlayer(),"Empty Patrol Canister",getElementData(getLocalPlayer(),"Empty Patrol Canister")-1) setElementData(getLocalPlayer(),"Full Patrol Canister",(getElementData(getLocalPlayer(),"Full Patrol Canister") or 0)+1) triggerEvent ("displayClientInfo",getLocalPlayer(),"Patrolstation","You filled your Patrol Canister up",22,255,0) disableMenu() return end if isToolbeltItem(itemName) then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() return end if itemName == "Small Backpack" or itemName == "Alice Backpack" or itemName == "Coyote Backpack" then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() return end if getPlayerCurrentSlots() + getItemSlots(itemName) <= getPlayerMaxAviableSlots() then local col = getElementData(getLocalPlayer(),"currentCol") triggerServerEvent("onPlayerTakeItemFromGround",getLocalPlayer(),itemName,col) disableMenu() else startRollMessage2("Inventory", "Your Inventory is to full", 255, 22, 0 ) end end end bindKey ( "mouse3", "down", onPlayerPressMiddleMouse ) bindKey ( "-", "down", onPlayerPressMiddleMouse ) function getMenuMarkedItem() for i,guiItem in ipairs(spalteGuiText) do if getElementData(guiItem,"markedMenuItem") then return getElementData(guiItem,"usedItem") end end end function playerPressedKey(button, press) if (press) then if button == "w" or button == "a" or button == "s" or button == "d" then local anim,anim2 = getPedAnimation (getLocalPlayer()) if anim and anim == "SCRATCHING" and anim2 == "sclng_r" then triggerServerEvent("onClientMovesWhileAnimation",getLocalPlayer()) end end end end addEventHandler("onClientKey", root, playerPressedKey)
  11. que puedo reemplazar por el onClientPrerender para dxDrawMaterialLine3D ya que quiero hacer que la imagen se le ponga arriba a un determinado player al este hacerle daño al otro,obviamente hice triggers para que los demas vieran la insignia arriba de la cabeza de el jugador que lo tendrá,pero quiero que se vea un determinado tiempo ya que si solo uso trigger y no onClientPreRender,este solo durara unas milesimas de segundo.gracias.
  12. ma2med

    Sorting JSON

    Hello, I want to sort json but when I'm converting table to JSON it become like this Table [1] = "blabla", [2] = "blabla2", [3] = "blabla3" JSON [2] = "blabla2", [3] = "blabla3", [1] = "blabla" I mean by that example that the JSON is not sorted when its converted thanks.
  13. Server Log ~ [22:38:39] Starting movinggate [22:38:39] WARNING: movinggate\server.lua:6: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] [22:38:39] movinggate restarted successfully [22:38:45] WARNING: movinggate\server.lua:11: Bad argument @ 'addEventHandler' [Expected element at argument 2, got function] Script Code ~ Object = createObject(968, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) Marker = createMarker(1551.0999755859, -1627.3000488281, 12.5, "cylinder", 2, 100, 0, 12.5, 100) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 0, 90) end addEventHandler("onMarkerHit",gateo) function gateo(player) moveObject(object, 500, 1546.1999511719, -1631, 13.39999961853, 0, 90, 90) end addEventHandler("onMarkerLeave",gateo) Please help me solve this "addEventHandler" Problem. I'm new to the scripting,, Ive tried my research but i dont get it.
  14. can anyone can make me MTA dayz car buying system? Like simple panel and 1 car, the rest I can handle myself PLS!!
  15. Hi there, My name is Noah and I am currently working on changing certain bits of the original SA map. However, I stumbled upon a problem once I imported a custom model I made. It seems to be some sort of lighting problem. Here's a pic to show what I mean: https://gyazo.com/e85a28e85e6a2523666c223acde3bfe7 The custom model seems to have different lighting, which makes it stand out. As far as I know I am doing everything right. The .DFF, .TXD and .COL all work perfectly fine. It's just the lighting that's giving me problems. I hope anybody can give me some tips on what I am doing wrong, If you need more information please ask me! -Noah
  16. Please help me when i try to join a server it says MTA CLIENT VERIFICATION FAILED (Error CD19) I Need Help Fast
  17. I need some help on: dxDrawText Code: local screenWidth, screenHeight = guiGetScreenSize () local playerRadioChannel = getRadioChannelName(getRadioChannel()) function stationDraw(station) dxDrawText ( playerRadioChannel, screenWidth, screenHeight - 155, screenWidth - 66, screenHeight, tocolor ( 135, 96, 45, 255 ), 1.5, "bankgothic", "right" ) end addEventHandler("onClientPlayerRadioSwitch", getLocalPlayer(), stationDraw) I want the text having border, and staying uppercase, how? I do not know. How can I make it stay on screen for a few seconds and then disappear? I think we should use this: setTimer Thanks for everything!
  18. Guys i have its but i cant set up help me ?
  19. Hi! I just searched for lighting effects, and i found a shader for XNA. Its an Ambient and Diffuse lighting shader with Shadow Maps: #define GENERATE_NORMALS #include "mta-helper.fx" //------------------------------------------------------------------------------ // File: BasicRender.fx // // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ // Global variables //------------------------------------------------------------------------------ float4 g_MaterialAmbientColor = {0.05f, 0.05f, 0.05f, 0.05f}; // Material's ambient color float4 g_MaterialDiffuseColor = {0.75f, 0.75f, 0.75f, 0.75f}; // Material's diffuse color float3 g_LightPos = {1000, 2000, 1000}; // Position of light float3 g_LightDir = {0, 0, 0}; // Direction of light (temp) float4x4 g_mLightView; // View matrix of light float4x4 g_mLightProj; // Projection matrix of light float4 g_LightDiffuse = {0.75f, 0.75f, 0.75f, 0.75f}; // Light's diffuse color float4 g_LightAmbient = {0.05f, 0.05f, 0.05f, 0.05f}; // Light's ambient color texture g_MeshTexture; // Color texture for mesh texture g_ShadowMapTexture; // Shadow map texture for lighting float4x4 g_mWorld; // World matrix for object float3 g_CameraPos; // Camera position for scene View float4x4 g_mCameraView; // Camera's view matrix float4x4 g_mCameraProj; // Projection matrix //------------------------------------------------------------------------------ // Texture samplers //------------------------------------------------------------------------------ sampler MeshTextureSampler = sampler_state { Texture = (gTexture0); MipFilter = LINEAR; MinFilter = LINEAR; MagFilter = LINEAR; }; sampler ShadowMapSampler = sampler_state { Texture = <g_ShadowMapTexture>; MinFilter = POINT; MagFilter = POINT; MipFilter = POINT; AddressU = Clamp; AddressV = Clamp; }; //------------------------------------------------------------------------------ // Vertex shader output structure //------------------------------------------------------------------------------ struct VS_OUTPUT { float4 Position : POSITION0; // vertex position float2 TextureUV : TEXCOORD0; // vertex texture coords float3 vNormal : TEXCOORD1; float4 vPos : TEXCOORD2; }; struct PS_INPUT { float2 TextureUV : TEXCOORD0; // vertex texture coords float3 vNormal : TEXCOORD1; float4 vPos : TEXCOORD2; }; struct VS_SHADOW_OUTPUT { float4 Position : POSITION; float Depth : TEXCOORD0; }; //------------------------------------------------------------------------------ // Utility function(s) //------------------------------------------------------------------------------ float4x4 CreateLookAt(float3 gView, float3 gProjection, float3 up) { float3 zaxis = normalize(gView - gProjection); float3 xaxis = normalize(cross(up, zaxis)); float3 yaxis = cross(zaxis, xaxis); float4x4 view = { xaxis.x, yaxis.x, zaxis.x, 0, xaxis.y, yaxis.y, zaxis.y, 0, xaxis.z, yaxis.z, zaxis.z, 0, -dot(xaxis, gView), -dot(yaxis, gView), -dot(zaxis, gView), 1 }; return view; } float4 GetPositionFromLight(float4 position) { float4x4 WorldViewProjection = mul(mul(gWorld, gLightDiffuse), gLightDirection); return mul(position, WorldViewProjection); } //------------------------------------------------------------------------------ // This shader computes rudimentary transform and lighting. // The XNA VertexDeclaration of our models is PositionNormalTexture. //------------------------------------------------------------------------------ VS_OUTPUT RenderShadowsVS( float3 position : POSITION, float3 normal : NORMAL, float2 vTexCoord0 : TEXCOORD0 ) { VS_OUTPUT Output; //generate the world-view-projection matrix float4x4 wvp = mul(mul(gWorld, gView), gProjection); //transform the input position to the output Output.Position = mul(float4(position, 1.0), wvp); //transform the normal to world space Output.vNormal = mul(normal, gWorld); //do not transform the position needed for the //shadow map determination Output.vPos = float4(position,1.0); //pass the texture coordinate as-is Output.TextureUV = vTexCoord0; //return the output structure return Output; } VS_SHADOW_OUTPUT RenderShadowMapVS(float4 vPos: POSITION) { VS_SHADOW_OUTPUT Out; Out.Position = GetPositionFromLight(vPos); // Depth is Z/W. This is returned by the pixel shader. // Subtracting from 1 gives us more precision in floating point. Out.Depth.x = 1-(Out.Position.z/Out.Position.w); return Out; } //------------------------------------------------------------------------------ // Pixel shader output structure //------------------------------------------------------------------------------ struct PS_OUTPUT { float4 RGBColor : COLOR0; // Pixel color }; //------------------------------------------------------------------------------ // This shader outputs the pixel's color by modulating the texture's // color with diffuse material color //------------------------------------------------------------------------------ PS_OUTPUT RenderShadowsPS( PS_INPUT In ) { PS_OUTPUT Output; // Standard lighting equation float4 vTotalLightDiffuse = float4(0.1f,0.1f,0.1f,0.1f); float3 lightDir = normalize(g_LightPos+In.vPos); // direction of light vTotalLightDiffuse += g_LightDiffuse * max(0,dot(In.vNormal, lightDir)); vTotalLightDiffuse.a = 0.5f; // Now, consult the ShadowMap to see if we're in shadow float4 lightingPosition = GetPositionFromLight(In.vPos);// Get our position on the shadow map // Get the shadow map depth value for this pixel float2 ShadowTexC = 0.5 * lightingPosition.xy / lightingPosition.w + float2( 0.5, 0.5 ); ShadowTexC.y = 1.0f - ShadowTexC.y; float shadowdepth = tex2D(ShadowMapSampler, ShadowTexC).r; // Check our value against the depth value float ourdepth = 1 + (lightingPosition.z / lightingPosition.w); // Check the shadowdepth against the depth of this pixel // a fudge factor is added to account for floating-point error if (shadowdepth-0.03 > ourdepth) { // we're in shadow, cut the light vTotalLightDiffuse = float4(0,0,0,1); }; Output.RGBColor = tex2D(MeshTextureSampler, In.TextureUV) * (vTotalLightDiffuse + g_LightAmbient); return Output; } PS_OUTPUT DiffuseOnlyPS(VS_OUTPUT In) : COLOR { PS_OUTPUT Output; //calculate per-pixel diffuse float3 directionToLight = normalize(g_LightPos - In.vPos); float diffuseIntensity = saturate( dot(directionToLight, In.vNormal)); float4 diffuse = g_LightDiffuse * diffuseIntensity; float4 color = diffuse + g_LightAmbient; color.a = 0.0; Output.RGBColor = tex2D(MeshTextureSampler, In.TextureUV) * color; return Output; } PS_OUTPUT TextureOnlyPS(float2 TextureUV : TEXCOORD0) : COLOR { PS_OUTPUT Output; Output.RGBColor = tex2D(MeshTextureSampler, TextureUV); return Output; } float4 RenderShadowMapPS( VS_SHADOW_OUTPUT In ) : COLOR { // The depth is Z divided by W. We return // this value entirely in a 32-bit red channel // using SurfaceFormat.Single. This preserves the // floating-point data for finer detail. return float4(In.Depth.x,0,0,1); } //------------------------------------------------------------------------------ // Renders scene to render target //------------------------------------------------------------------------------ technique TextureRender { pass P0 { VertexShader = compile vs_2_0 RenderShadowsVS(); PixelShader = compile ps_2_0 TextureOnlyPS(); } pass P1 { VertexShader = compile vs_2_0 RenderShadowsVS(); PixelShader = compile ps_2_0 RenderShadowsPS(); } pass P2 { // These render states are necessary to get a shadow map. // You should consider resetting CullMode and AlphaBlendEnable // before you render your main scene. CullMode = CW; ZEnable = TRUE; ZWriteEnable = TRUE; AlphaBlendEnable = TRUE; VertexShader = compile vs_2_0 RenderShadowMapVS(); PixelShader = compile ps_2_0 RenderShadowMapPS(); } } This is not the original .fx file, i configured it for MTA. The diffuse and the ambient light works correctly, but not generating shadows. Any Idea?
  20. I have a question, can I just move the elements of the default interface? Or do I always have to create others from them? I just want to get, for example: getElementHealth And move it! In fact, I would like to do this with everyone, such as: getTime getPedWeapon getPedArmor getPedAmmoInClip getPedTotalAmmo getPedOxygenLevel getPlayerMoney getPlayerWantedLevel I do not want to create another, I want the standard, you know?
  21. Can anyone make me text on head "Admin On Duty [No Shooting]"? Also. Can anyone make me script, if you are around 100m then anyone can't equip weaons and shoot? function giveblood (thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin,Moderator,Owner")) then end outputChatBox ("#1AFF00 Admin "..getPlayerName(thePlayer).."#1AFF00IS NOW - ON DUTY",root,255,255,255,true) setElementData(thePlayer, "blood",999999999) setElementData(thePlayer, "food",95) setElementData(thePlayer, "thirst",95) setElementData(thePlayer, "temperature",36.5) setElementData(thePlayer, "currentweapon_1",false) setElementData(thePlayer, "currentweapon_2",false) setElementData(thePlayer, "currentweapon_3",false) setElementData(thePlayer, "bleeding",false) setElementData(thePlayer, "brokenbone",false) setElementData(thePlayer, "pain",false) setElementData(thePlayer, "cold",false) setElementData(thePlayer, "humanity",2500) end addCommandHandler("duty", giveblood) function bloodback(thePlayer) local account = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup("user." .. account, aclGetGroup("Admin,Moderator,Owner")) then end outputChatBox ("#FF0000 Admin "..getPlayerName(thePlayer).."#FF0000IS NOW - OFF DUTY",root,255,255,255,true) setElementData(thePlayer, "blood",12000) end addCommandHandler("offduty", bloodback)
  22. addEvent ( "onaduty", true ) function aduty() if getElementData(getLocalPlayer( ),"aduty") == true then timer = setTimer ( function() setElementData(getLocalPlayer( ),"onaduty",true) local x, y, z = getElementPosition( getLocalPlayer( ) ) local playerName = getPlayerName( getLocalPlayer( ) ) local theText = dxDraw3DText( "Admin On duty [DONT SHOOT]", x, y, z+1,05,"default",255,0,0,200) setTimer ( function() destroyElement(theText) end, 59, 1) end, 60, 0 ) else if isTimer(timer) then killTimer(timer) end setElementData(getLocalPlayer( ),"aduty",true) end end addEventHandler ( "onaduty", getRootElement(), aduty) addCommandHandler("duty",aduty) Text.lua Here is problem. I see the text but another players don't! goduty.lua function aduty ( player ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then outputChatBox(" Administrator "..getPlayerName(player).." Is Now OnDuty!",getRootElement(),255,0,0) outputChatBox("",getRootElement(),255,0,0) outputServerLog(" Administrator "..getPlayerName(player).." Is Now OnDuty!") setElementData( player, "blood", 99999999999999999999999 ) heal = "9999999999999999999999999999" end end addCommandHandler("duty",aduty) function offaduty ( player ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then outputChatBox(" Administrator "..getPlayerName(player).." Is No Longer OnDuty!",getRootElement(),255,0,0) outputChatBox("",getRootElement(),255,0,0) outputServerLog(" Administrator "..getPlayerName(player).." Is No Longer OnDuty!") setElementData( player, "blood", 12000 ) end end addCommandHandler("offaduty",offaduty) function heal_func ( player ) local accName = getAccountName(getPlayerAccount(player)) if isObjectInACLGroup ( "user." ..accName, aclGetGroup ( "Admin") ) then if heal == "an" then setElementData( player, "food", 250 ) setElementData( player, "thirst", 250 ) end end end setTimer(heal_func, 60000, 0) 3dtext.lua local fonts = { [ "default" ] = true, [ "default-bold" ] = true,[ "clear" ] = true,[ "arial" ] = true,[ "sans" ] = true, [ "pricedown" ] = true, [ "bankgothic" ] = true,[ "diploma" ] = true,[ "beckett" ] = true }; function dxDraw3DText( text, x, y, z, scale, font, r, g, b, maxDistance ) assert( type( text ) == "string", "Bad argument @ dxDraw3DText" ); assert( type( x ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( y ) == "number", "Bad argument @ dxDraw3DText" ); assert( type( z ) == "number", "Bad argument @ dxDraw3DText" ); if not scale or type( scale ) ~= "number" or scale <= 0 then scale = 2 end if not font or type( font ) ~= "string" or not fonts[ font ] then font = "default" end if not r or type( r ) ~= "number" or r < 0 or r > 255 then r = 255 end if not g or type( g ) ~= "number" or g < 0 or g > 255 then g = 255 end if not b or type( b ) ~= "number" or b < 0 or b > 255 then b = 255 end if not maxDistance or type( maxDistance ) ~= "number" or maxDistance <= 1 then maxDistance = 12 end local textElement = createElement( "text" ); if textElement then setElementData( textElement, "text", text ); setElementData( textElement, "x", x ); setElementData( textElement, "y", y ); setElementData( textElement, "z", z ); setElementData( textElement, "scale", scale ); setElementData( textElement, "font", font ); setElementData( textElement, "rgba", { r, g, b, 255 } ); setElementData( textElement, "maxDistance", maxDistance ); return textElement end return false end addEventHandler( "onClientRender", root, function( ) local texts = getElementsByType( "text" ); if #texts > 0 then local pX, pY, pZ = getElementPosition( localPlayer ); for i = 1, #texts do local text = getElementData( texts[i], "text" ); local tX, tY, tZ = getElementData( texts[i], "x" ), getElementData( texts[i], "y" ), getElementData( texts[i], "z" ); local font = getElementData( texts[i], "font" ); local scale = getElementData( texts[i], "scale" ); local color = getElementData( texts[i], "rgba" ); local maxDistance = getElementData( texts[i], "maxDistance" ); if not text or not tX or not tY or not tZ then return end if not font then font = "default" end if not scale then scale = 2 end if not color or type( color ) ~= "table" then color = { 255, 255, 255, 255 }; end if not maxDistance then maxDistance = 12 end local distance = getDistanceBetweenPoints3D( pX, pY, pZ, tX, tY, tZ ); if distance <= maxDistance then local x, y = getScreenFromWorldPosition( tX, tY, tZ ); if x and y then dxDrawText( text, x, y, _, _, tocolor( color[1], color[2], color[3], color[4] ), scale, font, "center", "center" ); end end end end end ); NEED HELP!!
  23. Michal3301

    netc.dll error!

    Hello, i have an problem. http://imgur.com/a/yG3ng - that's the problem. Can someone help me in that error? PS. I did MTADiag analyse.
  24. I want to stop the gravity after 5 seconds Gravity changes to 0.0001 but does not return to 0.0008 --client side panel = false function test() dxDrawRectangle(414, 297, 109, 29, tocolor(0, 0, 0, 150), false) dxDrawText("TEST GRAVITY", 414, 297, 523, 326, tocolor(255, 255, 255, 255), 1.00, "default-bold", "center", "center", false, false, false, false, false) end function onClientClick (button,state) if parte1hab and button == "left" and state == "down" then if isCursorOnElement(414, 297, 109, 29) then triggerServerEvent ("Gravity-5s", getLocalPlayer()) end end end addEventHandler("onClientClick",root,onClientClick) function open() if panel == false then addEventHandler ("onClientRender", root, test) panel = true showCursor (true) else removeEventHandler ("onClientRender", root, test) panel = false showCursor (false) end end bindKey("F5", "down", open) --server side function Gravity () setPedGravity(source, 0.0001) setTimer(function() setPedGravity(source, 0.0008) end, 5000, 1) end addEvent("Gravity-5s",true) addEventHandler("Gravity-5s",getRootElement(),Gravity)
×
×
  • Create New...