Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SetBatchLines, -1
- ListLines, off
- #NoEnv
- #Persistent
- #SingleInstance, force
- #Include AHPi_0.3.7_R1.ahk
- global _WinName := "GTA:SA:MP"
- global PosCount := 0
- global PosArr := {}
- global ZoneCount := {}
- gosub cgui
- return
- cgui:
- IniRead,UsePosLimit,Tool.ini,PosArraySettings,UsePosLimit
- IniRead,PosLimit,Tool.ini,PosArraySettings,PosLimit
- Gui, Add, GroupBox, x5 y5 h50 w475, Position Array Settings
- Gui, Add, CheckBox, x10 y25 w20 h20 +BackgroundTrans vUsePosLimit checked%UsePosLimit%,
- Gui, Add, Edit, x+3 y25 w70 h20 vPosLimit, %PosLimit%
- Gui, Add, Text, x+3 y25 w370 h20 +BackgroundTrans, Use position limit in a Zone (Set default -1 for Unlimited)
- Gui, Add, Button, x5 y+15 w70 h20 gUseSettings, Use Settings
- Gui, Show, x146 y91, New GUI Window
- Return
- GuiClose:
- ExitApp
- UseSettings:
- Gui,Submit,NoHide
- Iniwrite,% UsePosLimit,Tool.ini,PosArraySettings,UsePosLimit
- Iniwrite,% PosLimit,Tool.ini,PosArraySettings,PosLimit
- reload
- return
- ~!NumpadAdd:: ; Positions Array erweitern
- if(!WinExist(_WinName) || !WinActive(_WinName))
- return
- Zone := getPlayerZone()
- City := getPlayerCity()
- _Pos := getCoordinates()
- if(UsePosLimit){
- if(ZoneCount[1] == ""){
- zcount := Zone "Count"
- ZoneCount.push(Zone,zcount)
- ZoneCount[ZoneCount.MaxIndex()]++
- addchatmessage("[FIRST] (Zone: " Zone " | City: " City ") - added by System!")
- return
- }
- While(A_Index <= ZoneCount.MaxIndex()){
- addchatmessage("A_Index(" A_Index ") <= ZoneCount.MaxIndex(" ZoneCount.MaxIndex() ")")
- if(Zone == ZoneCount[A_Index]){
- ZoneCount[A_Index+1]++
- addchatmessage("(ZoneCounter Increased | " ZoneCount[A_Index] " - " ZoneCount[A_Index+1])
- if(ZoneCount[A_Index+1] == PosLimit){
- addchatmessage("Position limit has been reached. (Zone: " Zone " | City: " City ")")
- addnew := false
- abortaction := true
- break
- }
- addnew := true
- abortaction := false
- break
- }
- }
- if(addnew && !abortaction){
- zcount := Zone "Count"
- ZoneCount.push(Zone,zcount)
- ZoneCount[ZoneCount.MaxIndex()]++
- addchatmessage("(Zone: " Zone " | City: " City ") - added by System!")
- }
- }
- if(abortaction && !addnew)
- Return
- PosCount++
- Zero := 0
- PosArr.push(_Pos[1],_Pos[2],_Pos[3],Zero,Zone,City)
- 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()] ")")
- return
- ~!p::
- if(WinExist(_WinName) && WinActive(_WinName))
- {
- FileAppend, % "new CHANGEME[" ((PosArr.MaxIndex() / 6) + 1) "][5] = {`n",PosArray.txt
- _i := 6
- _C := 1
- While(_i <= PosArr.MaxIndex())
- {
- if(_i == PosArr.MaxIndex())
- {
- _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"
- addchatmessage(_x)
- FileAppend, % _x,PosArray.txt
- break
- }
- Else
- {
- _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"
- addchatmessage(_x)
- FileAppend, % _x "`n",PosArray.txt
- }
- _i := (_i + 6)
- }
- FileAppend, % "}",PosArray.txt
- While((A_Index * 6) <= PosArr.MaxIndex()){
- addchatmessage(PosArr.MaxIndex())
- 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()] ")")
- }
- }
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement