Jump to content

Problem with 'Bad Argument @'..


Feche1320

Recommended Posts

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

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