Newbie Posted March 18, 2014 Share Posted March 18, 2014 (edited) Solved Edited March 19, 2014 by Guest Link to comment
Castillo Posted March 18, 2014 Share Posted March 18, 2014 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. Link to comment
Newbie Posted March 18, 2014 Author Share Posted March 18, 2014 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
cheez3d Posted March 18, 2014 Share Posted March 18, 2014 You forgot a pharanthesis at the end. addEvent("onPlayerPickUpRacePickup",true) Link to comment
Newbie Posted March 18, 2014 Author Share Posted March 18, 2014 You forgot a pharanthesis at the end. addEvent("onPlayerPickUpRacePickup",true) I dont. I did it. Why it doesn't work.. Link to comment
Castillo Posted March 18, 2014 Share Posted March 18, 2014 Any errors at the debugscript? Link to comment
Castillo Posted March 18, 2014 Share Posted March 18, 2014 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. 1 Link to comment
Newbie Posted March 19, 2014 Author Share Posted March 19, 2014 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
WhoAmI Posted March 19, 2014 Share Posted March 19, 2014 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
Newbie Posted March 19, 2014 Author Share Posted March 19, 2014 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
JR10 Posted March 19, 2014 Share Posted March 19, 2014 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
Newbie Posted March 19, 2014 Author Share Posted March 19, 2014 Thanks. Works now. P.S i have changed from outputChatBox to outputConsole bec caused a lot of spam in chat box Link to comment
Castillo Posted March 19, 2014 Share Posted March 19, 2014 There's no need to leave that output, it was just to see if it was being triggered or not. 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