Jump to content

onPlayerPickUpRacePickUp


Newbie

Recommended Posts

Try adding this at the top of the script:
addEvent ( "onPlayerPickUpRacePickUp", true  

Also, what is "onClientRender" doing in a server side script? this event is client side only.

addEvent ( "onPlayerPickUpRacePickUp", true  

Didnt helped

Link to comment
addEvent ( "onPlayerPickUpRacePickUp", true ) 
addEventHandler ( "onPlayerPickUpRacePickUp", getRootElement(), 
    function ( pickupID, pickupType, vehicleModel ) 
        if ( pickupType == "vehiclechange" ) then 
            loadVehicleColor ( source ) 
            outputChatBox ( "loadVehicleColor for ".. tostring ( getPlayerName ( source ) ) ) 
        end 
    end 
) 

Use that and see what it says when you take a pickup.

  • Like 1
Link to comment
addEvent ( "onPlayerPickUpRacePickUp", true ) 
addEventHandler ( "onPlayerPickUpRacePickUp", getRootElement(), 
    function ( pickupID, pickupType, vehicleModel ) 
        if ( pickupType == "vehiclechange" ) then 
            loadVehicleColor ( source ) 
            outputChatBox ( "loadVehicleColor for ".. tostring ( getPlayerName ( source ) ) ) 
        end 
    end 
) 

Use that and see what it says when you take a pickup.

Doesn't even output.. Looks like the onPlayerPickUpRacePickUp is not working -.-

Link to comment
  
    addEvent ( "onPlayerPickUpRacePickup", true ) 
    addEventHandler ( "onPlayerPickUpRacePickup", getRootElement(), 
        function ( pickupID, pickupType, vehicleModel ) 
            if ( pickupType == "vehiclechange" ) then 
                loadVehicleColor ( source ) 
                outputChatBox ( "loadVehicleColor for ".. tostring ( getPlayerName ( source ) ) ) 
            end 
        end 
  

Check this out.

)

Link to comment
  
    addEvent ( "onPlayerPickUpRacePickup", true ) 
    addEventHandler ( "onPlayerPickUpRacePickup", getRootElement(), 
        function ( pickupID, pickupType, vehicleModel ) 
            if ( pickupType == "vehiclechange" ) then 
                loadVehicleColor ( source ) 
                outputChatBox ( "loadVehicleColor for ".. tostring ( getPlayerName ( source ) ) ) 
            end 
        end 
  

Check this out.

)

Your code is same as Solid wrote. I tryed but still not works. PS you didn't added )

Link to comment

His code is different. He changed the event name to what it should be. Also remove the true from addEvent; it doesn't need remote trigger.

Here's the line that triggers the event in race_server.lua from the race gamemode:

triggerEvent('onPlayerPickUpRacePickup', source, pickupID, pickup.type, pickup.vehicle) 

If you haven't tried WhoAmI's code then try it, but remove the true from addEvent. Like this:

  
    addEvent ( "onPlayerPickUpRacePickup" ) 
    addEventHandler ( "onPlayerPickUpRacePickup", getRootElement(), 
        function ( pickupID, pickupType, vehicleModel ) 
            if ( pickupType == "vehiclechange" ) then 
                loadVehicleColor ( source ) 
                outputChatBox ( "loadVehicleColor for ".. tostring ( getPlayerName ( source ) ) ) 
            end 
        end 
  

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