Advertisement
Toastur

Departure Chat [Gmod E2]

Jun 4th, 2017
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. @name Departure Chat
  2. @inputs On Num:string
  3. @outputs
  4. @persist GoingTo:string From:string Passing:string Arriving:string
  5. @trigger
  6. runOnChat(1)
  7. ReportingMark = "AAAA"
  8.  
  9. #[
  10. Instructions:
  11. 1. Wire the 'On' input to the MU master or a toggle button.
  12. 2. type .to, then your destination. Example: .to Rockfort
  13. 3. type .from, then your departing location. Example: .from Wolfram
  14. 4. Finally, type .depart to announce your departure!
  15. 5. If you want to announce if you are passing through somewhere, type .passing [location]
  16. 6. If you would like to announce your arrival to a station/yard, type .arriving [location]
  17. ]#
  18.  
  19. if(chatClk(owner()) & On){
  20. LS = owner():lastSaid()
  21. Command = owner():lastSaid():explode(" ")
  22. Location = Command[2,string]
  23.  
  24. if(Command[1,string] == ".to"){
  25. GoingTo = Command[2,string]
  26. print("Destination set to "+GoingTo+"!")
  27. hideChat(1)
  28. }
  29. if(Command[1,string] == ".from"){
  30. From = Command[2,string]
  31. print("Starting location set to "+From+"!")
  32. hideChat(1)
  33. }
  34. if(Command[1,string] == ".passing"){
  35. Passing = Command[2,string]
  36. chatPrint(
  37. vec(0,255,255),ReportingMark+" "+Num+" ",
  38. vec(255),"passing ",
  39. vec(0,255,0),Passing
  40. )
  41. hideChat(1)
  42. }
  43.  
  44. if(Command[1,string] == ".arriving"){
  45. Arriving = Command[2,string]
  46. chatPrint(
  47. vec(0,255,255),ReportingMark+" "+Num+" ",
  48. vec(255),"arriving at ",
  49. vec(0,255,0),Arriving
  50. )
  51. hideChat(1)
  52. }
  53. if(LS == ".depart"){
  54. hideChat(1)
  55. chatPrint(
  56. vec(0,255,255),ReportingMark+" "+Num+" ",
  57. vec(255),"departing for ",
  58. vec(0,255,0),GoingTo,
  59. vec(255)," starting from ",
  60. vec(0,255,0),From
  61. )
  62.  
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement