mrjackniko Posted May 7, 2016 Share Posted May 7, 2016 Hello. I have a problem with tdma script. Me and my friends are going to play tdma on lan tommorow, but the problem is with vehicles. When a vehicle explodes with players inside it, scores don't update. I tried to add few lines, but it doesn't change anything, despite there are no errors shown. Here is the script: function xonPlayerWasted ( ammo, attacker, weapon, bodypart ) if ( xonPlayerWasted_Enabled ) then local vTeamID = getElementData ( source, "tdma.teamid" ) local vTeam = gameTeams[vTeamID] if not ( vTeam ) then setTimer ( firstSpawn, 3000, 1, source, vTeam ) else local a = setTimer ( respawnThePlayer, 3000, 1, source, vTeam ) if not ( a ) then respawnThePlayer ( source, vTeam ) end end if ( attacker ) then local pTeamID = getElementData ( attacker, "tdma.teamid" ) local pTeam = gameTeams[pTeamID] --Was it a self kill? if ( source ~= attacker and vTeamID ~= pTeamID ) then if ( pTeam ) then updateKills ( attacker, pTeam ) end end end ----THIS IS THE PART I ADDED----- if ( weapon == 63 ) then local TeamOne = gameTeams[1] local TeamTwo = gameTeams[2] outputChatBox ( "#FF0000First #FF0000part #FF0000works", getRootElement(), 255, 255, 255, true ) if ( vTeamID == TeamOne ) then updateKills ( teamTwo ) outputChatBox ( "#FF0000Second #FF0000part #FF0000works", getRootElement(), 255, 255, 255, true ) end if ( vTeamID == TeamTwo ) then updateKills ( teamOne ) outputChatBox ( "#FF0000Second #FF0000part #FF0000works", getRootElement(), 255, 255, 255, true ) end end end end addEventHandler ( "onPlayerWasted", root, xonPlayerWasted ) (I added these chat boxes just to test to see if it works) Link to comment
ViRuZGamiing Posted May 7, 2016 Share Posted May 7, 2016 I've quickly tested the onPlayerWasted with a output and it seems that killer returns false. So this would prevent it, if ( attacker ) then Not 100% sure since I tested by crashing my own car and not being killed by anyone else. Link to comment
mrjackniko Posted May 7, 2016 Author Share Posted May 7, 2016 Ok, so I tried and it doesn't work.I think the problem is somewhere with ( vTeamID == TeamOne) etc. I believe something else should be written. When I test it, I get the message in chat "First part works", but not "Second part works". I assume that means that everything works until the part with (vTeam == TeamOne) then... 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