Jump to content

problem z friendlyfire


Recommended Posts

Witam wszystkich.Mozecie mi poswiecic chwile czasu?mam problem z dodaniem tzw.firendlyfire.Mam serwer,ktory sie cieszy jako taka popularnoscia,ale jak to bywa zdazaja sie tacy,co zabijaja kogo i co popadnie.Chciałem dodac uniemozliwienie zabijania gracza przez innego,ale mi jakos nie wyszło.Mozecie napisac jak to powinno byc napisane?Napisałem tak:

-- get a table with all teams

local allTeams = getElementsByType ( "team" )

-- for every team,

for index, theTeam in ipairs(allTeams) do

-- if friendly fire is off,

if ( getTeamFriendlyFire ( theTeam ) == false ) then

-- switch it on

setTeamFriendlyFire ( theTeam, true )

end

end

lub dałem tez tak:

function setFriendlyFireOn ( )

-- For each team,

for index, theTeam in ipairs ( getElementsByType("team") ) do

-- if friendly fire is off,

if ( getTeamFriendlyFire ( theTeam ) == false ) then

-- switch it on.

setTeamFriendlyFire ( theTeam, true )

end

end

end

-- Add console command 'setFF'

addCommandHandler ( "setFF", setFriendlyFireOn )

dałem to do jakiegos skryptu,zeby odpalało od razu,ale nie działa.Moze ktos napisac,jak to powinno byc?z gory THX

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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