side Posted July 15, 2018 Share Posted July 15, 2018 Hello, I have a server and I would like to use a spawn by Groups I want the clan members to be able to activate and deactivate this spawn with a command. If you can help me, I thank you --------------------------------------------------------------------------------------------------------------------------- local GroupName = 'KILLERS' function onWasted () if getElementData(source,'Group') == 'KILLERS' then setTimer( function (source) setElementDimension( source, 0 ) setElementPosition( source, 2478.705078125+math.random(1,1), -1685.421875+math.random(1,1), 13.5078125 ) setElementInterior( source, 0 ) setPedArmor ( source, 100) setPedFightingStyle ( source, 5) end, 1000, 1, source) end end addEventHandler ( "onPlayerSpawn", getRootElement(), onWasted ) Link to comment
shdjjhdshjsd2 Posted July 16, 2018 Share Posted July 16, 2018 active = false local GroupName = 'KILLERS' function turned() if active == false then outputChatBox("Spawn enabled") active=true break else then outputChatBox("Spawn UnEnabled") active =false break end end addCommandHandler("spawnturn", turned) function onWasted () if active == true then if getElementData(source,'Group') == 'KILLERS' then setTimer( function (source) setElementDimension( source, 0 ) setElementPosition( source, 2478.705078125+math.random(1,1), -1685.421875+math.random(1,1), 13.5078125 ) setElementInterior( source, 0 ) setPedArmor ( source, 100) setPedFightingStyle ( source, 5) end, 1000, 1, source) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), onWasted ) 1 Link to comment
DiGiTal Posted July 16, 2018 Share Posted July 16, 2018 ---- local GroupName = 'KILLERS' ---- function turnedON() active=true outputChatBox("Spawn enabled") end addCommandHandler("active", turnedON) function turnedOFF() active=false outputChatBox("Spawn disabled") end addCommandHandler("desactive", turnedOFF) function onWasted () if active == true then if getElementData(source,'Group') == 'KILLERS' then setTimer( function (source) setElementDimension( source, 0 ) setElementPosition( source, 2478.705078125+math.random(1,1), -1685.421875+math.random(1,1), 13.5078125 ) setElementInterior( source, 0 ) setPedArmor ( source, 100) setPedFightingStyle ( source, 5) end, 1000, 1, source) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), onWasted ) @side there were some errors 1 Link to comment
shdjjhdshjsd2 Posted July 16, 2018 Share Posted July 16, 2018 28 minutes ago, DiGiTal said: ---- local GroupName = 'KILLERS' ---- function turnedON() active=true outputChatBox("Spawn enabled") end addCommandHandler("active", turnedON) function turnedOFF() active=false outputChatBox("Spawn disabled") end addCommandHandler("desactive", turnedOFF) function onWasted () if active == true then if getElementData(source,'Group') == 'KILLERS' then setTimer( function (source) setElementDimension( source, 0 ) setElementPosition( source, 2478.705078125+math.random(1,1), -1685.421875+math.random(1,1), 13.5078125 ) setElementInterior( source, 0 ) setPedArmor ( source, 100) setPedFightingStyle ( source, 5) end, 1000, 1, source) end end end addEventHandler ( "onPlayerSpawn", getRootElement(), onWasted ) @ChudovND @side there were some errors What does the error contain? Link to comment
DiGiTal Posted July 17, 2018 Share Posted July 17, 2018 On 16/07/2018 at 17:24, shdjjhdshjsd2 said: What does the error contain? break is for loop else u musn't add then, "then" is for if Link to comment
side Posted July 18, 2018 Author Share Posted July 18, 2018 Digital, thank you very much for your help bro, I was very helpful 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