Jump to content

Captain Cody

Members
  • Posts

    2,753
  • Joined

  • Last visited

  • Days Won

    18

Everything posted by Captain Cody

  1. https://wiki.multitheftauto.com/wiki/GetPlayerSerial https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery Put them to together
  2. He means to say you're in the wrong thread.
  3. On that mates client side use setSoundVolume(sound, 0) Sure there are plenty of other ways, I just found that first and it works.
  4. Anything I'm doing wrong here?
  5. Cough* Cough* Remove songs
  6. Well it appears the shader is being applied, but there's no color it's just pitch black.
  7. Here's code I have shader = dxCreateShader("shader.fx", 1000, 0, false) function shaders () local vehicles = getElementsByType ( "vehicle" ) for i,vehiclez in ipairs(vehicles) do outputDebugString("Vehicles Found") local modded = getElementData (vehiclez,"ModdedinTune") if modded == true then for i, aObjects in ipairs(getAttachedElements ( vehiclez )) do outputDebugString("Shaders added") local r, g, b = getVehicleColor ( vehiclez, true ) engineApplyShaderToWorldTexture(shader, "#emapjesterbody256",aObjects) engineApplyShaderToWorldTexture(shader, "vehiclegrunge256",aObjects) dxSetShaderValue(shader, "gColor", r, g, b, 255) end end end end
  8. "object" is not wrong, the object is assigned to a table earlier in the script.
  9. -- I tried the code, but it's not working, nothing is happening
  10. Ah ok, though local was just locked to that set function.
  11. That certainly works to, I just gave him bare bone one because he didn't even attempt.
  12. function rainbowbotches (playerSource) local theVehicle = getPedOccupiedVehicle ( playerSource ) thetimer = setTimer ( rainbow, 1000, 0, theVehicle ) end function rainbow (vehicle) local r, g, b = math.random( 255 ), math.random( 255 ), math.random( 255 ) setVehicleColor( vehicle, r, g, b ) end function rainbowstop () killTimer ( thetimer ) end addCommandHandler ( "rainbow", rainbowbotches ) addCommandHandler ( "stoprainbow", rainbowstop ) Pros = It may work Cons = Canceling may be an issue with multiple vehicles
  13. Found another way to do it-- But what I'm trying to do is making a mirror function for the fully customizational mod shop I'm working in that gets the id of the object in hand, then creates its opposite side version 'Side skirtL -> Side SkirtR'
  14. Title says it all, adding onto the object id integers returns nil local IdAA = getElementModel(selecteda["object"]) if IdAA ~= 1007 then local IdBB = IdAA + 1 elseif IdAA == 1007 then local IdBB = IdAA + 10 end local Objectbbb = createObject ( IdBB, x3,cy,cz, 0, 0, 0, true ) -- Debug says, expected number at argument 1, got nil -- And it seams if I remove the if statement and just do local Objectbbb = createObject ( IdAA+1, x3,cy,cz, 0, 0, 0, true ) It works, but then I cannot add the 10 for the other number
  15. Would I have to store the info of what has shaders in a table or something?
  16. But what about players who joined in after? Almost every every individual part needs to be colored to match the base vehicle. Looping through this would cause server to implode with enough people online.
  17. How would I get the texture name? Never mind about that. How would I go about making it load for every person, instead of the just the one who made it?
  18. Is there any way to set an objects color, currently working on a fully custom mod/tune shop for my server, but I cannot figure out how to change the color of the part 'If at all possible'.
  19. Converting it to string, then back to to number may work as IIYAMA stated, as the tostring will cut out any of the random numbers that lua is throwing in on it.
  20. Also want to use this https://wiki.multitheftauto.com/wiki/GetPlayerFromName
  21. There's an issue in general with lua that expands the number, messing with the final results.
  22. I meant to put world, just a typo, but get element rotation will work for what you need, make it so if the rotation is above a certain degree, use vy+1, if below vx+1. This may work, I have not done anything using the set rotation velocity function.
  23. Oh you want to set the rotation relative to the word? Why didn't you state that in the first place. Get the rotation then subtract the rotation you want to set from the actual Z-rotation Spin = ("spinyouwant"-zrotation) Then use that value, it will rotate the vehicle relative to the world rotation with your set amount. -- Might be a bit more then that, I just woke up and noticed what you wanted, minds not 100% --
×
×
  • Create New...