Jump to content

Xeonmeister

Members
  • Posts

    35
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Xeonmeister's Achievements

Rat

Rat (9/54)

0

Reputation

  1. 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)
  2. How are you going to do it otherwise?
  3. 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.
  4. setCameraTarget: "This function allows you to set a player's camera to follow other elements instead. Currently supported element type is: Players"
  5. 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)
  6. 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).
  7. 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.
  8. 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?
  9. Could you then please post a screenshot of a player at the maximum visible range?
  10. 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.
  11. 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.
  12. 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
  13. 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.
  14. 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...
×
×
  • Create New...