Jump to content

setPedOnFire problem


Spajk

Recommended Posts

Posted

I made a simple script that should put a ped on fire, but it doesn't work :S

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

Posted

everything looks fine, maybe the fire has gone lol

try restart the resource and look at the ped

CiTLh.png
Posted

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/

 

sE5Qm.png

TiV3C.png

img.php?id=0&text=Lua%20Scripter

Posted
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) 

CiTLh.png
Posted
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.

Posted

and this is wrong

oncientResourceStart 

Please do not PM me with scripting related question nor support, use the forums instead.

Posted
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! :P

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...