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 )
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
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!!
Kenix Posted April 1, 2012 Posted April 1, 2012 Lua is case sensitive!! I already say about this. Also i colored it.
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