Jump to content

friendy fire


Castillo

Recommended Posts

Posted

hey, i got a big problem i want to disable the friendy fire for all teams but dunno why my code isn't working, if someone

addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), 
function () 
local allTeams = getElementsByType ( "team" ) 
for index, theTeam in ipairs(allTeams) do 
        setTeamFriendlyFire ( theTeam, false ) 
    end 
end) 

thanks in advance.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

You have already created topic about this,

You didnt say if advice from this post was working or not (i mean, set FF to true)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

Do you even put the players into a team?

I never worked with teams before, but I guess that they have to be all in the same team in the first place so that they can't shoot each other.

lss_ad_banner.png
Posted
Do you even put the players into a team?

I never worked with teams before, but I guess that they have to be all in the same team in the first place so that they can't shoot each other.

what do you mean? i just start the resource and that should disable it, if it works like you say then its useless cause i don't want to restart resource every time.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

AFAIK players are in no team, when they join the server.

What you do is to say that players within a team can't kill each other.

But when the players are in no team, this has no effect on them.

So you should put all players into one team, this would be just one line in the "onPlayerJoin" event.

lss_ad_banner.png
Posted
AFAIK players are in no team, when they join the server.

What you do is to say that players within a team can't kill each other.

But when the players are in no team, this has no effect on them.

So you should put all players into one team, this would be just one line in the "onPlayerJoin" event.

I don't get what do you mean, my mode works like this, you join you got a menu with many teams and when you click on one and click button of spawn it spawns you.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

dont ignore my reply again :P

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
dont ignore my reply again :P

Sorry varez, i totally forgot about my old topic (i'm not lying)

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

sweet, but tell me if setting this to true is working maybe?

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
sweet, but tell me if setting this to true is working maybe?

if its true it means you can kill your team mates and false works but the problem is that it sets when it resource starts, maybe when player join would work too?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

and false works

so it works or not?

i dont get you now..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

and false works

so it works or not?

i dont get you now..

well i will test on public server tomorrow when i get more players :)

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

If you want to fully disable Friendly Fire, you should make this client-side and apply "onClientPreRender" event to set the friendly fire off all the time, or use setTimer function (if your script doesn't work, try it)...

Posted

if u want it to start when someone join then

addEventHandler("onPlayerJoin", getResourceRootElement(getThisResource()), 
function () 
local allTeams = getElementsByType ( "team" ) 
for index, theTeam in ipairs(allTeams) do 
        setTeamFriendlyFire ( theTeam, false ) 
    end 
end) 

replaced onResourceStart with onPlayerJoin

logo_left.png
Posted

nobody of you seems to understand (the last 2 persons) i have fixed it already, and what i wanted was to disable ALL teams friendy fire ;)

can close topic before it starts a fight :P

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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