Jump to content

pro-mos

Members
  • Posts

    84
  • Joined

  • Last visited

Everything posted by pro-mos

  1. Hello, i found this script laying in my hard drive that i made back in 2017. Use L-Shift to rewind position. L+R Shift to speed up rewind. Have fun. https://community.multitheftauto.com/index.php?p=resources&s=details&id=16062
  2. Where's line 63 ?!? and line 42: setElementData ( thePlayer, "tempdata.ChkWeath", Wacc )
  3. here's the nitro shader script: https://github.com/JarnoVgr/Mr.Green-MTA-Resources/blob/master/resources/[gameplay]/-shaders-nitro/client.lua it doesn't have targetElement argument in engineApplyShaderToWorldTexture
  4. I took a look at it, it uses same nitro color for every vehicle. I have an idea to use `createEffect` with shaders, i wonder if that will work, will probably try later.
  5. The thing is there's servers that use custom under-vehicle neon, and custom nitro colors which is unique for each player, it just confuses me.
  6. createvehicle is the command, not greet. greet, in that case, is the command name. which is (greet = "createvehicle")
  7. You need to bind an event to joinHandler function addEventHandler ( "onPlayerJoin", root, joinHandler)
  8. "smoke" and "shad_car" also can't be tied to one vehicle as i've tried and failed. But what's the point of `targetElement` then ?! engineApplyShaderToWorldTexture ( shader, textureName [, element targetElement) did you find an alternative?
  9. Thanks a lot, i wonder if i should use both mods together?
  10. Im trying to use ultra thing mod, but it doesn't work anymore, i think it worked before, but now it only works with normal GTA SA.exe i have the mod files in the GTA directory, and mta warns me about d3d9.dll file, but i press continue and no mod works... what could be the problem?
  11. OnPlayerJoin, SpawnPlayer, CreateVehicle, WarpPedIntoVehicle use these resources
  12. addEventHandler("onPlayerDamage",root, function(attacker, weapon) if getTeamName(getPlayerTeam(attacker)) ~= 'Civillian' then return end if weapon == 6 then setElementHealth(source, getElementHealth(source) - 50 ) end end)
  13. this is easy to do if you're good in HTML and CSS3 and createBrowser
  14. The metatable was causing the issue, removed it and now it works and one script.
  15. Hi i would like it to be on the same resource, so when im testing, i /restart only 1 resource, i tried to insert the modified functions into 'env' like env.addEventHandler = ... env.outputChatbox = ... everytime the environment is created. but that doesn't work
  16. I don't think function cook will ever be executed, since it's undefined in the scope of the addCommandHandler, cook should be next to the handler. function cook(...) -- do stuff end addCommandHandler("cookmeth", cook) but then, this would allow anyone to use the command, so do it like this: local playersInCookingTruck = {} function giveoptions( thePlayer, seat, jacked) if (getElementModel (source) == 508) then playersInCookingTruck[thePlayer] = true -- rest of the function ... end end addEventHandler('onVehicleEnter', root, giveoptions) then you check if player in cooking truck, in function cook function cook(player) if not playersInCookingTruck[player] then return end -- stop, dont do the code below -- check for inventory setElementFrozen(player, true) -- .... end For the timer, no, it wont wait until the timer is done to execute the code below it, if you want it to wait, then setTimer(function() -- after 18 seconds, do all this -- start client timer outputChatBox('You've got your meth', player) -- give him some meth end, 18000, 1)
  17. First, use onVehicleEnter handler and bind it to a function that does the checks like getElementModel (check if the vehicle id == 508) If yes, he can try to cook so do something like this canCook =[] canCook[player] = true Then, addCommandHandler that triggers the cooking if player can cook only If yes, check the inventory of the player. I assume you have an inventory system, if not, inventory = {} addCommandHandler('getStuff', function (player) inventory[player] = {} inventory[player]['Gas Can'] = 2 inventory[player]['Mask'] = 1 outputChatBox('You got some stuff', player, 255,255,255) ) Ok now you can check if a player has an item like this if inventory[player]['Gas Mask'] >= 2 and inventory[player]['Mask'] >= 1 then -- can cook -- triggerClientEvent todisplay a timer and on screen gui end
  18. pro-mos

    help

    addEventHandler("onResourceStart", resourceRoot, function () exports.scoreboard:scoreboardAddColumn('Vehicle:') end ) setTimer(function () local players = getElementsByType "player" for k, v in ipairs ( players ) do if ( isPedInVehicle(v) ) then local vehicle = getPedOccupiedVehicle(v) local carname = getVehicleName(vehicle) setElementData ( v, "Vehicle:", tostring(carname) ) else setElementData ( v, "Vehicle:", "On foot") end end end, 2500, 0) You had the function name wrong
  19. i tried this latent event now, and it seems a lot slower than the normal triggerClientEvent, i've tested it on local server
  20. I've edited bonsai's script wrapper and using it, it looks like this: local env = {} local _createObject = createObject local _setTimer = setTimer local _addEventHandler = addEventHandler outputChatBox = function() end triggerServerEvent = function() end createObject = function(...) local object = _createObject(...) setElementDimension(object, dimension) table.insert(wrapper.objects, object) return object end function newClientEnvironment() env = table.copy(_G, true) local metatable = { __index = function(self, index) return rawget(_G, index) end, __newindex = function(_G, index, value) rawset(_G, index, value) end } setmetatable(env, metatable) _outputChatBox('created new Environment') end and this is how a script is loaded: function loadScript(scriptData) local loaded = loadstring(scriptData) setfenv(loaded, env) local ex = pcall(loaded) end The problem is the functions re-defined above interfere with my main script that is using this wrapper. i can just use this wrapper as a separate script but then i'll have to reload two scripts rather than 1, and i dont want that. any ideas? and thank you for reading
  21. i use triggerClientEvent to send the files, and i write them with fileWrite, and then close the files with fileClose, the files are fine, i can see them downloaded in deathmatch/resources/script/cache/water.fx i think it might be a file path error, since im getting confused of how MTA's file path works EDIT: i've found the problem was the files download with a script and i try to use them with another script.. i've added ':scriptname' to the file path and now it works, sorry for your time.
  22. the server sends the file data and i write them client side with fileCreate('cache/'..filename) after creating and writing the file, i try to load it right away.
  23. But how? These files doesn't exist on starting the script, but they're downloaded when a new map starts. You see im trying to do a script loader
  24. addCommandHandler('paytoll', function(player) local x,y,z = getElementPosition(player) -- x2, y2, z2 = toll position local d = getDistanceBetweenPoints3D(x,y,z,x2,y2,z2) if d <= 50 then -- open toll end end) Something like this, sorry i wrote it on my phone
×
×
  • Create New...