StingRay200 Posted August 23, 2009 Author Share Posted August 23, 2009 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> > EndI 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 More sharing options...
The New World Posted August 23, 2009 Share Posted August 23, 2009 Right off the bat this line is screwed.```Call CustomMenuLabel (index, "Would you like to get into this vehicle?", 20, 50, 0, 2, 400, 20)```And I believe you need End if before End Sub =\and then theres that random "end" you have right under end sub. Link to comment Share on other sites More sharing options...
StingRay200 Posted August 23, 2009 Author Share Posted August 23, 2009 Oh, hang on…Is that better? Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 23, 2009 Share Posted August 23, 2009 CustomMenuButtom isnot a valid commandyou can useCall CustomMenuPicture(index , Picture Index , Location , X , Y)And in menu scripts case 2If Clicked_Index = Picture Index Thenrun codeend Ifthe matching thing should be in menu scripts case 1.somehing like thisDim carpasscarpass = GetVar(where is stored the car pass)If carpass = GetPlayerMenuClickMsg(index) (i think is something like this) Thenrun codeElsecode if pass words dont matchEnd if Link to comment Share on other sites More sharing options...
StingRay200 Posted August 23, 2009 Author Share Posted August 23, 2009 Ohhhh… Now I get it...I'll fix it then post it again. Link to comment Share on other sites More sharing options...
VitinhooxD Posted August 23, 2009 Share Posted August 23, 2009 Ok . Link to comment Share on other sites More sharing options...
Godlord Posted August 23, 2009 Share Posted August 23, 2009 ```'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~' This sub runs when any player presses the Enter keySub 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 SelectEnd 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 SelectEnd Sub```Regards, Godlord. Link to comment Share on other sites More sharing options...
StingRay200 Posted August 24, 2009 Author Share Posted August 24, 2009 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 More sharing options...
Godlord Posted August 24, 2009 Share Posted August 24, 2009 @[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 More sharing options...
IceCream Tuesday Posted August 24, 2009 Share Posted August 24, 2009 @[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 More sharing options...
StingRay200 Posted August 24, 2009 Author Share Posted August 24, 2009 Oh Okay, now I get it, Thanks Goddie… And Ice Cream Tuesday.I'm getting better my the minute Link to comment Share on other sites More sharing options...
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