Jump to content

Script wont work


AlphaMark

Recommended Posts

Hello guys. I was expanding an old script but now its not working.

function startJihad ( thePlayer, command ) 
        local theVehicle = getPedOccupiedVehicle ( thePlayer) 
        if (theVehicle == true) then 
            createExplosionForPlayer() 
                if (theVehicle == false) then 
                    outputChatBox ("You cant commit a Jihad in a vehicle!",thePlayer,255,0,0)    
                end 
        end 
end 
function createExplosionForPlayer ( thePlayer, command )  
        timer = setTimer ( createJihadForPlayer, 2500, 1, thePlayer, x, y, z ) 
        local triggeredClientEvent = triggerClientEvent ( "playTheSound", getRootElement(), thePlayer ) 
        setPedAnimation ( thePlayer, "BOMBER","BOM_Plant" ) 
end  
function createJihadForPlayer ( thePlayer, x, y, z ) 
    local theVehicle = getPedOccupiedVehicle ( thePlayer ) 
    local x, y, z = getElementPosition ( thePlayer ) 
    local createdExplosion = createExplosion ( x, y, z, 2 ) 
    local createdExplosion = createExplosion ( x, y, z, 3 ) 
    local createdExplosion = createExplosion ( x, y, z, 10 ) 
        if ( createdExplosion == true ) then 
        outputChatBox ( getPlayerName ( thePlayer ) .." comitted a Jihad!" ) 
    end 
end 
addCommandHandler ("jihad", startJihad) 

Link to comment

You define x, y, z 2 times in createJihadForPlayer (and in the timer there is none x y z)

What I think that should fix it is this:

timer = setTimer ( createJihadForPlayer, 2500, 1, thePlayer )

function createJihadForPlayer ( thePlayer )

Replace those lines with what I sayd and it should work.

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