Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. SetBatchLines, -1
  2. ListLines, off
  3. #NoEnv
  4. #Persistent
  5. #SingleInstance, force
  6. #Include AHPi_0.3.7_R1.ahk
  7.  
  8. global _WinName := "GTA:SA:MP"
  9. global PosCount := 0
  10. global PosArr := {}
  11. global ZoneCount := {}
  12. gosub cgui
  13. return
  14.  
  15. cgui:
  16.  
  17. IniRead,UsePosLimit,Tool.ini,PosArraySettings,UsePosLimit
  18. IniRead,PosLimit,Tool.ini,PosArraySettings,PosLimit
  19.  
  20. Gui, Add, GroupBox, x5 y5 h50 w475, Position Array Settings
  21. Gui, Add, CheckBox, x10 y25 w20 h20 +BackgroundTrans vUsePosLimit checked%UsePosLimit%,
  22. Gui, Add, Edit, x+3 y25 w70 h20 vPosLimit, %PosLimit%
  23. Gui, Add, Text, x+3 y25 w370 h20 +BackgroundTrans, Use position limit in a Zone (Set default -1 for Unlimited)
  24.  
  25. Gui, Add, Button, x5 y+15 w70 h20 gUseSettings, Use Settings
  26. Gui, Show, x146 y91, New GUI Window
  27. Return
  28.  
  29. GuiClose:
  30. ExitApp
  31.  
  32. UseSettings:
  33. Gui,Submit,NoHide
  34. Iniwrite,% UsePosLimit,Tool.ini,PosArraySettings,UsePosLimit
  35. Iniwrite,% PosLimit,Tool.ini,PosArraySettings,PosLimit
  36. reload
  37. return
  38.  
  39.  
  40. ~!NumpadAdd:: ; Positions Array erweitern
  41. if(!WinExist(_WinName) || !WinActive(_WinName))
  42. return
  43.  
  44. Zone := getPlayerZone()
  45. City := getPlayerCity()
  46. _Pos := getCoordinates()
  47.  
  48. if(UsePosLimit){
  49. if(ZoneCount[1] == ""){
  50. zcount := Zone "Count"
  51. ZoneCount.push(Zone,zcount)
  52. ZoneCount[ZoneCount.MaxIndex()]++
  53. addchatmessage("[FIRST] (Zone: " Zone " | City: " City ") - added by System!")
  54. return
  55. }
  56.  
  57. While(A_Index <= ZoneCount.MaxIndex()){
  58. addchatmessage("A_Index(" A_Index ") <= ZoneCount.MaxIndex(" ZoneCount.MaxIndex() ")")
  59. if(Zone == ZoneCount[A_Index]){
  60. ZoneCount[A_Index+1]++
  61. addchatmessage("(ZoneCounter Increased | " ZoneCount[A_Index] " - " ZoneCount[A_Index+1])
  62. if(ZoneCount[A_Index+1] == PosLimit){
  63. addchatmessage("Position limit has been reached. (Zone: " Zone " | City: " City ")")
  64. addnew := false
  65. abortaction := true
  66. break
  67. }
  68. addnew := true
  69. abortaction := false
  70. break
  71. }
  72. }
  73.  
  74. if(addnew && !abortaction){
  75. zcount := Zone "Count"
  76. ZoneCount.push(Zone,zcount)
  77. ZoneCount[ZoneCount.MaxIndex()]++
  78. addchatmessage("(Zone: " Zone " | City: " City ") - added by System!")
  79. }
  80. }
  81.  
  82. if(abortaction && !addnew)
  83. Return
  84.  
  85. PosCount++
  86. Zero := 0
  87. PosArr.push(_Pos[1],_Pos[2],_Pos[3],Zero,Zone,City)
  88. addchatmessage("PosNr.: " PosCount " X: " PosArr[PosArr.MaxIndex() - 5] " Y: " PosArr[PosArr.MaxIndex() - 4] " Z: " PosArr[PosArr.MaxIndex() - 3] " A: " PosArr[PosArr.MaxIndex() - 2] " in " PosArr[PosArr.MaxIndex() - 1] "(" PosArr[PosArr.MaxIndex()] ")")
  89. return
  90.  
  91. ~!p::
  92. if(WinExist(_WinName) && WinActive(_WinName))
  93. {
  94. FileAppend, % "new CHANGEME[" ((PosArr.MaxIndex() / 6) + 1) "][5] = {`n",PosArray.txt
  95. _i := 6
  96. _C := 1
  97. While(_i <= PosArr.MaxIndex())
  98. {
  99. if(_i == PosArr.MaxIndex())
  100. {
  101. _X := "{" PosArr[PosArr.MaxIndex() - 5] "," PosArr[PosArr.MaxIndex() - 4] "," PosArr[PosArr.MaxIndex() - 3] "," PosArr[PosArr.MaxIndex() - 2] "} // - Zone: " PosArr[PosArr.MaxIndex() - 1] "(" PosArr[PosArr.MaxIndex()] ")`n"
  102. addchatmessage(_x)
  103. FileAppend, % _x,PosArray.txt
  104. break
  105. }
  106. Else
  107. {
  108. _X := "{" PosArr[PosArr.MaxIndex() - 5] "," PosArr[PosArr.MaxIndex() - 4] "," PosArr[PosArr.MaxIndex() - 3] "," PosArr[PosArr.MaxIndex() - 2] "}, // - Zone: " PosArr[PosArr.MaxIndex() - 1] "(" PosArr[PosArr.MaxIndex()] ")`n"
  109. addchatmessage(_x)
  110. FileAppend, % _x "`n",PosArray.txt
  111. }
  112. _i := (_i + 6)
  113. }
  114.  
  115. FileAppend, % "}",PosArray.txt
  116.  
  117. While((A_Index * 6) <= PosArr.MaxIndex()){
  118. addchatmessage(PosArr.MaxIndex())
  119. addchatmessage("{FFFFFF}X: {1B85A8}" PosArr[PosArr.MaxIndex() - 5] " {FFFFFF}Y: {1B85A8}" PosArr[PosArr.MaxIndex() - 4] " {FFFFFF}Z: {1B85A8}" PosArr[PosArr.MaxIndex() - 3] " {FFFFFF}A: {1B85A8}" PosArr[PosArr.MaxIndex() - 2] "{FFFFFF}- Zone: {1B85A8}" PosArr[PosArr.MaxIndex() - 1] "(" PosArr[PosArr.MaxIndex()] ")")
  120. }
  121. }
  122. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement