Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

My Vehicle Script (unfinished)


StingRay200
 Share

Recommended Posts

As you probably will know after reading this topic, I am a very bad scripter, but learning how, hopefully, rapidly.

I want to make a Vehicle script, this is what I have so far:

> '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ' This sub runs when any player presses the Enter key
> Sub HotScript2(index)
> '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Call CustomMenuShow (index, "Vehicle", "GUI\Custom\vehicle.bmp", 1)
> Call CustomMenuLabel (index, "Would you like to get into this vehicle?", 20, 50, 0, 2, 400,
>         20)
> End Sub
>
> Call CustomMenuBUTTON (index, "Yes", 20, 60, 0, 0, 400, 20)
> Call CustomMenuBUTTON (index, "No", 20, 60, 0, 3, 400, 20)
> If Clicked_"Yes" then
> Call CustomMenuClose (index)
> Call CustomMenuShow (index, "Password", "GUI\Custom\Password.bmp", 1)
> Call CustomMenuLabel (index, "Please enter password to unlock vehicle.", 20, 50, 0,
>
> 2, 400, 20)
> Call CustomMenuTextBox (index, 1, 300, 20, 100, "Enter password here.")
> Dim ("Vehicles.txt", Vehicle 12, Get Password)
> If MATCH then (index, SetPlayerSprite, 14, 1)
> Call CustomMenuClose (index)
> If Clicked_"No" then
> Call CustomMenuClose (index)
>
> End Sub
>
> End

I KNOW IT WON'T WORK…
I still have to write a whole lot of instances and that stuff, but is it basically right?

The words in capitals represent that I don't know the Sub for that Call.

Any help will be appreciated, thanks.

-Stingers
Link to comment
Share on other sites

CustomMenuButtom isnot a valid command
you can use
Call CustomMenuPicture(index , Picture Index , Location , X , Y)
And in menu scripts case 2
If Clicked_Index = Picture Index Then
run code
end If

the matching thing should be in menu scripts case 1.somehing like this
Dim carpass
carpass = GetVar(where is stored the car pass)

If carpass = GetPlayerMenuClickMsg(index) (i think is something like this) Then
run code
Else
code if pass words dont match
End if
Link to comment
Share on other sites

```
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' This sub runs when any player presses the Enter key
Sub HotScript2(index)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Call CustomMenuShow(Index, "Vehicle", "GUI\Custom\vehicle.bmp", 1)
Call CustomMenuLabel(Index, 1, "Would you like to get into this vehicle?", 20, 50, 0, 2, 400, 20)
Call CustomMenuLabel(Index, 2, "Yes", 20, 60, 0, 0, 400, 20)
Call CustomMenuLabel(Index, 3, "No", 20, 60, 0, 3, 400, 20)
End Sub
```
```
' Executes when something on a custom menu is clicked.
Sub MenuScripts(Index, Clicked_Index, Menu_Type)
Dim MenuTitle
Dim FieldMessage

MenuTitle = GetPlayerMenuClickTitle(Index)
FieldMessage = GetPlayerMenuClickMsg(Index)

Select Case MenuTitle
Case "Vehicle"
Select Case Clicked_Index
Case 2
Call CustomMenuClose(Index)
Call PlayerQueryBox(Index, "What's the password?", 2)

Exit Sub

Case 3
Call CustomMenuClose(Index)

Exit Sub

Case Else
Call PlayerMsg(Index, "Unknown object!", BRIGHTRED)

Exit Sub
End Select

Exit Sub

Case Else
Call PlayerMsg(Index, "Unknown menu!", BRIGHTRED)

Exit Sub
End Select
End Sub
```
```
' Out-dated: Executes query box responses.
Sub QueryBox(Index, Prompt)
Select Case Prompt
Case 1
Dim Password
Dim VehiclePassword

Password = GetVar("responses.ini", "Responses", CStr(Index))
VehiclePassword = GetVar("Vehicles.ini", "VEHICLE 12", "Password")

If Password <> VehiclePassword Then
Call PlayerMsg(Index, "Invalid password!", BRIGHTRED)

Exit Sub
End If

Call PutVar("Accounts\" & GetPlayerLogin(Index) & "\Char" & GetPlayerCharNum(Index) & ".ini", "GENERAL", "Sprite", CStr(GetPlayerSprite(Index))
Call SetPlayerSprite(Index, 14)
Call SendPlayerData(Index)

Exit Sub

Case Else
Call PlayerMsg(Index, "Unknown query!", BRIGHTRED)

Exit Sub
End Select
End Sub
```

Regards,
  Godlord.
Link to comment
Share on other sites

Oh my Frickin Gosh.
Thank you! Thank you!

But wait, I don't think you wrote a part if the Password was right.
Shouldn't it be like this:

> If Password = VehiclePassword then
>           Call PlayerMsg( index, "Car Unlocked!", BRIGHTGREEN)
> Call SetPlayerSprite( index, 14)
Link to comment
Share on other sites

@[Eclipse's:

> §tingRay200 link=topic=50772.msg530699#msg530699 date=1251113751]
> Oh my Frickin Gosh.
> Thank you! Thank you!
>
> But wait, I don't think you wrote a part if the Password was right.
> Shouldn't it be like this:


I did, it says that it is wrong and it exist. If it is right, it just continues.

Regards,
  Godlord.
Link to comment
Share on other sites

@[Eclipse's:

> §tingRay200 link=topic=50772.msg530699#msg530699 date=1251113751]
> Oh my Frickin Gosh.
> Thank you! Thank you!
>
> But wait, I don't think you wrote a part if the Password was right.
> Shouldn't it be like this:


He just had it check if it wasn't correct, No need to say if its correct if it is.. since the script will then continue.
Warning - while you were typing a new reply has been posted. You may wish to review your post.

Damn you!!!
Link to comment
Share on other sites

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
 Share

×
×
  • Create New...