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