Jump to content

Shagwrath

Members
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Shagwrath's Achievements

Square

Square (6/54)

0

Reputation

  1. Oh man I really hope this gets added, I found these functions on accident on the wiki and I would love them to fix the issue i have modding the dynamic objects.
  2. local allowedWeapons = { [33] = true, [34] = true, }; addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), function() for i,v in ipairs(getElementsByType("vehicle")) do setVehicleFuelTankExplodable(v,false); end end ); addEventHandler("onClientPlayerWeaponFire",getLocalPlayer(), function(weapon,ammo,ammoInClip,hX,hY,hZ,hitElement) if hX and hY and hZ then if hitElement then if getElementType(hitElement) == "vehicle" then if allowedWeapons[weapon] == true then setVehicleFuelTankExplodable(hitElement,true); else setVehicleFuelTankExplodable(hitElement,false); end end end end end ); I tried some things and finally got it to work, so yah, now I feel dumb. I wouldn't have thought that setting the fuel tank explodable after it was shot would work, but now I know. So if anyone else has wondered this, or wants the code, here's the solution.
  3. I'd like to make a script which detects if a player has shot a car's gas tank with a sniper rifle, and then blows it up if so. I've been searching for a way to detect if a specific component of the car was shot, but I haven't been able to find anything useful, any thoughts on how to do this? I could finish the script from there, but this part has baffled me for awhile. Thanks, any help will be greatly appreciated
  4. tested and working. thanks guys makes a lot more sense to me now function intHelveteLights() local s = 2 local yP = 2411 m_1 = createMarker(2564.4,yP,23.3, "corona",s,0,0,255,255) m_4 = createMarker(2571.4,yP,23.3, "corona",s,0,0,255,255) m_7 = createMarker(2578.4,yP,23.3, "corona",s,0,0,255,255) m_10 = createMarker(2585,yP,23.3, "corona",s,0,0,255,255) m_13 = createMarker(2592.4,yP,23.3,"corona",s,0,0,255,255) m_16 = createMarker(2599,yP,23.3, "corona",s,0,0,255,255) m_2 = createMarker(2566.4,yP,23.3, "corona",s,255,0,0,255) m_5 = createMarker(2573.4,yP,23.3, "corona",s,255,0,0,255) m_8 = createMarker(2580.4,yP,23.3, "corona",s,255,0,0,255) m_11 = createMarker(2587,yP,23.3, "corona",s,255,0,0,255) m_14 = createMarker(2594.4,yP,23.3,"corona",s,255,0,0,255) m_17 = createMarker(2601,yP,23.3, "corona",s,255,0,0,255) m_3 = createMarker(2568.4,yP,23.3, "corona",s,0,255,0,255) m_6 = createMarker(2575.4,yP,23.3, "corona",s,0,255,0,255) m_9 = createMarker(2582.4,yP,23.3, "corona",s,0,255,0,255) m_12 = createMarker(2589,yP,23.3, "corona",s,0,255,0,255) m_15 = createMarker(2596.4,yP,23.3,"corona",s,0,255,0,255) m_18 = createMarker(2603,yP,23.3, "corona",s,0,255,0,255) e_1 = createMarker(2581.3,2409.7,35.1, "corona",s,255,0,0,255) e_2 = createMarker(2585.3,2409.7,35.1, "corona",s,255,0,0,255) local tier1 = { [m_1] = true, [m_4] = true, [m_7] = true, [m_10] = true, [m_13] = true, [m_16] = true } local tier2 = { [m_2] = true, [m_5] = true, [m_8] = true, [m_11] = true, [m_14] = true, [m_17] = true } local tier3 = { [m_3] = true, [m_6] = true, [m_9] = true, [m_12] = true, [m_15] = true, [m_18] = true } helveteStageLights = setTimer( function() local a = 255 randCol = math.random(1,10) if randCol == 1 then --RED-- for v in pairs ( tier1 and tier2 and tier3 ) do setMarkerColor(v,255,0,0,a) end for v in pairs ( tier2 ) do setMarkerColor(v,255,0,0,a) end for v in pairs ( tier3 ) do setMarkerColor(v,255,0,0,a) end elseif randCol == 2 then --GREEN-- for v in pairs ( tier1 ) do setMarkerColor(v,0,255,0,a) end for v in pairs ( tier2 ) do setMarkerColor(v,0,255,0,a) end for v in pairs ( tier3 ) do setMarkerColor(v,0,255,0,a) end elseif randCol == 3 then --BLUE-- for v in pairs ( tier1 ) do setMarkerColor(v,0,0,255,a) end for v in pairs ( tier2 ) do setMarkerColor(v,0,0,255,a) end for v in pairs ( tier3 ) do setMarkerColor(v,0,0,255,a) end elseif randCol == 4 then --HELVETE-- for v in pairs ( tier1 ) do setMarkerColor(v,0,102,107,a) end for v in pairs ( tier2 ) do setMarkerColor(v,0,102,107,a) end for v in pairs ( tier3 ) do setMarkerColor(v,0,102,107,a) end elseif randCol == 5 then --YELLOW-- for v in pairs ( tier1 ) do setMarkerColor(v,255,255,0,a) end for v in pairs ( tier2 ) do setMarkerColor(v,255,255,0,a) end for v in pairs ( tier3 ) do setMarkerColor(v,255,255,0,a) end elseif randCol == 6 then --WHITE-- for v in pairs ( tier1 ) do setMarkerColor(v,255,255,255,a) end for v in pairs ( tier2 ) do setMarkerColor(v,255,255,255,a) end for v in pairs ( tier3 ) do setMarkerColor(v,255,255,255,a) end elseif randCol == 7 then --2 TONE 1-- red/blue/red for v in pairs ( tier1 ) do setMarkerColor(v,255,0,0,a) end for v in pairs ( tier2 ) do setMarkerColor(v,0,255,0,a) end for v in pairs ( tier3 ) do setMarkerColor(v,0,0,255,a) end elseif randCol == 8 then --2 TONE 2-- yellow/green/yellow for v in pairs ( tier1 ) do setMarkerColor(v,255,255,0,a) end for v in pairs ( tier2 ) do setMarkerColor(v,0,255,0,a) end for v in pairs ( tier3 ) do setMarkerColor(v,255,255,0,a) end elseif randCol == 9 then --3 TONE 1-- red/green/blue for v in pairs ( tier1 ) do setMarkerColor(v,255,0,0,a) end for v in pairs ( tier2 ) do setMarkerColor(v,0,255,0,a) end for v in pairs ( tier3 ) do setMarkerColor(v,0,0,255,a) end elseif randCol == 10 then --3 TONE 2-- yellow/pink/? for v in pairs ( tier1 ) do setMarkerColor(v,255,255,0,a) end for v in pairs ( tier2 ) do setMarkerColor(v,255,0,255,a) end for v in pairs ( tier3 ) do setMarkerColor(v,0,255,255,a) end end end,1000,0) end addEventHandler("onResourceStart",getRootElement(),intHelveteLights)
  5. Ive been trying this and i get an error saying "bad argument #1 to 'ipairs'(table expected, got nil)" for i,v in ipairs(tier1) do setMarkerColor(v,255,0,0,a) end i still don't get what I'm doing wrong
  6. My script seems simple, but i'm under a size restraint so i'm trying to do the code as clean and efficient as possible. Anyways I have 18 markers, split into 3 tables, and im trying to set the color of all the markers in the table with setMarkerColor. Here's my script: server.lua function intHelveteLights() local s = 2 local yP = 2411 m_1 = createMarker(2564.4,yP,23.3, "corona",s,0,0,255,255) m_4 = createMarker(2571.4,yP,23.3, "corona",s,0,0,255,255) m_7 = createMarker(2578.4,yP,23.3, "corona",s,0,0,255,255) m_10 = createMarker(2585,yP,23.3, "corona",s,0,0,255,255) m_13 = createMarker(2592.4,yP,23.3,"corona",s,0,0,255,255) m_16 = createMarker(2599,yP,23.3, "corona",s,0,0,255,255) m_2 = createMarker(2566.4,yP,23.3, "corona",s,255,0,0,255) m_5 = createMarker(2573.4,yP,23.3, "corona",s,255,0,0,255) m_8 = createMarker(2580.4,yP,23.3, "corona",s,255,0,0,255) m_11 = createMarker(2587,yP,23.3, "corona",s,255,0,0,255) m_14 = createMarker(2594.4,yP,23.3,"corona",s,255,0,0,255) m_17 = createMarker(2601,yP,23.3, "corona",s,255,0,0,255) m_3 = createMarker(2568.4,yP,23.3, "corona",s,0,255,0,255) m_6 = createMarker(2575.4,yP,23.3, "corona",s,0,255,0,255) m_9 = createMarker(2582.4,yP,23.3, "corona",s,0,255,0,255) m_12 = createMarker(2589,yP,23.3, "corona",s,0,255,0,255) m_15 = createMarker(2596.4,yP,23.3,"corona",s,0,255,0,255) m_18 = createMarker(2603,yP,23.3, "corona",s,0,255,0,255) e_1 = createMarker(2581.3,2409.7,35.1, "corona",s,255,0,0,255) e_2 = createMarker(2585.3,2409.7,35.1, "corona",s,255,0,0,255) tier1 = { {m_1}, {m_4}, {m_7}, {m_10}, {m_13}, {m_16} } tier2 = { {m_2}, {m_5}, {m_8}, {m_11}, {m_14}, {m_17} } tier3 = { {m_3}, {m_6}, {m_9}, {m_12}, {m_15}, {m_18} } helveteStageLights = setTimer( function(tier1,tier2,tier3) local a = 255 randCol = math.random(1,10) outputChatBox("randCol: "..randCol) if randCol == 1 then --RED-- setMarkerColor(tier1,255,0,0,a) setMarkerColor(tier2,255,0,0,a) setMarkerColor(tier3,255,0,0,a) elseif randCol == 2 then --GREEN-- setMarkerColor(tier1,0,255,0,a) setMarkerColor(tier2,0,255,0,a) setMarkerColor(tier3,0,255,0,a) elseif randCol == 3 then --BLUE-- setMarkerColor(tier1,0,0,255,a) setMarkerColor(tier2,0,0,255,a) setMarkerColor(tier3,0,0,255,a) elseif randCol == 4 then --HELVETE-- setMarkerColor(tier1,0,102,107,a) setMarkerColor(tier2,0,102,107,a) setMarkerColor(tier3,0,102,107,a) elseif randCol == 5 then --YELLOW-- setMarkerColor(tier1,255,255,0,a) setMarkerColor(tier2,255,255,0,a) setMarkerColor(tier3,255,255,0,a) elseif randCol == 6 then --WHITE-- setMarkerColor(tier1,255,255,255,a) setMarkerColor(tier2,255,255,255,a) setMarkerColor(tier3,255,255,255,a) elseif randCol == 7 then --2 TONE 1-- red/blue/red setMarkerColor(tier1,255,0,0,a) setMarkerColor(tier2,0,0,255,a) setMarkerColor(tier3,255,0,0,a) elseif randCol == 8 then --2 TONE 2-- yellow/green/yellow setMarkerColor(tier1,255,255,0,a) setMarkerColor(tier2,0,255,0,a) setMarkerColor(tier3,255,255,0,a) elseif randCol == 9 then --3 TONE 1-- red/green/blue setMarkerColor(tier1,255,0,0,a) setMarkerColor(tier2,0,255,0,a) setMarkerColor(tier3,0,0,255,a) elseif randCol == 10 then --3 TONE 2-- yellow/pink/? setMarkerColor(tier1,255,255,0,a) setMarkerColor(tier2,255,0,255,a) setMarkerColor(tier3,0,255,255,a) end end,1000,0) end addEventHandler("onResourceStart",getRootElement(),intHelveteLights) any help would be greatly appreciated. Thanks!
  7. Ya that totally works. I guess I fired my brain the last few days, cause that was such a simple mistake. Thanks tim.
  8. I made a custom object, textured and exported from 3dsmax with Kam's Gta Scripts, The texture and the mesh both show, however, when I export the collision (.col) and load all 3 onto my server as a resource, no collision can be made with the object. I've used colleditior 2 and Kam's Gta Scripts to try to make the col, and view it, and it appears to exist should work but it does not: here's how I've scripted the resource, and ill also include the .col .txd. and .dff client.lua function resourceStart() txd = engineLoadTXD("materials/island.txd") engineImportTXD (txd,1337) col = engineLoadCOL("meshes/island.col") dff = engineLoadDFF("meshes/island.dff",1337) engineReplaceModel(dff,1337) engineSetModelLODDistance(1337,300) end If anyone has any ideas or help I would REALLY appreciate it, kinda stuck and exhausted youtube and google FILES: http://mta.bobogames.net/
  9. thanks for your response, my code works already though. What I'm trying asking is how can playerA hit playerB and make a sound that both playerA and playerB can hear
  10. So I have a custom dff and txd I've loaded onto the poolcue weapon, My plan is to trigger a client side sound at the position of the ELEMENT or PLAYER when it is hit, and only when an element or player is hit. to explain it another way, the guitar will have a custom sound play at the coordinates of the hit, and only when it is hitting an element or player I've spent a lot of time looking through the scripting wiki forums and browsing through here, and haven found anything helpful yet, so any pointing in the right direction would be a help, you don't have the write the code for me lol client.lua dff = engineLoadDFF("client/poolcue.dff",338 ) engineReplaceModel(dff,338) txd = engineLoadTXD("client/poolcue.txd",false) engineImportTXD(txd,338) function guitarDamage(thePlayer,weapon,bodypart) if (weapon == 7) then local x,y,z = getElementPosition(getLocalPlayer()) local sound = playSound3D("client/guitar_1.wav", x,y,z) outputChatBox("YOU GOT HIT",getLocalPlayer()) end end addEventHandler("onClientPlayerDamage",getLocalPlayer(),guitarDamage) meta.xml <meta> <info author="Shagwrath"/> <script src="client.lua" type="client"/> <script src="server.lua" type="server"/> <file src="client/poolcue.dff"/> <file src="client/poolcue.txd"/> <file src="client/guitar_1.wav"/> </meta>
  11. I've been trying to figure out, is it possible to download resources, specifically meaning clientside files, after a player logs in. My greater goal is to make a 'mod panel' where a player can enable and disable skin/weapon mods etc. after they have spawned and are playing. Thanks for any help in advance
×
×
  • Create New...