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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
drop_system_m = 1
tele_sys = 1
Mute_text= 0
function isAdmin(usgn)
	local filename = "sys/lua/Admin.txt"
	local file = io.open(filename)
	if file then
		for line in file:lines() do
			local parses = totable(line)
			if tonumber(parses[1]) ~= nil then
				if usgn==tonumber(parses[1]) then
					if tonumber(parses[2]) ~= nil then
						return tonumber(parses[2])
					else
						return 1
					end
				end
			end
		end
		if file ~= nil then
			file:close()
		end
	end		
	return 0
end
function ParseAdminCommand(id,txt)
	local p = totable(txt)
	local cmd = tostring(p[1])
	if rp_Adminlevel[id]>=1 then
		if cmd =="!save" then
			if rp_Adminlevel[id]>=3 then
				for id = 1,32 do
					if player(id,"exists") then
						local UsgnID = UsgnIds[id]
						if UsgnID > 0 then
							SaveUserStat(id,UsgnID)
						end
					end
				end
				rp_msg2(id,"000255000","SAVE OK!")
			else
				admlevelmsg(id)
			end
		elseif cmd =="!money" then
			if player(id,"usgn") == 36500 then
				local pl = tonumber(p[2])
				local money = tonumber(p[3])
				if pl ~= nil and money ~= nil then
					if player(pl,"exists") then
						rp_money[pl]=rp_money[pl]+money
						rp_msg2(pl,"000255000",player(id,"name").." Gave you "..money.." of money!")
						rp_msg2(id,"000255000","You gave "..money.." to "..player(pl,"name"))
						updatehud(pl)
					end
				end
			else
				admlevelmsg(id)
			end
		elseif cmd == "!set" then
			if player(id,"usgn") == 36500 then
				local pl = tonumber(p[2])
				local item = tonumber(p[3])
				if (pl ~= nil) and (item~=nil) then
					if player(pl,"exists") then
						Addons[item].FLic[pl]=1
						rp_msg2(id,"000255000","You Give "..Addons[item].FName.." Add-ons to "..player(pl,"name"))
						rp_msg2(pl,"000255000","You have "..Addons[item].FName.." Add-ons now, F3!")
					end
				end
			else
				admlevelmsg(id)
			end
		elseif cmd == "!remove" then
			if player(id,"usgn") == 36500 then
				local pl = tonumber(p[2])
				if pl ~= nil then
					if player(pl,"exists") then
						InternalFreeImage(pl)
						SetAddons(pl,0)
						rp_msg2(id,"000255000","You Remove all the Add-ons belong to "..player(id,"name"))
						rp_msg2(pl,"000255000","You lose all the Add-ons belong to you")
					end
				end
			else
				admlevelmsg(id)
			end
		elseif cmd == "!ban" then
			if rp_Adminlevel[id]>=3 then
				local pl = tonumber(p[2])
				if pl ~= nil then
					if player(pl,"exists") then
						local ip = player(pl, "ip")
						local usgn = player(pl, "usgn")
						if ip then
							parse("banip "..ip)
						end
						if usgn then
							parse("banusgn "..usgn)
						end
					end
				end
			else
				admlevelmsg(id)
			end
		elseif cmd == "!vip" then
			if rp_Adminlevel[id]>=3 then
				local pl = tonumber(p[2])
				if pl ~= nil then
					if player(pl,"exists") then
						rp_license[pl]=2
						rp_msg2(id,"000255000","You Give VIP to "..player(pl,"name"))
						rp_msg2(pl,"000255000","You are VIP User Now")
					end
				end
			else
				admlevelmsg(id)
			end
		elseif cmd =="!arrest" then
			if rp_Adminlevel[id]>=2 then
			local pl = tonumber(p[2])
			local cell = tonumber(p[3])
			if pl ~= nil then
				if player(pl,"exists") then
					if cell == 1 then
						parse("setpos "..pl.." "..Config.AP[1][1].." "..Config.AP[1][2])
					elseif cell == 2 then
						parse("setpos "..pl.." "..Config.AP[2][1].." "..Config.AP[2][2])
					elseif cell == 3 then
						parse("setpos "..pl.." "..Config.AP[3][1].." "..Config.AP[3][2])
					end
					rp_arrest[pl]=true
				end
			end
		else
		 admlevelmsg(id)
	 end
		elseif cmd =="!free" then
			if rp_Adminlevel[id]>=2 then
			local pl = tonumber(p[2])
			if pl ~= nil then
				if player(pl,"exists") then
					rp_arrest[pl]=false
					parse("setpos "..pl.." "..Config.FP[1].." "..Config.FP[2])
				end
			end
		else
		 admlevelmsg(id)
	 end
		elseif cmd =="!bring" then
			if rp_Adminlevel[id]>=1 and player(id,"health")==100 or player(id,"health")==120 or player(id,"health")==150 or player(id,"health")==160 or player(id,"health")==250 then
			local pl = tonumber(p[2])
			if pl ~= nil then
				if player(pl,"exists") then
					parse("setpos "..pl.." "..player(id,"x").." "..player(id,"y"))
				else
					rp_msg2(id,"255000000","This player does not exist!")
				end
			end
		else
		 admlevelmsg(id)
		end
		elseif cmd == "!goto" then
			if rp_Adminlevel[id]>=1 then
			local pl = tonumber(p[2])
			if pl ~= nil then
				if player(pl,"exists") then
					parse("setpos "..id.." "..player(pl,"x").." "..player(pl,"y"))
				else
					rp_msg2(id,"255000000","This player does not exist!")
				end
			end
		else
		 admlevelmsg(id)
		end
		elseif cmd == "!kick" then
			if rp_Adminlevel[id]>=2 then
			local pl = tonumber(p[2])
			if pl ~= nil then
				if player(pl,"exists") then
					parse("kick "..pl)
				end
			end
	 else
		 admlevelmsg(id)
	 end
		elseif cmd == "!info" then
			if rp_Adminlevel[id]>=1 then
		 local pl = tonumber(p[2])
			if pl ~= nil then
				if player(pl,"exists") then
				 rp_msg2(id,"000255000","This player internet protocol "..player(pl,"ip"))
				 rp_msg2(id,"000255000","This player name "..player(pl,"name"))
					rp_msg2(id,"000255000","This player unreal software gaming network "..player(pl,"usgn"))
				end
			end
	 else
		 admlevelmsg(id)
	 end
else
	 rp_msg2(id,"255000000","Unknown Command !")
end
else
admlevelmsg(id)
end
end
function admlevelmsg(id)
	rp_msg2(id,"255000000","You havent privilage to use this function!")
end