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. Hi Community, I created a panel for players to enter missions.There are names of the missions in the gridlists. But I do not want two players to enter the same mission.To prevent this, I gave data to the button to select the mission, and even if a second player clicks on that button, second player cannot enter the mission. The mission is on the server side and I want to give false data to the gui button when the mission is completed. How can I do this? How can I give false data to the gui button from the server side? can you help me ? function GoMission() if ( source == spawnButton ) then if getElementData(spawnButton,"paparazziFull") then return end --Other player cannot enter the mission local name = guiGridListGetItemText ( GUIEditor.gridlist[1], guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ), 1 ) if name == "Kill The Paparazzi" then setElementData(spawnButton,"paparazziFull",true) ----- There is someone in mission triggerServerEvent("PaparazziStart",localPlayer,localPlayer) guiSetVisible(GUIEditor.window[1], false) showCursor(false) playSoundFrontEnd ( 6) elseif name == "Andre Must Die" then triggerServerEvent("andreStart",localPlayer,localPlayer) guiSetVisible(GUIEditor.window[1], false) showCursor(false) playSoundFrontEnd ( 6) elseif name == "Cleaning The Hood" then triggerServerEvent("DrugDealerStart",localPlayer,localPlayer) guiSetVisible(GUIEditor.window[1], false) showCursor(false) playSoundFrontEnd ( 6) elseif name == "Rifas Die In Vinewood" then triggerServerEvent("rifaStart",localPlayer,localPlayer) guiSetVisible(GUIEditor.window[1], false) showCursor(false) playSoundFrontEnd ( 6) end end end addEventHandler("onClientGUIClick",spawnButton,GoMission)
  2. setTimer(function() local pVeh = getPedOccupiedVehicle(localPlayer) -- Get the players vehicle for i,v in pairs(getElementsByType("object")) do if (isElement(v)) and (getElementType(v)=="object") and (getElementModel(v)==1226) then if(pVeh) then setElementCollidableWith(pVeh,v, false) setElementCollidableWith(v,pVeh, false) end end end end, 500, 0) Hello! These simple codes only work on an object I put in the Map Editor. But I want it to be valid for all street lamps on the San Andreas map. I want to prevent the car from hitting the street lamps. Can you help a little?
  3. Hi, I've got a little problem with dxCreateFont function. Well, I try to create a new font style like this: local icon = dxCreateFont("FontAwesome.ttf") meta.xml: <file src="FontAwesome.ttf" /> And it write warning: Can somebody help me please?
  4. Hi, I'm trying to access custom attribute from .map file but script outputs "false" as a result. As an example I have "object" node <object id="object (bevgrnd03b_law) (1)" [...] myCustomAttr="bleh"></object> and I'm trying to iterate through all "object" elements and check whether it has "myCustomAttr" by using getElementData(el, "myCustomAttr") but this doesn't work. I saw in other scripts they do this and it just works but in my case it outputs "false". Could anybody help me with this problem?
  5. these codes I wrote do drop fps every 10 seconds.How can I use the setlementCollidableWith function properly? please help friends. setTimer (function() for i,peds in ipairs (getElementsByType ("ped")) do for i,players in ipairs (getElementsByType ("player")) do setElementCollidableWith (peds,players,false) end for i,vehicles in ipairs (getElementsByType ("vehicle")) do setElementCollidableWith (peds,vehicles,false) end for i,objects in ipairs (getElementsByType ("object")) do setElementCollidableWith (peds,objects,false) end end end,10000,0)
  6. hi guys Can you tell me why I got "warning" from these little codes? warning : Expected numbers,got non-convertable string.This warning may be an error in future versions. function showSpecificSlotWindow( slotid ) local slotname = getVehicleUpgradeSlotName( slotid ) if type( slotid ) == 'string' then slotname = slotid end local upgrades = getVehicleCompatibleUpgrades( moddingVeh ) if not hideSubToo then guiSetText( upgradeGUI.wnd, slotname ) showNewSub = false else addEventHandler( "onClientRender", getRootElement(), contractSubWindow ) end layoutButtons( slotname ) end
  7. Hello friends, I checked forum topics for how to make private group skins but creating private group's skins topics are always unfinished.I'm just trying a simple way.The skin of the "SEALS" group should change when I start the resource.So I used a very simple code, but it had no effect.What can I do about it?Can someone help me ? thanks. function ReplaceSkin(player) if (player and isElement(player) and getElementType(player)) == "player" then if getElementData(player,'Group') == 'Seals' then txd = engineLoadTXD ( "SL.txd" ) engineImportTXD ( txd, 181) end end end addEventHandler("onClientResourceStart",resourceRoot, ReplaceSkin)
  8. I want this sound to play only in the cities that are there.But even when I enter las venturas or los santos, the sound does not stop.can someone help me ? cities = { ["Bone County"] = true, ["Red County"] = true, ["Tierra Robada"] = true, ["Flint County"] = true, ["Whetstone"] = true, } function change_weather() local x,y,z = getElementPosition(localPlayer) local city = getZoneName(x,y,z, true) if cities[city] then local sound = playSound("ambiance.mp3",true) else stopSound (sound) end end setTimer(change_weather, 1000, 1)
  9. hi guys, All of my codes are working,except removeEventHandler.What should ı do to remove the video on screen ? I'am really stuck on it.thanks for helps. function getB() loadBrowserURL(source, "https://www.youtube.com/") end addEventHandler("onClientGUIClick",root, function () local browser = guiCreateBrowser(0, 0, 1, 300, false, false, true, bbas) local theBrowser = guiGetBrowser(browser) if source == youbutton then addEventHandler("onClientBrowserCreated", theBrowser,getB) guiSetEnabled ( youbutton, false ) guiSetEnabled ( googlebutton, false ) elseif source == stopbutton then removeEventHandler("onClientBrowserCreated", theBrowser,getB) guiSetEnabled ( youbutton, true ) guiSetEnabled ( googlebutton,true) end end)
  10. Hello MTA World, I prepared something so that the wanted level can be seen on the player's head.but with these codes, I have to have a wanted level to see the text on the head of the player.but I don't want this.I want everyone to see whoever has a wanted level.so what's wrong here? addEventHandler( "onClientRender",root, function( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for k, player in pairs(getElementsByType("player",root, true)) do if(player ~= localPlayer) then local level = getPlayerWantedLevel ( player ) if ( level > 0 ) then tx, ty, tz = getElementPosition( player ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( player, 6 ) local x,y = getScreenFromWorldPosition( sx, sy, sz +0.7 ) if (x) then dxDrawText( "WANTED ["..level.."]", x-34, y+1, x+1, y+1, tocolor(0,0,0), 0.85 + ( 15 - dist ) * 0.030, "default-bold" ) dxDrawText( "WANTED ["..level.."]", x-35, y, x, y, tocolor(250,250,0), 0.85 + ( 15 - dist ) * 0.030, "default-bold" ) end end end end end end end )
  11. it works when I use this event as onPlayerWasted.but the player does not teleport while login.am i using a wrong event? local warps = { { 2,2577.3100585938, -1329.7434082031, 1058.2553710938 }, { 2,2573.6740722656, -1353.0935058594, 1058.2553710938 }, { 2,2581.5959472656, -1343.3308105469, 1054.0562744141 } } addEventHandler( "onPlayerLogin", getRootElement( ), function() local rnd = math.random( 1, #warps ) local level = getPlayerWantedLevel ( source ) if ( level == 1 ) then setPedWeaponSlot ( source, 0 ) fadeCamera(source,false, 1.0) setTimer(fadeCamera, 1000, 1,source,true) setTimer ( setElementInterior, 1000, 1, source, warps[rnd][1], warps[rnd][2], warps[rnd][3], warps[rnd][4], warps[rnd][5], warps[rnd][6], warps[rnd][7], warps[rnd][8] ) triggerClientEvent(source, "jailTime1", source) setTimer(function(freeman) if isElement(freeman) then fadeCamera(freeman,false, 1.0) setTimer(fadeCamera, 1000, 1,freeman,true) setTimer (setElementPosition, 1000, 1, freeman, 1803.2666015625, -1575.6591796875, 13.408905029297 ) setElementInterior ( freeman, 0 ) setPlayerWantedLevel ( freeman, 0 ) end end,1000*20,1,source) end end )
  12. ı wrote something.everything works good.When the player goes to jail for the second time, time comes down and doesn't work.we can remove the jail time text with removeEventHandler when the player gets out of jail, but countdown is still working.and when the player goes to jail for the second time, a bug occurs in countdown.How can I restart the time as the player goes back to prison? I'm really stuck.can you help me please? thanks. local start = getTickCount() local countDown = 20 function render() local now = getTickCount() if now-start > 1000 then countDown = countDown-1 start = getTickCount() if countDown < 1 then removeEventHandler("onClientRender",root,render) end end end function convertTime ( time ) local min = math.floor ( time / 60 ) local sec = ( time %60 ) return string.format("%02d:%02d", min, sec) end addEvent ( "jailTime1", true ) addEventHandler ( "jailTime1", root, function ( ) addEventHandler("onClientRender",root,render) addEventHandler("onClientRender",root,jailText) render() setTimer(function() removeEventHandler("onClientRender",root,jailText) end, 20000, 1) end ) local screenW, screenH = guiGetScreenSize() local refx,refy = 1920,1080 function jailText() dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2+2)/refx),screenH*((refy/2+54)/refy),_,_, tocolor(0,0,0), screenH*(1.7/refy), "bankgothic", "center", "center", false, true, false, true, false) dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2)/refx),screenH*((refy/2+55)/refy),_,_, tocolor(200,200,200), screenH*(1.7/refy), "bankgothic", "center", "center", false, true, false, true, false) dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2+2)/refx),screenH*((refy/2+94+2)/refy),_,_, tocolor(0,0,0), screenH*(0.9/refy), "bankgothic", "center", "center", false, true, false, true, false) dxDrawText("Time out of jail: "..convertTime(countDown).."",screenW*((refx/2)/refx),screenH*((refy/2+95)/refy),_,_, tocolor(200,200,200), screenH*(0.9/refy), "bankgothic", "center", "center", false, true, false, true, false) end
  13. I want to save the player wanted level, but it doesn't work.can someone help me ? thanks. function onQuit() local acc = getPlayerAccount(source) if not isGuestAccount(acc) then local wantedLevel = getPlayerWantedLevel (source) setAccountData(acc, "wlevel", wantedLevel) end end addEventHandler("onPlayerQuit", getRootElement(), onQuit) function onLogin(_, acc) local acc = getPlayerAccount(source) local wantedLevel = getAccountData(acc, "wlevel") setTimer (setPlayerWantedLevel,500,1,acc,wantedLevel) end addEventHandler("onPlayerLogin", getRootElement(), onLogin)
  14. The sound still does not play when I enter the cities.what's wrong ? can someone help? cities = { ["Bone County"] = true, ["Tierra Robada"] = true, } addEventHandler('onClientResourceStart', localPlayer, function () local x,y,z = getElementPosition(localPlayer) local city = getZoneName(x,y,z, true) if cities[city] then playSound("sound.mp3",true) end end )
  15. Hello, I'm trying to add text on the ped.everything is good.text appears but when I approach the ped, the error comes from debug. ERROR :[Resources]\missionsped\client.Lua:199: attempt to perform arithmetic on local 'sy' (a nil value) How can ı solve this problem ? function pedText() local x, y, z = getElementPosition( dealer ) --ped position local x2, y2, z2 = getElementPosition(localPlayer) --player position local yakinlas = getDistanceBetweenPoints3D(x,y,z, x2, y2, z2) if yakinlas < 4 then local x2, y2, z2 = getElementPosition(localPlayer) lcal sx, sy = getScreenFromWorldPosition(x, y, z+0.9, 0.06) local yakinlas = getDistanceBetweenPoints3D(x,y,z, x2, y2, z2) local yaziboyut = 0.9 dxDrawText ( "Drug Dealer" , sx, sy - 30, sx, sy - 30, tocolor(255,255,255), math.min ( 0.3*(150/yakinlas)*1.4,1.3 - (0.5 + math.sin(math.rad(getTickCount())) / 3) / 12) * yaziboyut, "default-bold", "center", "bottom", false, false, false, true ) end end --end addEventHandler("onClientRender", root, pedText)
  16. Hi all ı want add explosion to helmet zombie.his skin number 44.ı tried with createExplosion (x,y,z, 0) but its not worked.its more important for us please help.what can ı do ? thanks .. function zombiedamaged ( attacker, weapon, bodypart ) if getElementType ( source ) == "ped" then if (getElementData (source, "zombie") == true) then if ( bodypart == 9 ) then helmeted = "no" local zskin = getElementModel ( source ) for k, skin in pairs( helmetzombies ) do if skin == zskin then helmeted = "yes" end end if helmeted == "no" then triggerServerEvent ("headboom", source, source, attacker, weapon, bodypart ) end end end end end addEventHandler ( "onClientPedDamage", getRootElement(), zombiedamaged )
  17. How can I turn a texture ON and OFF with just one command?Texture needs to be active when they enter the server.This is what confuses me. addEventHandler('onClientResourceStart', resourceRoot, function() shader = dxCreateShader('shader.fx') terrain = dxCreateTexture('img/road.jpg') dxSetShaderValue(shader, 'gTexture', terrain) engineApplyShaderToWorldTexture(shader, 'cj_rubbish1') engineApplyShaderToWorldTexture(shader, 'sf_junction2') engineApplyShaderToWorldTexture(shader, ':Oroad01_law') engineApplyShaderToWorldTexture(shader, 'des_1line256') engineApplyShaderToWorldTexture(shader, 'concretebig4256128') end )
  18. Hello to everyone. I would appreciate it if friends with experience answer this topic.In the past a lot of people have opened the topic for a good host.but it's been over a lot of time and we really need help.It's hard to manage a server with zombies or peds.Because many players are getting poor performance from the server.(high ping or lowest level FPS) When we buy a host in Europe, it is a problem for players of the Americas.Likewise when we get a host from the continent of america, those in europe are having problems. Can an experienced friend recommend a good host company?Need a good company or a good location.If you have a really good suggestion, can you share with us? We will really be grateful.
  19. I tried a few more events but failed.I just want the health bar to appear when I "aim" on ped.Now health bar looks without aim with gun! how can ı really do that ?Please help someone? function pedHealthbar() for k, peds in pairs(getElementsByType("ped", root, true)) do if getElementData(peds, "type") == "Secur.ped" then target = getPedTarget(peds) if ( target ) then local recBar = dxDrawRectangle(sX+420, sY-600,150, 12, tocolor(0, 0, 0, 200)) local health = getElementHealth(peds) local lineLength = 144 * (health / 100) local healthBar = dxDrawRectangle(sX+423, sY-597,lineLength, 7, tocolor(46, 139, 87, 210)) dxDrawText("Security", sX+460, sY-627, sX+155, sY-19-(32*7), tocolor(0,0,0, 255), 1.6, font, "left", "top") dxDrawText("Security", sX+461.5, sY-625.5, sX+153.5, sY-17.5-(32*7), tocolor(255, 255, 255, 255), 1.6, font, "left", "top") end end end addEventHandler("onClientRender", root, pedHealthbar)
  20. Hi Forum,ı want to say that ı am new in scripting and now ı am starting to try element datas.ı want to add rank in scoreboard acording to the number of levels.ı know ı cant do the codes below.can someone give me an example how can ı do this ? ı just want to show it on the scoreboard.Thank you from now. exports.scoreboard:addScoreboardColumn('Rank') addEventHandler("onPlayerSpawn",root, function() if getElementData(source,"level") >= 1 then setElementData(source, "Rank", "test") elseif getElementData(source,"level") >= 5 then setElementData(source, "Rank", "test1") elseif getElementData(source,"level") >= 10 then setElementData(source, "Rank", "test2") elseif getElementData(source,"level") >= 15 then setElementData(source, "Rank", "test3") elseif getElementData(source,"level") >= 20 then setElementData(source, "Rank", "test4") elseif getElementData(source,"level") >= 25 then setElementData(source, "Rank", "test5") end end ) addEventHandler("onPlayerSpawn",root, function () local rank = getElementData(source,"level") if rank then setElementData(source,"Rank", rank) end end )
  21. local sX,sY = guiGetScreenSize() local sX,sY = sX*0.05,sY*0.95 font = "default-bold" function healthbar() local plr = localPlayer for k, pedsz in pairs(getElementsByType("ped", root, true)) do if getElementData(pedsz, "zombie") then target = getPedTarget(plr) if (not target) then return false end if (not getElementType(target) == "ped" ) then return false end if (not isElementOnScreen(pedsz)) then return false end dxDrawText("Zombie", sX+460, sY-627, sX+155, sY-19-(32*7), tocolor(0,0,0, 255), 1.5, font, "left", "top") dxDrawText("Zombie", sX+461.5, sY-625.5, sX+153.5, sY-17.5-(32*7), tocolor(204, 204, 204, 255), 1.5, font, "left", "top") local healthA = dxDrawRectangle(sX+420, sY-600,150, 12, tocolor(241, 236, 253, 114), false) local health = getElementHealth(pedsz) local lineLength = 100 * (health / 100) local healthB = dxDrawRectangle(sX+423, sY-597,lineLength, 7, tocolor(9, 172, 213, 254), false) end end end addEventHandler("onClientRender", root, healthbar) Hello All, its simple zombie health bar codes.dxDrawText and dxDrawRectangle look successful.but zombie is losing health but,health bar is doesnt go down sometimes even when ı aim at the zombies,health bar does not appear what can ı do for it ? Can my math. be wrong ?
  22. Hello, This is a simple rank tag on the players head.but how can ı destroy this tag when riding the vehicle ? this nametag needs to disappear while riding the vehicle.can someone help me ? addEventHandler( "onClientRender",root, function( ) local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for _, v in ipairs( getElementsByType 'player' ) do --if(player ~= localPlayer) then tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( v, 6 ) local x,y = getScreenFromWorldPosition( sx, sy, sz +1.5 ) if x then -- getScreenFromWorldPosition returns false if the point isn't on screen dxDrawLine3D ( sx, sy, sz+0.2,sx, sy, sz+1.35, tocolor ( 0, 210,0, 90 ), 1.45,false) dxDrawText( "Warrior", x-9.5, y, x, y, tocolor(0,210,0,150), 0.85 + ( 15 - dist ) * 0.035, "default-bold" ) end end end end end )
  23. O problema que estou enfrentado é que estou conseguindo criar um ped(pedestre), mas não estou conseguindo rotacioná-lo. ped = createPed( 20 , 1847.7277832031 , -1873.6942138672 , 13.578125 , 0.01, false) Obs.: o quinto argumento deve ser um número float, tentei colocar vários outros (do que está no acima), como 0.1, 0.13, 1.5, 1.932 e a rotação não acontece.
  24. ı downloaded gta 4 animations for my server but only local player see the animations.how can ı change local player to 'player'.ı didint put on serverside its not worked.anybody can help me ? local animTable = { ifp = {}, anims = { "abseil", "ARRESTgun", "ATM", "BIKE_elbowL", "BIKE_elbowR", "BIKE_fallR", "BIKE_fall_off", "BIKE_pickupL", "BIKE_pickupR", "BIKE_pullupL", "BIKE_pullupR", "bomber", "CAR_alignHI_LHS", "CAR_alignHI_RHS", "CAR_align_LHS", "CAR_align_RHS", "CAR_closedoorL_LHS", "DAM_armL_frmLT", "DAM_armR_frmBK", "DAM_armR_frmFT", "DAM_armR_frmRT", "DAM_LegL_frmBK", "SHOT_leftP", "SHOT_partial", "SHOT_partial_B", "SHOT_rightP", "Shove_Partial", "Smoke_in_car", "sprint_civi", "sprint_panic", "Sprint_Wuzi", "swat_run", "Swim_Tread", "Tap_hand", "Tap_handP", "turn_180", "Turn_L", "Turn_R", "WEAPON_crouch", "XPRESSscratch" } } addEventHandler("onClientResourceStart", resourceRoot, function() animTable.ifp["block"] = "ped" animTable.ifp["ifp"] = engineLoadIFP("ped.ifp", animTable.ifp["block"]) for _, v in ipairs(animTable.anims) do engineReplaceAnimation(localPlayer, "ped", v, animTable.ifp["block"], v) end end )
  25. I want to add name of the 'car owner' on the car.ı maked some codes but not working.my car shop resource owner element data is "owner" but still ı cant add dx tag name on the car.can someone help me ? maybe ı cant see my mistakes. local fontP = dxCreateFont( "normal.ttf", 20 ) local SX,SY = guiGetScreenSize() local px,py = 1366,768 local sx,sy = (SX/px), (SY/py) function drawCarTags() for k, veh in pairs(getElementsByType("vehicle", resourceRoot, true)) do local cx, cy, cz, lx, ly, lz = getCameraMatrix() local px, py, pz = getElementPosition(veh) local dist = getDistanceBetweenPoints3D(cx, cy, cz, px, py, pz) if dist < 60 then if( isLineOfSightClear(cx, cy, cz, px, py, pz, true, false, false) ) then local x, y = getScreenFromWorldPosition (px, py, pz + 1) if(x and y) then local owner = getElementData(veh, "owner") if (owner and getPlayerFromName(owner)) then local h = dxGetFontHeight(sy*0.8, fontP) local w = dxGetTextWidth(owner, sy*0.8, fontP) dxDrawText(owner, x - w / 2, y + h*-2, w, h, tocolor(getPlayerNametagColor(getPlayerFromName(owner))), sy*0.8, fontP) end end end end end end addEventHandler("onClientRender", root, drawCarTags)
×
×
  • Create New...