Spajk Posted April 1, 2012 Posted April 1, 2012 I made a simple script that should put a ped on fire, but it doesn't work the code: function pedLoad ( name ) local ped = createPed ( 120, 0, 0, 6) if( ped ) then local result = setPedOnFire( ped, true ) if( result ) then outputChatBox("good") else outputChatBox("bad2") end else outputChatBox("bad1") end end addEventHandler ( "onResourceStart", getResourceRootElement(), pedLoad ) ss: http://img684.imageshack.us/img684/7470 ... 165954.png
TAPL Posted April 1, 2012 Posted April 1, 2012 everything looks fine, maybe the fire has gone lol try restart the resource and look at the ped
Jaysds1 Posted April 1, 2012 Posted April 1, 2012 try this: function pedLoad ( name ) local ped = createPed ( 120, 0, 0, 6) if( ped ) then local result = setPedOnFire( ped, true ) if( result ) then outputChatBox("good") else outputChatBox("bad2") end else outputChatBox("bad1") end end addEventHandler ( "oncientResourceStart", resourceRoot, pedLoad ) My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
TAPL Posted April 1, 2012 Posted April 1, 2012 done that, there's no fire at all mmmmm, try use setTimer maybe work function pedLoad() local ped = createPed(120, 0, 0, 6) setTimer(setPedOnFire,1000,1,ped,true) end addEventHandler("onResourceStart", resourceRoot, pedLoad)
Spajk Posted April 1, 2012 Author Posted April 1, 2012 doesn't work with timer, but works client side, thanks
Jaysds1 Posted April 1, 2012 Posted April 1, 2012 doesn't work with timer, but works client side, thanks np My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Kenix Posted April 1, 2012 Posted April 1, 2012 try this:function pedLoad ( name ) local ped = createPed ( 120, 0, 0, 6) if( ped ) then local result = setPedOnFire( ped, true ) if( result ) then outputChatBox("good") else outputChatBox("bad2") end else outputChatBox("bad1") end end addEventHandler ( "[color=#800000]oncientResourceStart[/color]", resourceRoot, pedLoad ) Lua is case sensitive!! http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
DNL291 Posted April 1, 2012 Posted April 1, 2012 and this is wrong oncientResourceStart Please do not PM me with scripting related question nor support, use the forums instead.
Kenix Posted April 1, 2012 Posted April 1, 2012 Lua is case sensitive!! I already say about this. Also i colored it. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Jaysds1 Posted April 1, 2012 Posted April 1, 2012 lol, srry, my wireless keyboard needs to charge. My in-game name: Jaysds1 Retired CMG Scripter World Of Tanks GameMode (Open-Source): https://github.com/Jaysds1/mtasa-wot-gamemode Online GUI-Editor (WIP): https://forum.mtasa.com/topic/47678-online-gui-editor/
Khtsjefen Posted April 1, 2012 Posted April 1, 2012 function burn(commandName, theSize) if theSize then local x, y, z = getElementPosition(getLocalPlayer()) createFire(x, y, z, theSize) outputChatBox("Burn, buuuuurn >:]") else outputChatBox("Syntax: /fire ") end end addCommandHandler("fire", burn) From the wiki - It makes a fire at your location, so it basicly does the same if nothing else is working for you. Client side only!
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