Jump to content

can someone remake this for me?


Michael_Tuner

Recommended Posts

Posted

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 )

Posted

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 ?

Posted

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.

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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.

Do NOT PM ME for help unless invited. - New MTA Script Editor

Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.

Posted

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

Posted

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?? :shock:

test = run MTA, run your resource, and find your marker, and go into it..

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

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

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