Jump to content

setPedOnFire problem


Spajk

Recommended Posts

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

Link to comment

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

Link to comment

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...