
Xeonmeister
Members-
Posts
35 -
Joined
-
Last visited
Everything posted by Xeonmeister
-
So i just wanted to test things clientside and was trying to make some basic scripts, and this doesn't wanna run. I can't see why. Any suggestions? regen2 = {} hp2 = {} function sethp2(amount) setElementHealth(localPlayer, amount) hp2[localPlayer] = amount outputChatBox("sethp "..tostring(amount)) end addEventHandler("onClientPlayerWasted", root, function(killer, weapon, bodypart) if localPlayer == source then playSound("sounds/wasted.mp3") else if localPlayer == killer then playSound("sounds/kill.mp3") end end) function regen() if hp2[localPlayer] < 99 then sethp2(hp2[localPlayer]+1) if regen2[localPlayer] == true then setTimer(regen, 250, 1) end else sethp2(100) regen2[localPlayer] = false end end addEventHandler("onClientResourceStart", root, function() for i, v in ipairs(getElementsByType("object")) do engineSetModelLODDistance(getElementModel(v), 170) end end) addEventHandler("onClientPlayerSpawn", localPlayer, function() sethp2(100) regen2[localPlayer] = false end) addEventHandler("onClientPlayerWeaponFire", localPlayer, function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement, startX, startY, startZ) outputChatBox("hit: "..hitX..", "..hitY..", "..hitZ) outputChatBox(getDistanceBetweenPoints3D(hitX, hitY, hitZ, startX, startY, startZ).." meters.") outputChatBox(" ") end) addEventHandler("onClientPlayerDamage", localPlayer, function(attacker, weapon, bodypart, loss) hp2[localPlayer] = hp2[localPlayer]-loss if regen2[localPlayer] == false then regen2[localPlayer] = true regen() end end) addEventHandler("onClientPlayerQuit", localPlayer, function() regen2[localPlayer] = nil hp2[localPlayer] = nil end)
-
How are you going to do it otherwise?
-
I know but if u read it it says the problem is that you cannot set a vehicle as a camera target. So that s why you cannot do it. Edit: Maybe you can get a ped into that vehicle, set it s alpha to 0, so it looks like noone is driving. I don't know if u can use the setCameraTarget on peds though.
-
setCameraTarget: "This function allows you to set a player's camera to follow other elements instead. Currently supported element type is: Players"
-
Hello everyone! So i started to make a script which does the following: Basically it is a weapon sound system. It plays a normal sound for the player who shot, and plays a 3d sound for everone except the local player (who shot). It plays the normal sound fine, but the evenet is not triggered for everyone for some reason, however, it is triggered for the local player. Why isn't it triggered for everyone? addEventHandler("onClientPlayerWeaponFire", localPlayer, function(weapon, ammo, ammoInClip, hitX, hitY, hitZ, hitElement) local x, y, z = getElementPosition(localPlayer) local pplayer = localPlayer triggerEvent("weaponSound", getRootElement(), weapon, x, y, z, pplayer) playSound("sounds/"..weapon..".wav") end) addEvent("weaponSound", true) addEventHandler("weaponSound", getRootElement(), function(weapon, x, y, z, pplayer) if pplayer ~= localPlayer then local sound = playSound3D("sounds/"..weapon..".wav", x, y, z) setSoundMaxDistance(sound, 300) end end)
-
Hi! I'm looking for bodypart objects. I'm not talking about those which are currently in the default mta. I'm searching for a completely new object set. I'd need a: head, upper arms, lower arms, torso, upper legs, lower legs (not sure though if these are the correct names for them).
-
Yes of course but it would look stupid. If i attach an arm to the arm and a leg to the leg etc. and they move aswell (since they are attached to the bones) it would look like a low detail player model from far away. If i attach one single object to the player and let's say he crouches then that won't be visible so players would shoot the air above him. With objects attached to the bones it would be better i think.
-
Everything is maxed out but even 150m is very short compared to the bullet range which is set to 350m (the max). I was thinking about attaching objects to the bones so from far away it will look like a low lod player model. And with that i can just set the player's model's alpha to 0 and if the player comes closer i can set the alpha of the attached objects to 0 and make the original player model visible again. Do you think this is the best solution? Or do you guys have better ideas?
-
Can you upload a screenshot please?
-
Could you then please post a screenshot of a player at the maximum visible range?
-
It's just like players have a stream and a draw distance. And even if they had streamed in you cannot see them until you get closer.
-
My problem is that they are streamed in but i cannot see them from a distance, however, they are stremed in. I cannot say it any more clearly just try it on a local server if u don t understand me. That s why i want to attach an elemnt to it or maybe draw the outlines or something.
-
Yes i've seen that before and i'm sorry that i make a disappointment but it didn't solve my problem. However, it works perfectly but my problem is that the players stream in anyways in about a 200 meters range, but i cannot see them from like 80 meters away - unless i zoom at them. So that's why i want to attach an object to them or something (that s why i opened this topic so you maybe can come up with a better solution). It's because if i set the snipers range to the maximum (350 meters) but you can only see players (without zooming at them) from 80 meters or closer it's just not that good, since sniping should be enjoyable from far away. Hope you can help me
-
Hi! I've been trying to do this for ages but i failed. The only idea i came up with is that i need to attach an object or objects to the player that is only visible for others. As i know the player models disappear after like 80 meters but they are shootable up to like ~200-250 meters. If i attach an object to the player others will see it so they can shoot even if the original player model disappeared. My question is what should i attach? Are there any bodypart objects? Or do you have a better idea to increase the player models visible distance? I need this because i want to make a shooter/freeroam server and with the current distance you need to go very near other players to see them and snipers are just so ineffective since you cannot spot anyone in sniping distances.
-
Hi! I wanted to make custom weapon sounds but the sound doesn't play... addEventHandler("onClientPlayerWeaponFire", root, function(weapon) if localPlayer == source then if weapon == 34 then playSound("sounds/sniper"..getElementData(source, "sniper")..".wav") else playSound("sounds/"..weapon..".wav) end else local x, y, z = getElementPosition(source) if weapon == 34 then local sdata = getElementData(source, "sniper") local sound = playSound3D("sounds/sniper"..sdata..".wav", x, y, z) setSoundMaxDistance(sound, wsdistance[sdata]) else playSound3D("sounds/"..weapon..".wav", x, y, z) setSoundMaxDistance(sound, wsdistance[weapon]) end end end) A little explanation: If it's the player who shot, then the sound will be played for him with playSound, because with long sounds if he moves away after the shot he can hear the sound from the spot where he was before. However, others are usually away so this is not a problem for them. That's why i use playSound3D for them, because i want them to hear where the shot came from. My problem is that the sound doesn't play. wsdistance is defined and i have the sound, and it is succesfully added. I can even play it with a single command. Edit: Nevermind i found it out. If someone doesn't see it, you need to put a " after the .wav under the first else...
-
Hello! Could osmeone please explain the properties that i can set with setModelHandling? https://wiki.multitheftauto.com/wiki/SetModelHandling Here's the wiki page but there are lots of lines without comments and i don't really know what does what. I only need some properties to make some heavy tanks that are slow and powerful. I tried it but the problems are that my tank turns too fast - i want to make it reeeally slow - and when i reverse it's faster than going forward. I also would like to make them powerful - i mean that, however they are really slow, i want to make them able to climb slopes easily and do not slide back. Can you help me?
-
Thx for the help but i think you don t understand my second question. I want to set the draw distance of other players. Right now it's so low that if i and an other player stand on the top of the big garage in lv and we are on the opposite sides we can't see each other. It's like ~150 meters. I'd like to change it to something like ~300-400 meters, but engineSetModelLODDistance doesn't seem to work with skin models.
-
Hello everyone! I have two simple questions: 1. How can i give the sniper rifle recoil? 2. Can i set a player's stream in/draw distance? If yes how?
-
Is it possible to check if i hit an object that...?
Xeonmeister replied to Xeonmeister's topic in Scripting
I found out that what i want is impossible but i ask it: Is it possible with the default world? I mean if an object is so far away that it doesn t have have collision. I can t do anything to it then right? -
Hi. Is it possible to check if i hit an object that has no collision? I tried 'processLineOfSight' but it seems not to detect whenever I shoot an object which has no collision.
-
I've managed to do it. I only needed to trigger a server event and bring a variable that contains the element of the player. From there i trigger a client event where that variable will be examined and if it s the player then the sound won t be played.
-
Hi! I've made a "play-sound-for-all" function and i'd like to know if it's possible not to play a sound for one player but for everyone else? So everyone will hear the sound except that one guy.
-
Yep, that was my first idea but txd workshop says "Floating point division by zero" when i try to add a transparent texture. Edit: I managed to add a transparent texture, but it's just black. Edit2: It was quite tricky but i managed to do it. For people who are intrested in the solution: You need to click on the properties of the texture and untick compressed. After that instert a transparent image (replace every single texture with a transparent image). Then you need to make a picture (i'm not sure if it must be the same size but i used the same size) which is black. Then you click on the properties of each texture again and check "alpha is used" and write there a name. Write the same name to every texture. After this you name your black picture the same and insert it next to the other textures. If u did it right you won't see anything. If u did it wrong you'll see a white object.
-
Hi! My question is: Is that possible to remove the model of an original weapon or make it transparent?
-
Hi! First of all, sorry for asking stupid things like this. I just can't understand how to trigger an event and give parameters. For example i wanted to try to make a clientside command, where i get the player's coordinates and trigger a server event which puts the coordinates out in the chat. How can i keep the variables? Edit: Okay i do know now how to trigger a server event. But i'm in trouble trying to trigger a client event for everyone. Can anyone give me an example?