golanu21 Posted March 3, 2013 Posted March 3, 2013 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!
Wei Posted March 3, 2013 Posted March 3, 2013 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)
K4stic Posted March 3, 2013 Posted March 3, 2013 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)
Wei Posted March 3, 2013 Posted March 3, 2013 You're welcome P.S. SKIPPER you script can not work because secund parameter is seat not the vehicle. OnVehicleExit
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