Jump to content

can someone remake this for me?


Michael_Tuner

Recommended Posts

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

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

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

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

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