Jump to content

help


golanu21

Recommended Posts

function giveMoney(thePlayer) 
    local vehicle = getPedOccupiedVehicle (thePlayer) 
    local id = getElementModel(vehicle) 
    if id == 431 or 437 then 
        local gpm = getElementData(thePlayer, "buszp") 
        if ((gpm) > 0 ) then 
            givePlayerMoney(thePlayer, tonumber(gpm)) 
            outputChatBox("Ai castigat " .. gpm .. "$", thePlayer, 0, 140, 240) 
            setElementData(thePlayer, "buszp", 0) 
        end 
    end 
end 
addEventHandler("onVehicleExit", rootElement, giveMoney) 
addEventHandler("onPlayerQuit", rootElement, giveMoney) 

[12:45:09] WARNING: Gamemode\busjob\busjob.lua:3: Bad argument @ 'getElementModel' [Expected element at argument 1, got boolean] 
Ai fost angajat ca Bus Driver! 

Link to comment
function giveMoney(thePlayer) 
    local id = getElementModel(source) 
    if id == 431 or 437 then 
        local gpm = getElementData(thePlayer, "buszp") 
        if ((gpm) > 0 ) then 
            givePlayerMoney(thePlayer, tonumber(gpm)) 
            outputChatBox("Ai castigat " .. gpm .. "$", thePlayer, 0, 140, 240) 
            setElementData(thePlayer, "buszp", 0) 
        end 
    end 
end 
addEventHandler("onVehicleExit", rootElement, giveMoney) 
  

Link to comment

try this

function giveMoney ( thePlayer, thevehicle ) 
    local id = getElementModel ( thevehicle ) 
    if id == 431 or 437 then 
        local gpm = getElementData ( thePlayer, "buszp" ) 
        if ((gpm) > 0 ) then 
            givePlayerMoney ( thePlayer, tonumber( gpm ) ) 
            outputChatBox ( "Ai castigat " .. gpm .. "$", thePlayer, 0, 140, 240 ) 
            setElementData ( thePlayer, "buszp", 0 ) 
        end 
    end 
end 
addEventHandler("onVehicleExit", rootElement, giveMoney) 
addEventHandler("onPlayerQuit", rootElement, giveMoney) 

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