Jump to content

ShayF

Members
  • Posts

    43
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by ShayF

  1. Using predefined variables would dramatically decrease your code size. for getResourceRootElement() just use resourceRoot, its a predefined variable that is the resource root, and for getRootElement() just use root, which is a predefined variable for the root element. --This addEventHandler('onClientRender',getRootElement(),function() end) addEventHandler('onResourceStart',getResourceRoot(getThisResource()),function() end) -- vs this, what i'm talking about addEventHandler('onClientRender',root,function() end) addEventHandler('onResourceStart',resourceRoot,function() end)
  2. setElementFrozen(localPlayer,true)
  3. ShayF

    Map

    I plan on making a roleplay server, very similar to gta online. In fact that's what I'm naming the gamemode. I really want a specific map in the server, hence why I am here. I need a specific person to help me with this. His name is CodyL. He's famous for converting gta sa maps to mta. That's exactly what i need done in order to progress. This is the map I want.
  4. I made this simple script for freeroam servers. This lets you change the color of a players vehicle. Either with command or gui. I hope you enjoy (Server-sided only! NOT TESTED!) server.lua - local command = 'vehcolor' function vehColor(element,_,r,g,b) if getElementType(element) == 'player' then local v = getPedOccupiedVehicle(element) if v then if getVehicleOccupant(v,0) == element then vehicle = v end end elseif getElementType(element) == 'vehicle' then vehicle = element end if vehicle then if r then if g then if b then if tonumber(b) then setVehicleColor(vehicle,tonumber(r),tonumber(g),tonumber(b)) end else if tonumber(g) then setVehicleColor(vehicle,tonumber(r),tonumber(g),0) end end else if tonumber(r) then setVehicleColor(vehicle,tonumber(r),0,0) end end else setVehicleColor(vehicle,0,0,0) end end end addEvent('setVehicleColor',true) addEventHandler('setVehicleColor',root,vehColor) addCommandHandler(command,vehColor) --[[ Event Triggers triggerEvent('setVehicleColor',root,vehicle,_,r,g,b) triggerServerEvent('setVehicleColor',root,vehicle,_,r,g,b) triggerEvent('setVehicleColor',root,player,_,r,g,b) triggerServerEvent('setVehicleColor',root,player,_,r,g,b) ]]
  5. ShayF

    Help

    Contact me on any method I provided, I will consider helping you.
  6. ShayF

    Help

    Would you help me make this phone?
  7. ShayF

    Help

    My name is Shaio Fencski, I'm 16 years old, I live in the United States. I've been scripting on MTA for about 5 years, I'm decently good. I would like to form a scripting team. Anyone willing to join in, I am starting a project, making a Mobile phone for MTA. This phone is better than any other in MTA. I'll list below the planned functions for the phone. I'll give my Contact Information Below.
  8. Never Mind, I made the script. Enjoy. https://community.multitheftauto.com/index.php?p=resources&s=details&id=14183
  9. I'm trying to change the color of a vehicle upgrade object. ID: 1001, name: spl_b_bab_m.dff. TXD not present. This is a spoiler. It changes the alpha and shade. However it only seems to toggle between white/grey and black. I need help with this. client.lua addEventHandler('onClientResourceStart',resourceRoot,function() shader = dxCreateShader('shader.fx',0,0,false,'object') setTimer(function() for i,v in pairs(getElementsByType('vehicle')) do if isElementStreamedIn(v) then local r,g,b = getVehicleColor(v) local a = getElementAlpha(v) dxSetShaderValue(shader,"red",(tonumber(r)/255)) dxSetShaderValue(shader,"green",(tonumber(g)/255)) dxSetShaderValue(shader,"blue",(tonumber(b)/255)) dxSetShaderValue(shader,"alpha",(tonumber(a)/255)) for _,attached in ipairs(getAttachedElements(v)) do local model = getElementModel(attached) if (model == 1001) then engineApplyShaderToWorldTexture(shader,'*',attached) end end end end end,50,0) end) shader.fx float red; float green; float blue; float alpha; technique simple { pass P0 { MaterialAmbient = float4(red,green,blue,alpha); } } meta.xml <meta> <script src="client.lua" type="client"/> <file src="shader.fx"/> <file src="mta-helper.fx"/> </meta> Alpha Change Shades Change (Normal is black)
×
×
  • Create New...