Jump to content

Co-op


Guest Spedmonds

Recommended Posts

  • 2 months later...

it wouldnt be to hard to acript so that u have teams and u have to go round and kill the other teams :?::idea: if they done it like games like swat 4 with red team and blue teams then ur always gonna get the annoying team killers

Link to comment

i dont no. i havnt played the new mta because it is only the race version i dont like tha i like where u can get out of the ar and murder other players

Link to comment
="50p So there is anty team kill feature.

personally i think that would be to hard to script because it would require teking the damage out of the shots if they hit there own team and making them affect the other team but that would be dam hard to script

Link to comment
="50p So there is anty team kill feature.

personally i think that would be to hard to script because it would require teking the damage out of the shots if they hit there own team and making them affect the other team but that would be dam hard to script

But what if damage is scripted in the first place (i.e. a method that overrides default damage) :idea: ? This code fragment was taken from the KotH tutorial.

[lua]

addEventHandler ( "onPlayerDamage", getRootElement(), "kothDamage" )

function kothDamage ( attacker, weapon, bodypart, loss )

local damage = loss * 1.25

local hpLeft = getPlayerHealth ( source ) - damage

if ( hpLeft > 0 ) then

if ( bodypart == 9 ) then

killPlayer ( source, attacker, weapon, bodypart )

else

setPlayerHealth ( source, hpLeft )

end

else

killPlayer ( source, attacker, weapon, bodypart )

end

end

end

[/lua]

You have a source that triggered the event and the attacker. All you have to do now is check if source and attacker are in the same team. If not, take damage...otherwise do nothing. Still think it's difficult to script :lol: ?

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...