Taalasmaa Posted August 1, 2009 Share Posted August 1, 2009 Hello, I have little problem in my truck missions which I did make There's piece of code function Stuff () End1 = createMarker ( 2221.34, -1114.29, 25.83, "cylinder", 1.5, 255, 255, 0, 170 ) guiSetText ( mission, "Carl Wanna New Truck! Deliver This For Him!" ) end addCommandHandler ( "mission", Stuff ) This is just piece! If I type in marker "mission" Car will spawn for me and it create blip to radar+random message things... This is just example code... And the problem is there: This end1 marker.. It's marker where you have to delivere truck But If I go to this marker nothing isn't happening There's code which I tried function onEnd1Hit ( player ) if source == End1 then local vehicle = getPlayerOccupiedVehicle ( player ) if vehicle then outputChatBox ( "Mission Passed, Carl Is happy now. There's $20000", player, 255, 255, 0 ) givePlayerMoney ( 20000 ) blahblah There is destroy elements things... end end end addEventHandler ( "onMarkerHit", End1, onEnd1Hit ) What's going wrong?? So, I just wanna fix, that when player hit to finish marker (end1) then He get his moneys etc.. NOTE: This is just piece of code.. It's working fine, but end marker isn't working.. Help? Edit: There's warning: truck.lua @ bad argument @ 'addEventHandler' line - 22 I tried too triggerclientevent+triggerserverevent, then it didn't give warning, but didn't work Link to comment
50p Posted August 1, 2009 Share Posted August 1, 2009 https://forum.multitheftauto.com/viewtop ... er#p289183 Read my post on how scripts work. You should be able to figure out why your script doesn't work. Link to comment
Taalasmaa Posted August 1, 2009 Author Share Posted August 1, 2009 50p, do you know what... You're just posting negative things for my threads... I don't need your replies. How many time do I have to say it?? I wont need your stupid answer, I think, that I can't make truck missions if I cannot script at all. Link to comment
50p Posted August 1, 2009 Share Posted August 1, 2009 50p, do you know what... You're just posting negative things for my threads... I don't need your replies. How many time do I have to say it?? I wont need your stupid answer, I think, that I can't make truck missions if I cannot script at all. In what way my previous post was negative? Explain that if you can... I'm one of those people that usually get answers like, "Thank you!", "You helped me a lot!"... As you said, you can't make truck mission because you can't script... How do you want to script if you don't want to learn to script? You just don't understand how scripts work. The link I posted explains in what order script executes. Once you know that you will figure out how to fix what you're making. Just because I based the example on GUI doesn't mean it doesn't apply to your script. It applies to every part of your script. Link to comment
Taalasmaa Posted August 2, 2009 Author Share Posted August 2, 2009 50p... 50p... This script is working fine exept ONE point... You're trying to say bullshit for me.. Please don't reply to my topic anymore. Do you understand.. Just one point. Link to comment
Lordy Posted August 2, 2009 Share Posted August 2, 2009 Well I'm pretty sure nobody who has read your replies to 50p will answer to your threads with anything constructive anymore. You ask for help, he's trying to help you, you don't like seeing that he thinks somethings not right, you tell him to shut up. You have to understand nobody will ever try to help you if you act like this. For reference: https://forum.multitheftauto.com/viewtop ... 91&t=24604 Link to comment
Taalasmaa Posted August 2, 2009 Author Share Posted August 2, 2009 Well I'm pretty sure nobody who has read your replies to 50p will answer to your threads with anything constructive anymore. You ask for help, he's trying to help you, you don't like seeing that he thinks somethings not right, you tell him to shut up. You have to understand nobody will ever try to help you if you act like this. For reference: https://forum.multitheftauto.com/viewtop ... 91&t=24604 .. I know what are you trying to say, but I just need real help, What does it influence if someone put a link to mta development, or topic where u have to learn newbies things Lol, 50p, If u really wanna help, put link where is related things.. 50p thing, that i'm newbie who cannot script at all. So 50p tell me how did I make working truck missions exept one point, How Did I do working clue's for my server??? Hey cmon guy, Try give some real links for sites where is really related things .. I don't wanna be angry and replying bad things like don't reply for me, but I just wanna some real things.. Well, thanks if somebody can help with this problem... Link to comment
DiSaMe Posted August 2, 2009 Share Posted August 2, 2009 addEventHandler ( "onMarkerHit", End1, onEnd1Hit ) Element End1 doesn't exist because its value is nil when resource starts. Possible ways to solve this: 1. Move addEventHandler into function Stuff after element creation. And checking if source is equal to End1 is useless because this condition will always be true unless End1 has children elements. 2. In addEventHandler line change End1 to getRootElement(). Link to comment
50p Posted August 2, 2009 Share Posted August 2, 2009 addEventHandler ( "onMarkerHit", End1, onEnd1Hit ) Element End1 doesn't exist because its value is nil when resource starts. Possible ways to solve this: 1. Move addEventHandler into function Stuff after element creation. And checking if source is equal to End1 is useless because this condition will always be true unless End1 has children elements. 2. In addEventHandler line change End1 to getRootElement(). That's exactly what I posted in the first post. I wonder why people are so ignorant and can't be arsed to read a few lines of code that is commented to make things clear. Talasma, I do "put link where is related things" but as I said, you're ignorant and CBA to read and understand. If you made a truck mission and it works fine but one thing then congratulations. But that also explains you have scripting knowledge and know how scripts work, so you shouldn't even post here because you know what is the problem with your script. If you're saying you're a noob then I give you a link so that you can learn from it and have more knowledge, also not being a noob any more. 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