-
Posts
84 -
Joined
-
Last visited
Posts posted by pro-mos
-
-
Where's line 63 ?!?
and line 42:
setElementData ( thePlayer, "tempdata.ChkWeath", Wacc )- 1
-
50 minutes ago, koragg said:
I'm pretty sure every player has a different nos color cuz I'm using it at my server Maybe not in that particular file but that's the resource for sure.
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
-
8 minutes ago, koragg said:
Here you can see how the different nitro color works (if you wanna search around the resource a bit).
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.
-
3 hours ago, pa3ck said:
There are other components which can be changed on individual vehicles like paintjobs, rims, glass etc and that is when targetElement comes in to play.
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.
-
12 minutes ago, Psychotic_OZ said:
oh oops somehow i removed that but i cant get a car to spawn using the /greet
createvehicle is the command, not greet.
greet, in that case, is the command name. which is (greet = "createvehicle")
-
You need to bind an event to joinHandler function
addEventHandler ( "onPlayerJoin", root, joinHandler)
-
On 6/20/2017 at 04:28, MIKI785 said:
You can't. The nitro texture is global, it's not tied to vehicle elements. Hence you can't change it for only one vehicle, it's either all of them or none.
"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)
On 6/20/2017 at 19:24, Hale said:What would be the best way to create custom nitro colors for everyone then? My first thought was to create marker but that'd look ugly as hell, there must be a better way.
did you find an alternative?
-
11 minutes ago, ccw said:
Get the latest versions:
Thanks a lot, i wonder if i should use both mods together?
-
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?
-
OnPlayerJoin, SpawnPlayer, CreateVehicle, WarpPedIntoVehicle
use these resources
-
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)
-
this is easy to do if you're good in HTML and CSS3 and createBrowser
-
The metatable was causing the issue, removed it and now it works and one script.
-
16 minutes ago, Bonsai said:
What do you mean with "reload two scripts"?
If you make it a seperate resource that only handles script loading there shouldn't be any problems, and I assume its safer too.
Also, that script back then was pretty messy.
And very important, don't use that for server side scripts.
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
-
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)
-
-
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
-
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
- 1
-
4 hours ago, MIKI785 said:
Ok then. But just a bit of advice, dont use triggerClientEvent to transfer large amount of data as it could stall the server. Use triggerLatentClientEvent instead.
i tried this latent event now, and it seems a lot slower than the normal triggerClientEvent, i've tested it on local server
-
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
-
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.
-
11 minutes ago, MIKI785 said:
Obviously you have to finish downloading them before you run the dx functions. How do you actually download them?
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.
-
9 minutes ago, xyzii said:
Yes, use <file src="filename.type"/> in meta
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
-
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
[RELEASE] Rewind script
in Resources
Posted · Edited by pro-mos
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