Feche1320 Posted December 24, 2010 Share Posted December 24, 2010 I'm new into this, and I've got this problem: [2010-12-23 22:13:17] WARNING: race\tt.lua:4: Bad argument @ 'getPedOccupiedVehicle' [2010-12-23 22:13:17] WARNING: race\tt.lua:4: Bad argument @ 'getVehicleName' [2010-12-23 22:13:17] WARNING: race\tt.lua:4: Bad argument @ 'getVehicleModelFromName' Here is the code: addEvent( "onPlayerPickUpRacePickup", true ) function onPlayerPickUpRacePickup(pickupID,pickupType,vehicleModel) if pickupType == "vehiclechange" and vehicleModel == 425 then car_id = getVehicleModelFromName(getVehicleName(getPedOccupiedVehicle(getPlayerName(source)))) if car_id ~= 425 then outputChatBox(getPlayerName(source).." got the hunter!") outputChatBox("#38ff06Disabling Ghostmode in 10 seconds...") setTimer(gmoff, 10000, 1) g_SToptimesManager:playerFinished( source, exports.race:getTimePassed()) gmoff() end end end addEventHandler( "onPlayerPickUpRacePickup", getRootElement(), onPlayerPickUpRacePickup) I did try to solve it my self, but nothing.. Thanks Link to comment
12p Posted December 24, 2010 Share Posted December 24, 2010 addEvent( "onPlayerPickUpRacePickup", true ) function onPlayerPickUpRacePickup(pickupID,pickupType,vehicleModel) if pickupType == "vehiclechange" and vehicleModel == 425 then car_id = getVehicleModelFromName(getVehicleName(getPedOccupiedVehicle(source))) --getPlayerName is a string, not a ped element! if car_id ~= 425 then outputChatBox(getPlayerName(source).." got the hunter!") outputChatBox("#38ff06Disabling Ghostmode in 10 seconds...") setTimer(gmoff, 10000, 1) g_SToptimesManager:playerFinished( source, exports.race:getTimePassed()) gmoff() end end end addEventHandler( "onPlayerPickUpRacePickup", getRootElement(), onPlayerPickUpRacePickup) Link to comment
Feche1320 Posted December 24, 2010 Author Share Posted December 24, 2010 I did try that, but it doesn't work, it doesn't output the "blabla got the hunter!", any ideas? Thanks Link to comment
Aibo Posted December 24, 2010 Share Posted December 24, 2010 addEvent( "onPlayerPickUpRacePickup", true ) function onPlayerPickUpRacePickup(pickupID,pickupType,vehicleModel) if pickupType == "vehiclechange" and vehicleModel == 425 then outputChatBox(getPlayerName(source).." got the hunter!") outputChatBox("#38ff06Disabling Ghostmode in 10 seconds...") setTimer(gmoff, 10000, 1) g_SToptimesManager:playerFinished( source, exports.race:getTimePassed()) -- gmoff() -- you already have a timer for this end end addEventHandler( "onPlayerPickUpRacePickup", getRootElement(), onPlayerPickUpRacePickup) 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