Michael_Tuner Posted February 4, 2010 Share Posted February 4, 2010 I made a trucker scripts I haven't tested it I am a beginner at the scripting. this is my first one I need some help with it. I know it is a total damn-out even if I never tested it. Please remake it for me and tell me the mistakes. This was the best I could. How to make a blip of yellow color for the destination. and How to make more markers and attach the trailer only when they get there and detach it when they get their destination? And how to make money giving at the end of the mission (5 destinations) and How to make a timer of 2:50 min/delivery? The script is truckerVehicles = { [598]=true, [596]=true, [597]=true, [599]=true } getTeamFromPlayer="mr_trucker" then marker1 = createMarker ( 552.69714355469, 1660.6196289063, 5.9245247840881) string getMarkerType ( marker marker1=cylinder ) float getMarkerSize ( marker marker1= 10 ) 255, 255, 0, 255 getMarkerColor ( marker marker1 ) onClientHitMarker then setMarkerVisible (marker1)="false" thetrailer = trailer = createVehicle ( 591 ) attachTrailerToVehicle ( theVehicle, trailer ) marker2 = createMarker (-1345.484375, 2678.1291503906, 49.044738769531) string getMarkerType ( marker marker1=cylinder ) float getMarkerSize ( marker marker1= 10 ) 255, 255, 0, 255 getMarkerColor ( marker marker1 ) onMarkerHit setMarkerVisible="false" detachTrailerFromVehicle ( vehicle theVehicle, [vehicle theTrailer] ) bool givePlayerMoney ( player thePlayer, int 100 ) outputChatBox ("#FFFF00Ya you really earned it man!",source) function enterVehicle ( thePlayer, seat, jacked ) if ( truckerVehicles[getElementModel ( source )] ) and ( not mr_trucker[getTeamFromPlayer ( thePlayer )] ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "#FFFF00You are not a trucker! #FF0000Get out of my cab!", thePlayer ) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) Link to comment
Dark Dragon Posted February 4, 2010 Share Posted February 4, 2010 I am sorry but this code just... doesn't make any sense? are you sure you've posted it correctly? because it is totally malformed. could you tell us what you were trying to do? you better just start from scratch again. i recommend you to try a general lua tutorial first, you don't seem to know much of programming/scripting at all. Link to comment
MasterTobi Posted February 4, 2010 Share Posted February 4, 2010 hm the code is unknowable truckerVehicles = { [598]=true, [596]=true, [597]=true, [599]=true } getTeamFromPlayer="mr_trucker" then marker1 = createMarker ( 552.69714355469, 1660.6196289063, 5.9245247840881) string getMarkerType ( marker marker1=cylinder ) float getMarkerSize ( marker marker1= 10 ) 255, 255, 0, 255 getMarkerColor ( marker marker1 ) onClientHitMarker then setMarkerVisible (marker1)="false" thetrailer = trailer = createVehicle ( 591 ) attachTrailerToVehicle ( theVehicle, trailer ) marker2 = createMarker (-1345.484375, 2678.1291503906, 49.044738769531) string getMarkerType ( marker marker1=cylinder ) float getMarkerSize ( marker marker1= 10 ) 255, 255, 0, 255 getMarkerColor ( marker marker1 ) onMarkerHit setMarkerVisible="false" detachTrailerFromVehicle ( vehicle theVehicle, [vehicle theTrailer] ) bool givePlayerMoney ( player thePlayer, int 100 ) outputChatBox ("#FFFF00Ya you really earned it man!",source) function enterVehicle ( thePlayer, seat, jacked ) if ( truckerVehicles[getElementModel ( source )] ) and ( not mr_trucker[getTeamFromPlayer ( thePlayer )] ) then removePedFromVehicle ( thePlayer ) outputChatBox ( "#FFFF00You are not a trucker! #FF0000Get out of my cab!", thePlayer ) end end addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) and the code if ( truckerVehicles[getElementModel ( source )] ) and ( not mr_trucker[getTeamFromPlayer ( thePlayer )] ) then It seems like SAMP, or not ? Link to comment
dzek (varez) Posted February 4, 2010 Share Posted February 4, 2010 uhm, my trucker mission (not finished) is 10x longer than yours.. and as DarkDragon[GER] said - this doesnt make sense.. if you want to learn scripting, important thing is TEST your script while is 10-20 lines long, then edit, add functions/events, and test again, test test test.. you cannot do a 500-lines script, without testing it. Link to comment
robhol Posted February 4, 2010 Share Posted February 4, 2010 Sorry, but this is... well, completely useless. You have a lot more reading to do both in Lua and MTA scripting before you can make this. Link to comment
Michael_Tuner Posted February 5, 2010 Author Share Posted February 5, 2010 I told you I also never understood anything really I just made it out. and how to test this out? I am reading wiki and robho's pages everyday. Please tell me how to test. I can't save files in mta scripter so I am using notepad not ++. Link to comment
dzek (varez) Posted February 5, 2010 Share Posted February 5, 2010 Michael_Tuner, start with simple script like when player hit marker, something will be outputted to console. just reading won't help you. you don't know what "test" mean?? test = run MTA, run your resource, and find your marker, and go into it.. Link to comment
Jumba' Posted February 5, 2010 Share Posted February 5, 2010 you cannot do a 500-lines script, without testing it. Well you can, but it's annoying as hell Link to comment
Dark Dragon Posted February 5, 2010 Share Posted February 5, 2010 I am using notepad not ++. then this is the first step to go. get notepad++. it's an almost impossible task to produce decent code with notepad. Link to comment
50p Posted February 5, 2010 Share Posted February 5, 2010 I am using notepad not ++. then this is the first step to go. get notepad++. it's an almost impossible task to produce decent code with notepad. Lies! I made bank resource purely in Windows' Notepad since I didn't know about Notepad++ at that time. ...I can't save files in mta scripter so I am using notepad not ++. BTW, to people who have problem with MTA:SE saving files on Vista or Win7: does anyone know where the files are saved and if they are actually saved anywhere? Is may be UAC problem and MTA:SE has no access to save files in C:\Program Files\ folder and its subfolders (I don't use any of these OSes so I don't know their system folders' locations) or somewhere else where your MTA Server is installed. Please don't use this topic for replying, post your replies in MTA:SE topic, please. Thanks. Link to comment
Michael_Tuner Posted February 6, 2010 Author Share Posted February 6, 2010 I am using Windows Vista Ultimate 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