top sniper Posted March 10, 2012 Posted March 10, 2012 i toke this code from mtasa wiki function setFriendlyFireOn ( ) -- For each team, for index, theTeam in ipairs">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 ) but it didn't work ================================================================== ~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~ ==================================================================
Kenix Posted March 10, 2012 Posted March 10, 2012 function setFriendlyFireOn ( ) -- For each team, for index, theTeam in ipairs ( getElementsByType("team") ) do -- if friendly fire is off, if not getTeamFriendlyFire ( theTeam ) then -- switch it on. setTeamFriendlyFire ( theTeam, true ) end end end -- Add console command 'setFF' addCommandHandler ( "setFF", setFriendlyFireOn ) Show meta.xml too. for index, theTeam in ipairs">ipairs ( getElementsByType("team") ) do Forum syntax bug http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
drk Posted March 10, 2012 Posted March 10, 2012 (edited) addCommandHandler ( 'setFF', function ( ) for i, team in ipairs">ipairs ( getElementsByType ( 'team' ) ) do if ( getTeamFriendlyFire ( team ) == false ) then setTeamFriendlyFire ( team, true ) end end end ) Be sure that your script is server side in meta.xml. Edited March 10, 2012 by Guest EPT Team Server Development: 0% Learning C++ | C++ is amazing
X-SHADOW Posted March 10, 2012 Posted March 10, 2012 addCommandHandler ( 'setFF', function ( ) for i, team in ipairs">ipairs">ipairs ( getElementsByType ( 'team' ) ) do if ( getTeamFriendlyFire ( team ) == false ) then setTeamFriendlyFire ( team, true ) end end end ) Be sure that your script is server side in meta.xml. for i, team in ipairs">ipairs ( getElementsByType ( 'team' ) ) do synatx error My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
drk Posted March 10, 2012 Posted March 10, 2012 Forum php tag bug. EPT Team Server Development: 0% Learning C++ | C++ is amazing
X-SHADOW Posted March 10, 2012 Posted March 10, 2012 yes we should wait for administration to fix it lol My ingame nickname : Ops! -DeathMatch GameMode By Ops! : 5%
top sniper Posted March 10, 2012 Author Posted March 10, 2012 addEvent("spawn1",true) addEventHandler("spawn1",root, function() spawnPlayer ( source, 252, 1861, 9, 1, 0, 0, t) local redteam = getTeamFromName ( "F.B.I" ) if ( redteam ) then -- If it was found (not false) setPlayerTeam ( source, redteam ) setElementHealth ( source, 100 ) setPedArmor ( source, 20 ) giveWeapon ( source , 31,600 ) giveWeapon ( source , 25,500 ) giveWeapon ( source , 46 ) giveWeapon ( source , 16,5 ) setTeamFriendlyFire ( redteam, true ) end end ) even this not working ================================================================== ~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~ ==================================================================
drk Posted March 10, 2012 Posted March 10, 2012 addEvent("spawn1",true) addEventHandler("spawn1",root, function() spawnPlayer ( source, 252, 1861, 9, 1, 0, 0, t) local redteam = getTeamFromName ( "F.B.I" ) if ( redteam ) then setPlayerTeam ( source, redteam ) setElementHealth ( source, 100 ) setPedArmor ( source, 20 ) giveWeapon ( source , 31,600 ) giveWeapon ( source , 25,500 ) giveWeapon ( source , 46 ) giveWeapon ( source , 16,5 ) setTeamFriendlyFire ( redteam, true ) end end ) Where spawn1 event is called? EPT Team Server Development: 0% Learning C++ | C++ is amazing
top sniper Posted March 10, 2012 Author Posted March 10, 2012 addEvent("spawn1",true) addEventHandler("spawn1",root, function() spawnPlayer ( source, 252, 1861, 9, 1, 0, 0, t) local redteam = getTeamFromName ( "F.B.I" ) if ( redteam ) then setPlayerTeam ( source, redteam ) setElementHealth ( source, 100 ) setPedArmor ( source, 20 ) giveWeapon ( source , 31,600 ) giveWeapon ( source , 25,500 ) giveWeapon ( source , 46 ) giveWeapon ( source , 16,5 ) setTeamFriendlyFire ( redteam, true ) end end ) Where spawn1 event is called? I did not understand what you mean ================================================================== ~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~ ==================================================================
drk Posted March 10, 2012 Posted March 10, 2012 Event spawn1 isn't ever called. EPT Team Server Development: 0% Learning C++ | C++ is amazing
top sniper Posted March 10, 2012 Author Posted March 10, 2012 Event spawn1 isn't ever called. triggerServerEvent("spawn1",localPlayer) ================================================================== ~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~ ==================================================================
drk Posted March 10, 2012 Posted March 10, 2012 Show full code, client and server-side. EPT Team Server Development: 0% Learning C++ | C++ is amazing
top sniper Posted March 10, 2012 Author Posted March 10, 2012 the problem was i should change true to false to set it on !! ================================================================== ~|منٌ رأيّتُموِۂ يّعتُدُيّ على عرض فُتُٱة مؤمنٌة فُٱسًحًقَوِوِوِوِوِوِوِة|~ ==================================================================
TAPL Posted March 10, 2012 Posted March 10, 2012 spawnPlayer ( source, 252, 1861, 9, 1, 0, 0, t) t is not defined.
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