forked from Suchty112/SAMP-UDF-for-AutoHotKey
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathSAMPTest.ahk
194 lines (175 loc) · 4.92 KB
/
SAMPTest.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
if not A_IsAdmin
{
Run *RunAs "%A_ScriptFullPath%"
ExitApp
}
#Warn
#UseHook
#NoEnv
#SingleInstance force
#include %A_ScriptDir%\SAMP.ahk
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
;SetTimer, Overlay, 1000000
IniRead, Nickname, Daten.ini, Ingame Daten:, Nickname
Gui, Add, Text, x10 y5, -: /lock
Gui, Add, Edit, x100 y70 w140 h20 vnamen, %Nickname%
Gui, Add, Button, x40 y30 w140 h20 grefresh, reloaden
Gui, Add, Button, x100 y100 w140 h20 gSavetest, Speichern
Gui, Add, Button, x40 y100 w140 h20 gconnect, samp starten
AntiCrash()
Gui, Show, , blabla
return
Savetest:
GuiControlGet,Nickname ,,Namen
IniWrite, %Nickname%, Daten.ini, Ingame Daten: , Nickname
return
connect:
RegRead GTA_SA_EXE, HKEY_CURRENT_USER, Software\SAMP, gta_sa_exe
SplitPath, GTA_SA_EXE,, PFAD
Run %Pfad%\samp.exe 127.0.0.1:7777, %PFAD%
Return
refresh:
Reload
Return
GuiClose:
ExitApp
return
Hotkey, Enter, Off
Hotkey, Escape, Off
return
+T::
~t::
Suspend On
Hotkey, Enter, On
Hotkey, Escape, On
Hotkey, t, Off
return
~NumpadEnter::
~Enter::
Suspend Permit
Suspend Off
Hotkey, t, On
Hotkey, Enter, Off
Hotkey, Escape, Off
return
~Escape::
Suspend Permit
Suspend Off
Hotkey, t, On
Hotkey, Enter, Off
Hotkey, Escape, Off
return
;#########################################################################################################
;Gebt einen Spielernamen ein, um weitere Infos über diesen Spieler zu bekommen
Numpad1::
SendInput tName:{Space}
Suspend On
Hotkey, Enter, On
Hotkey, Escape, On
Input varName, V I M,{enter}
SendInput {end}+{home}{Del}{esc}
varID := GetPlayerIdByName(varName)
ShowGameText(GetPlayerNameById(varID) "~n~Score: " GetPlayerScoreById(varID) "~n~Ping: " GetPlayerPingById(varID), 2000, 5)
return
;Gebt eine ID ein, um weitere Infos über diesen Spieler zu bekommen
Numpad2::
SendInput tID:{Space}
Suspend On
Hotkey, Enter, On
Hotkey, Escape, On
Input varID, V I M,{enter}
SendInput {end}+{home}{Del}{esc}
;updateScoreboardData() ;wird nun implizit aufgerufen
ShowGameText(GetPlayerNameById(varID) "~n~Score: " GetPlayerScoreById(varID) "~n~Ping: " GetPlayerPingById(varID) "~n~IsNPC: " IsNPCById(varID), 2000, 5)
return
;Spielt einen "Audio Stream" ab
Numpad3::
PlayAudioStream("http://breakz.us/radio/listen.pls")
return
;Stoppt einen "Audio Stream"
Numpad4::
StopAudioStream()
return
;Zeigt diverse Infos über die eigene Spielerfigur an
Numpad5::
if ( IsInChat() )
return
AddChatMessage("{FFFFFF}IP: {FF0000}" GetServerIp() "{FFFFFF}, Hostname: {FF0000}" GetServerName())
AddChatMessage("{FFFFFF}Name: {FF0000}" GetPlayerName())
AddChatMessage("{FFFFFF}HP: {FF0000}" GetPlayerHealth() "{FFFFFF}, ARMOR: {FF0000}" GetPlayerArmor())
pos := GetPlayerCoordinates()
AddChatMessage("{FFFFFF}Zone: {FF0000}" CalculateZone(pos[1],pos[2],pos[3]) "{FFFFFF}, Stadt: {FF0000}" CalculateCity(pos[1],pos[2],pos[3]))
SendChat("blub")
SendChat("/asd")
ShowGameText("Test", 2000, 5)
return
;Zeigt eine Dialog-Box an
#If !IsInChat()
1::
ShowDialog(DIALOG_STYLE_LIST, "Keybinder Menü", "Funktion1`nFunktion2`nFunktion3", "Weiter", "Schließen")
return
#If IsDialogOpen() && WinActive("GTA:SA:MP")
Enter::
OnDialogResponse(true)
return
ESC::
OnDialogResponse(false)
return
#If
OnDialogResponse(response) {
caption := GetDialogCaption()
if (response) {
if (caption == "Keybinder Menü") {
line := GetDialogLine__(GetDialogIndex())
if (line == "Funktion1") {
ShowDialog(DIALOG_STYLE_LIST, "Keybinder - Funktion1", "Test1`nTest2`nTest3", "Weiter", "Schließen")
}
else if (line == "Funktion2") {
ShowDialog(DIALOG_STYLE_INPUT, "Keybinder - Funktion2", "Gebe einen Text ein: ", "Ok", "Schließen")
}
}
else if (caption == "Keybinder - Funktion1") {
line := GetDialogLine__(GetDialogIndex())
AddChatMessage(line)
Send, {Enter}
}
else if (caption == "Keybinder - Funktion2") {
clipboardBuffer := ClipboardAll
clipboard := ""
Send, ^{A}
Send, ^{X}
sleep, 100
dialogInput := clipboard
clipboard := clipboardBuffer
if (dialogInput != -1 && dialogInput != "") {
AddChatMessage("Dialog Input: " dialogInput)
}
Send, {Enter}
}
else
Send, {Enter}
}
else {
if (caption == "Keybinder - Funktion1") {
ShowDialog(DIALOG_STYLE_LIST, "Keybinder Menü", "Funktion1`nFunktion2`nFunktion3", "Weiter", "Schließen")
}
else
Send, {ESC}
}
return
}
;show some info about the current vehicle
Numpad7::
AddChatMessage("{FFFFFF}Vehicle Type:" GetVehicleType())
AddChatMessage("{FFFFFF}Model:" GetVehicleModelId())
AddChatMessage("{FFFFFF}Model Name:" GetVehicleModelName())
AddChatMessage("{FFFFFF}Is Driver:" IsPlayerDriver() " | 0 nein, 1ja")
AddChatMessage("{FFFFFF}Light State:" GetVehicleLightState())
AddChatMessage("{FFFFFF}Engine State:" GetVehicleEngineState())
AddChatMessage("{FFFFFF}Door State:" GetVehicleLockState())
return
Numpad8::
Count := CountOnlinePlayers()
AddChatMessage("Es sind " Count " Spieler Online.")
return