Spajk Posted April 1, 2012 Share 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 Link to comment
TAPL Posted April 1, 2012 Share Posted April 1, 2012 everything looks fine, maybe the fire has gone lol try restart the resource and look at the ped Link to comment
Spajk Posted April 1, 2012 Author Share Posted April 1, 2012 done that, there's no fire at all Link to comment
Jaysds1 Posted April 1, 2012 Share 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 ) Link to comment
TAPL Posted April 1, 2012 Share 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) Link to comment
Spajk Posted April 1, 2012 Author Share Posted April 1, 2012 doesn't work with timer, but works client side, thanks Link to comment
Jaysds1 Posted April 1, 2012 Share Posted April 1, 2012 doesn't work with timer, but works client side, thanks np Link to comment
Kenix Posted April 1, 2012 Share 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!! Link to comment
DNL291 Posted April 1, 2012 Share Posted April 1, 2012 and this is wrong oncientResourceStart Link to comment
Kenix Posted April 1, 2012 Share Posted April 1, 2012 Lua is case sensitive!! I already say about this. Also i colored it. Link to comment
Jaysds1 Posted April 1, 2012 Share Posted April 1, 2012 lol, srry, my wireless keyboard needs to charge. Link to comment
Khtsjefen Posted April 1, 2012 Share 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! 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