Dice Posted March 20, 2013 Share Posted March 20, 2013 addEventHandler( "onPlayerWasted", getRootElement(), function( totalammo, killer, killerWeapon, bodypart ) if isElementWithinColShape ( source, arena ) then local detection = isElementWithinColShape ( source, arena ) local detectionKiller = isElementWithinColShape ( killer, arena ) if detection then if close == 1 then local dx, dy, dz = unpack(randspawn[math.random(#randspawn)]) setTimer( setElementPosition, 4550, 1, source, dx, dy, dz ) setTimer ( setElementHealth, 1000, 6, source, 200 ) else setTimer( setElementPosition, 4550, 1, source, 577.92224121094, -2621.6677246094, 1378.0678710938 ) setTimer ( setElementRotation, 4550, 1, source, 0, 0, 180 ) end if detectionKiller then if getElementHealth ( killer ) < 200 and getElementHealth ( killer ) > 1 then setElementHealth ( killer, 200 ) elseif isPedDead ( killer ) then local dx, dy, dz = unpack(randspawn[math.random(#randspawn)]) setTimer( setElementPosition, 4550, 1, killer, dx, dy, dz ) end end end end end ) There is a bug where when someone kills each other their screen is stuck moving up ( which is part of gta when someone dies ) but I just want to prevent that. basically where you see this line elseif isPedDead ( killer ) notice how I didn't set the health there, because I think it has something to do when it sets the health when they are already dead. but rememeber it only happenes when someone kills each other at the same time. do i add elseif isPedDead ( source ) and isPedDead ( killer ) ? Link to comment
Moderators IIYAMA Posted March 20, 2013 Moderators Share Posted March 20, 2013 There is a bug where when someone kills each other their screen is stuck moving up ( which is part of gta when someone dies ) Prevent: syntax server: setCameraTarget ( player thePlayer [, element target = nil ] ) setCameraTarget (source) (source is player that died) You should read the wiki page better. https://wiki.multitheftauto.com/wiki/OnPlayerWasted Link to comment
Dice Posted March 20, 2013 Author Share Posted March 20, 2013 Yeah but the thing is they remain dead, so even if i do that they will just be on the ground dead, with the ability to move the camera around. Link to comment
Moderators IIYAMA Posted March 20, 2013 Moderators Share Posted March 20, 2013 What will happen when you spawn him and set him to another dimension? Well then you should try camera matrix, and that also means you have to create your own camera system. Btw: if --[[getElementHealth ( killer ) < 200 and]] getElementHealth ( killer ) > 1 then -- why check a player health a both the 200? max is 200, can't be higher. Link to comment
Dice Posted March 20, 2013 Author Share Posted March 20, 2013 No the camera isn't the problem. The issue was that they stayed in that state after the source dies when they killed each other at the same time. The answer is your BTW : idon't know why I did that. thanks for pointing that out. I think that is the issue for now. Link to comment
Moderators IIYAMA Posted March 20, 2013 Moderators Share Posted March 20, 2013 I don't get it. State? You mean they get forced to stand still and they aren't on the ground when you kill them? or you mean stop the kill when they kill each other and only the one who dies as last won't die? Well spawn the player instead of reset the health. (spawnPlayer) Link to comment
Anderl Posted March 20, 2013 Share Posted March 20, 2013 What happens is that when a player kills each other simultaneously, the player falls on the ground dead and the camera goes up (don't you know what happens when you die in Grand Theft Auto San Andreas?) but it doesn't respawn the player, the camera keeps going up and up. I think this was more clear than the OP's explanation. Link to comment
Dice Posted March 20, 2013 Author Share Posted March 20, 2013 (don't you know what happens when you die in Grand Theft Auto San Andreas?) i just said like in gta..... The issue is not the camera the issue is the player never spawns. yes I know spawnPlayer isn't in here but it is in another script. They just stay dead for ever even setCameraTarget won't work all that will do is set the camera around the dead body. anyways this is only happening when the play dies at the same time. but I think i have fixed it, i still need to test it out with someone. If it doesn't work I will come back or think something else. Link to comment
Anderl Posted March 20, 2013 Share Posted March 20, 2013 You wasted your time writing something when it was the same I wrote, you just didn't get it. Also, I was just explaining the problem because I saw that some people didn't understand. Link to comment
Dice Posted March 20, 2013 Author Share Posted March 20, 2013 Well it didn't work =\ when they both kill each other something causes them not to spawn Link to comment
Dice Posted March 21, 2013 Author Share Posted March 21, 2013 Never mind, It is not working anyone else? Link to comment
Anderl Posted March 21, 2013 Share Posted March 21, 2013 I don't think you can set the health of a dead player, you would need to use spawnPlayer. Link to comment
Moderators IIYAMA Posted March 21, 2013 Moderators Share Posted March 21, 2013 Well it is still unclear as hell for me.... What must happen? What must be Prevented? 1. 2. 3. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now