-
Posts
6,097 -
Joined
-
Last visited
-
Days Won
218
Everything posted by IIYAMA
-
How can i check if object has hitted by projectile ?
IIYAMA replied to iMr.WiFi..!'s topic in Scripting
The processLineOfSight function would give you some information about it. https://wiki.multitheftauto.com/wiki/ProcessLineOfSight It works just fine, I use it to detonate a rocket projectile. It doesn't matter if the object is serverside or clientside, because an serverside object is visible on clientside and a projectile is only available clientside. (Maybe I do not understand your question.) -
Afaik the only damage the rhino can receive(on GTA LEVEL) is collision damage and fire damage. The rest of the damage you have to overwrite with onClientPlayerWeaponFire and onClientExplosion.
-
function getTeamDataFromName (name) for i=1, #TeamTable do if TeamTable[i][1] == name then return TeamTable[i] end end return false end Usage: local teamName = getTeamName(playerTeam) if teamName then local teamData = getTeamDataFromName (teamName) -- returns the sub-table if successfull, else false. if teamData then -- do your thing end end There are more ways to do this.
-
@kieran Oh and one last thing: bool addEvent ( string eventName [, bool allowRemoteTrigger = false ] ) If you use the addEvent function, you can allow and disallow triggers from different sides(client/server) TRUE = enabled I recommend you to add this function to the resource where you are also triggering from, because if you trigger an event which isn't added yet, you would receive warnings.
-
local x, y, z = getElementPosition( robmarker1 ) if x == 3099.97 and y == -3281.69 and z == -0.5 then
-
There is no triggerEvent for changing team. All triggerEvents are global, so that is already happening. It just depends how and under which element you add the handler.
-
1. @Bonus Names like 1_7_0 are a remaining of a decompiled script. Because when a script is compiled all variables names are lost. A decompiler will assign names like that to make it work again.
-
@xeon17 It is a kind of addiction, except for the wasting part. I am well aware that I shouldn't. If you had some lessons around ethical, you would know what I am talking about. Because it is a very common addiction and most of the time overlooked. Yet, everybody has this addiction. With other words: the feeling of being needed.
-
local prices = {["Beagle"] = 300, ["Shamal"] = 30,["Dodo"] = 0, ["Nevada"] = 1000, ["Crop Dustler"] = 2435, ["Stuntplane"] = 3435} iprint(prices["Dodo"]) -- price: 0 (I don't pay for dead stuff)
-
addCommandHandler("refreshres",function(source) local resources = getResources() local oldResources = {} for i,v in ipairs(resources) do if getResourceState(v) ~= "failed to load" then oldResources[v] = true end end refreshResources(true) local resources = getResources() local newResources = {} for i,v in ipairs(resources) do if not oldResources[v] and getResourceState(v) ~= "failed to load" then newResources[#newResources + 1] = v end end iprint(newResources) outputChatBox("NewResource loaded: Here is the last resource name which loaded.", source, 255, 255,255,true) end) You might need to set a timer before you re-check the resources again. (not sure because I never tried it)
-
setElementData(player,"Helmet", { {id="notSpecial", amount, armor}, {id="stupid", 999, -10000}, {id="IIYAMA", 1, 1000000000000000000} } ) setElementData(player,"Helmet", { notSpecial = { amount, armor}, stupid = {999, -10000}, IIYAMA = {1, 1000000000000000000} } )
-
function generatePassword () local passwordLength = math.random(4) -- 1 t/m 4 local password = "" for i=1, passwordLength do password = password .. (math.random(10) - 1) -- 0 t/m 9 end return password end local passwordForGate = generatePassword() iprint(passwordForGate) addCommandHandler("hack", function (player, CMD, password) if password == passwordForGate then iprint("correct password") else iprint("wrong password") end end) This is just a sample. Not ready for a dynamic gate system. You should start with writing and preparing your gate script first. Because it has to be one thing. I can't help you any further, if you do not have your body/main/core code ready for integrating the password system.
- 5 replies
-
- 1
-
-
- random numbers
- randomgates
-
(and 1 more)
Tagged with:
-
https://wiki.multitheftauto.com/wiki/OnClientPreRender dt is the timeslice. Read the wiki. It is the delay/time between the frames, created ONLY by the onClientPreRender If you have 60 fps. The timeslice is around: 1000(1sec) / 60 = 16,666666666666667 ms.
-
@Professional You may want to reply. It is not @Professional...
-
@tommymaster You may want to reply.
-
Yea, thought you missed something in your explanation. You can try to check with getElementMatrix. But I can't help you getting rotations from rotation offsets of matrices, too much for me.
-
True But fixing a warning/error = less lagg. It always helps in a way.
-
I don't think so, because the timer is used to destroy elements, when the ped/player element is destroyed/(leaves the server). But you can test it if you want to be 100% sure. Just increase the timer duration to 50 ms and see if the delay still exist. (don't forget to change back, because 50 ms can lagg)
-
You can't.
-
What has position in your case to do with rotation? If you have 2 positions, then it would be something else. getElementRotation
