[EFO]Kesha_F1 Posted August 16, 2012 Share Posted August 16, 2012 (edited) Hello! At me a problem. I want in standard to mode RACE, to dress CJ how it is necessary for me. I used this function: AddPedClothes I have made it. And the cap changes only (addPedClothes ( source, "helmet", "helmet", 16 )). Here lua code: function onEnterVehicle ( theVehicle, seat, jacked ) addPedClothes ( source, "helmet", "helmet", 16 ) addPedClothes ( source, "glasses03blue", "glasses03", 15 ) addPedClothes ( source, "tshirtwhite", "tshirt", 0 ) addPedClothes ( source, "sneakerproblu", "sneaker", 3 ) addPedClothes ( source, "bbshortwht", "boxingshort", 2 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle ) Where my mistake? // Resolved by -ffs-Sniper function onEnterVehicle ( theVehicle, seat, jacked ) for i = 1, 17 do removePedClothes ( source, i ) end addPedClothes ( source, "helmet", "helmet", 16 ) addPedClothes ( source, "glasses03blue", "glasses03", 15 ) addPedClothes ( source, "tshirtwhite", "tshirt", 0 ) addPedClothes ( source, "sneakerproblu", "sneaker", 3 ) addPedClothes ( source, "bbshortwht", "boxingshort", 2 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle ) Edited August 16, 2012 by Guest Link to comment
-ffs-Sniper Posted August 16, 2012 Share Posted August 16, 2012 Race might already have a handler onPlayerVehicleEnter. Therefore set the handler's priority to "low". This way you can ensure your code will be executed as last. Be sure you are using the latest nightly of MTA! ->https://nightly.multitheftauto.com/ addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle, "low" ) Link to comment
[EFO]Kesha_F1 Posted August 16, 2012 Author Share Posted August 16, 2012 Race might already have a handler onPlayerVehicleEnter. Therefore set the handler's priority to "low". This way you can ensure your code will be executed as last. Be sure you are using the latest nightly of MTA! ->https://nightly.multitheftauto.com/ addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle, "low" ) Don't work. Im always used latest nightly builds MTA. Link to comment
denny199 Posted August 16, 2012 Share Posted August 16, 2012 Try to debug it. Because it's race it's not working on it I think just typ /debugscript 3 function onEnterVehicle ( theVehicle, seat, jacked ) addPedClothes ( source, "helmet", "helmet", 16 ) addPedClothes ( source, "glasses03blue", "glasses03", 15 ) addPedClothes ( source, "tshirtwhite", "tshirt", 0 ) addPedClothes ( source, "sneakerproblu", "sneaker", 3 ) addPedClothes ( source, "bbshortwht", "boxingshort", 2 ) outputChatBox ( "function pl0x 0.o" ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle ) Link to comment
-ffs-Sniper Posted August 16, 2012 Share Posted August 16, 2012 I think I found the mistake: You need to remove old clothes before adding new ones of a different type. function onEnterVehicle ( theVehicle, seat, jacked ) for i = 1, 17 do removePedClothes ( source, i ) end addPedClothes ( source, "helmet", "helmet", 16 ) addPedClothes ( source, "glasses03blue", "glasses03", 15 ) addPedClothes ( source, "tshirtwhite", "tshirt", 0 ) addPedClothes ( source, "sneakerproblu", "sneaker", 3 ) addPedClothes ( source, "bbshortwht", "boxingshort", 2 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle, "low" ) Link to comment
[EFO]Kesha_F1 Posted August 16, 2012 Author Share Posted August 16, 2012 I think I found the mistake: You need to remove old clothes before adding new ones of a different type. function onEnterVehicle ( theVehicle, seat, jacked ) for i = 1, 17 do removePedClothes ( source, i ) end addPedClothes ( source, "helmet", "helmet", 16 ) addPedClothes ( source, "glasses03blue", "glasses03", 15 ) addPedClothes ( source, "tshirtwhite", "tshirt", 0 ) addPedClothes ( source, "sneakerproblu", "sneaker", 3 ) addPedClothes ( source, "bbshortwht", "boxingshort", 2 ) end addEventHandler ( "onPlayerVehicleEnter", getRootElement(), onEnterVehicle ) Woohoo! It's work! But without 'low'. With 'low' - don't work. Thank you very much. Link to comment
-ffs-Sniper Posted August 17, 2012 Share Posted August 17, 2012 I didn't expect that myself at first . (I forgot to remove "low" from my code) Anyways, you're welcome. 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