SHOW:
|
|
- or go back to the newest paste.
1 | - | //Admin System by Nexius v2.5 |
1 | + | //Admin System by Nexius v2.6 |
2 | ||
3 | #if defined _admsys_included | |
4 | #endinput | |
5 | #endif | |
6 | #define _admsys_included | |
7 | ||
8 | #include <a_samp> | |
9 | ||
10 | - | #define ADMSYS_VERSION "2.5" |
10 | + | #define ADMSYS_VERSION "2.6" |
11 | ||
12 | #if !defined ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
13 | #define ADMSYS_SEND_ACTION_MSGS_TO_ALL false | |
14 | #endif | |
15 | ||
16 | #if !defined ADMSYS_SEND_CONNECT_MSGS_TO_ADM | |
17 | #define ADMSYS_SEND_CONNECT_MSGS_TO_ADM false | |
18 | #endif | |
19 | ||
20 | #if !defined ADMSYS_SHOW_KILL_LIST_FOR_ADM | |
21 | #define ADMSYS_SHOW_KILL_LIST_FOR_ADM true | |
22 | #endif | |
23 | ||
24 | #if !defined ADMSYS_DEFAULT_COLOR | |
25 | #define ADMSYS_DEFAULT_COLOR -1 | |
26 | #endif | |
27 | ||
28 | #if !defined ADMSYS_MAX_WARNS | |
29 | #define ADMSYS_MAX_WARNS 2 | |
30 | #endif | |
31 | ||
32 | #if !defined ADMSYS_MAX_TAB_INPUT | |
33 | #define ADMSYS_MAX_TAB_INPUT 8 | |
34 | #endif | |
35 | ||
36 | #if !defined ADMSYS_MAX_SUSPECTS_IN_TABLE | |
37 | #define ADMSYS_MAX_SUSPECTS_IN_TABLE 8 | |
38 | #endif | |
39 | ||
40 | #if !defined ADMSYS_MAX_GIVE_PLAYERS_IN_CMD | |
41 | #define ADMSYS_MAX_GIVE_PLAYERS_IN_CMD 3 | |
42 | #endif | |
43 | ||
44 | #define admsys_isnull(%0) ((!(%0[0])) || (((%0[0]) == '\1') && (!(%0[1])))) | |
45 | #define admsys_fpublic%0(%1) forward %0(%1); public %0(%1) | |
46 | ||
47 | #if !defined CMD | |
48 | #define CMD:%0(%1) forward cmd_%0(%1); public cmd_%0(%1) | |
49 | #endif | |
50 | ||
51 | static const AdmSysCmds[][] = | |
52 | { | |
53 | "Level 1:\n", | |
54 | "/achat [text] - Admin chat\n", | |
55 | "/ahelp - Help with admin commands\n", | |
56 | "/showstats [id] - Show player's statistics\n", | |
57 | "/answer [id] [text] - Respond on player's report\n", | |
58 | "/apanel - Admin panel with all available commands\n", | |
59 | "/admins - List of administrators online\n", | |
60 | "/eject [id] - Remove player from vehicle\n", | |
61 | "\n", | |
62 | "Level 2:\n", | |
63 | "/spec [id] - Begin spectate player\n", | |
64 | "/spawnveh [vehicle id] - Teleport vehicle to respawn\n", | |
65 | "/(un)mute [id] [time] [reason] - Mute/unmute player\n", | |
66 | "/asay [text] - Message: 'Administrator: [text]'\n", | |
67 | "/warn [id] [reason] - Give warn to player\n", | |
68 | "/kick [id] [reason] - Kick player from the server\n", | |
69 | "/(un)freeze [id] - Freeze/unfreeze player\n", | |
70 | "/slap [id] [reason] - Slap player\n", | |
71 | "/goto [id] - Teleport to player\n", | |
72 | "\n", | |
73 | "Level 3:\n", | |
74 | "/suspectlist - List of suspected players\n", | |
75 | "/gethere [id] - Teleport player to yourself\n", | |
76 | "/gotoveh [vehicle id] - Teleport to vehicle\n", | |
77 | "/ban [id] [reason] - Ban player's account\n", | |
78 | "/gmtest [id] - Check for infinite health\n", | |
79 | "/spawn [id] - Teleport player to respawn\n", | |
80 | "/unwarn [id] - Remove warn from player\n", | |
81 | "/banip [IP] - Block IP address\n", | |
82 | "/cc - Clear chat\n", | |
83 | "\n", | |
84 | "Level 4:\n", | |
85 | "/sethealth [id] [health] - Set health to player\n", | |
86 | "/setarmour [id] [armour] - Set armour to player\n", | |
87 | "/setmoney [id] [money] - Set money to player\n", | |
88 | "/setskin [id] [skin id] - Set skin to player\n", | |
89 | "/setint [id] [interior] - Set interior to player\n", | |
90 | "/setvw [id] [vw] - Set virtual world to player\n", | |
91 | "/giveweapon [id] [weapon] [ammo] - Give weapon to player\n", | |
92 | "/repairveh [vehicle id] - Repair vehicle\n", | |
93 | "/unbanip [IP] - Unblock IP address\n", | |
94 | "\n", | |
95 | "Level 5:\n", | |
96 | "/getall - Teleport all to yourself\n", | |
97 | "/setweather [number] - Set weather\n", | |
98 | "/settime [hour] - Set time of day\n", | |
99 | "/destroyveh [vehicle id] - Destroy vehicle\n", | |
100 | "/veh [vehicle id] [color 1] [color 2] - Create vehicle\n", | |
101 | "/sban [id] - Silent ban\n", | |
102 | "/skick [id] - Silent kick" | |
103 | }; | |
104 | ||
105 | enum | |
106 | { | |
107 | ADMSYS_DIALOG_TAB_PANEL = 8192, | |
108 | ADMSYS_DIALOG_ANSWER, | |
109 | ADMSYS_DIALOG_MUTE_TIME, | |
110 | ADMSYS_DIALOG_MUTE, | |
111 | ADMSYS_DIALOG_WARN, | |
112 | ADMSYS_DIALOG_KICK, | |
113 | ADMSYS_DIALOG_SLAP, | |
114 | ADMSYS_DIALOG_BAN, | |
115 | ADMSYS_DIALOG_SET_HEALTH, | |
116 | ADMSYS_DIALOG_SET_ARMOUR, | |
117 | ADMSYS_DIALOG_SET_MONEY, | |
118 | ADMSYS_DIALOG_CHANGE_SKIN, | |
119 | ADMSYS_DIALOG_SET_INT, | |
120 | ADMSYS_DIALOG_SET_VW, | |
121 | ADMSYS_DIALOG_GIVE_WEAPON, | |
122 | ADMSYS_DIALOG_GIVE_WEAPON_AMMO, | |
123 | ADMSYS_DIALOG_AHELP, | |
124 | ADMSYS_DIALOG_STATS, | |
125 | ADMSYS_DIALOG_APANEL, | |
126 | ADMSYS_DIALOG_ACHAT, | |
127 | ADMSYS_DIALOG_SPAWN_VEH, | |
128 | ADMSYS_DIALOG_ASAY, | |
129 | ADMSYS_DIALOG_GOTO_VEH, | |
130 | ADMSYS_DIALOG_BAN_IP, | |
131 | ADMSYS_DIALOG_REPAIR_VEH, | |
132 | ADMSYS_DIALOG_UNBAN_IP, | |
133 | ADMSYS_DIALOG_SET_WEATHER, | |
134 | ADMSYS_DIALOG_SET_TIME, | |
135 | ADMSYS_DIALOG_DESTROY_VEH, | |
136 | ADMSYS_DIALOG_CREATE_VEH, | |
137 | ADMSYS_DIALOG_CREATE_VEH_COL_1, | |
138 | ADMSYS_DIALOG_CREATE_VEH_COL_2, | |
139 | ADMSYS_DIALOG_ADMINS, | |
140 | ADMSYS_DIALOG_SUSPECT_LIST, | |
141 | ADMSYS_DIALOG_GMTEST | |
142 | } | |
143 | ||
144 | enum asInfo | |
145 | { | |
146 | Float:asGmTestHP, | |
147 | Float:asGmTestAR, | |
148 | Float:asLastAngle, | |
149 | Float:asLastPos[3], | |
150 | Float:asLastFloatData, | |
151 | asInput[ADMSYS_MAX_TAB_INPUT], | |
152 | asInput2[ADMSYS_MAX_TAB_INPUT], | |
153 | asLastWeapon[13], | |
154 | asLastIntData[2], | |
155 | asLastAmmo[13], | |
156 | asLastActionID, | |
157 | asLastAction, | |
158 | asLastSpecID, | |
159 | asGmTestID, | |
160 | asAdminLvl, | |
161 | asTabPanel, | |
162 | asMuteTime, | |
163 | asWarns, | |
164 | asSpecID, | |
165 | asLastVW, | |
166 | asLastInt, | |
167 | asUpdTimer, | |
168 | bool:asLastSpec, | |
169 | bool:asIsSpawned, | |
170 | bool:asIsDead, | |
171 | bool:asGmTest | |
172 | } | |
173 | ||
174 | static | |
175 | AdmSysInfo[MAX_PLAYERS][asInfo], | |
176 | SuspectList[ADMSYS_MAX_SUSPECTS_IN_TABLE] = {INVALID_PLAYER_ID, ...}, | |
177 | AdmSysCmdsStr[1728]; | |
178 | ||
179 | forward OnPlayerBan(playerid, gaveid, bool:sban); | |
180 | forward OnPlayerKick(playerid, gaveid, bool:skick); | |
181 | forward OnPlayerWarn(playerid, gaveid, count); | |
182 | ||
183 | public OnGameModeInit() | |
184 | { | |
185 | print(" "); | |
186 | print(" Admin System by Nexius loaded!"); | |
187 | printf(" Version: %s", ADMSYS_VERSION); | |
188 | print(" "); | |
189 | for(new i; i < sizeof AdmSysCmds; i++) strcat(AdmSysCmdsStr, AdmSysCmds[i]); | |
190 | SetTimer("UpdateMuteTime", 1000, 1); | |
191 | #if defined admsys_OnGameModeInit | |
192 | return admsys_OnGameModeInit(); | |
193 | #else | |
194 | return 1; | |
195 | #endif | |
196 | } | |
197 | ||
198 | #if defined _ALS_OnGameModeInit | |
199 | #undef OnGameModeInit | |
200 | #else | |
201 | #define _ALS_OnGameModeInit | |
202 | #endif | |
203 | #define OnGameModeInit admsys_OnGameModeInit | |
204 | #if defined admsys_OnGameModeInit | |
205 | forward admsys_OnGameModeInit(); | |
206 | #endif | |
207 | ||
208 | public OnGameModeExit() | |
209 | { | |
210 | print(" "); | |
211 | print(" Admin System by Nexius unloaded!"); | |
212 | print(" "); | |
213 | #if defined admsys_OnGameModeExit | |
214 | return admsys_OnGameModeExit(); | |
215 | #else | |
216 | return 1; | |
217 | #endif | |
218 | } | |
219 | ||
220 | #if defined _ALS_OnGameModeExit | |
221 | #undef OnGameModeExit | |
222 | #else | |
223 | #define _ALS_OnGameModeExit | |
224 | #endif | |
225 | #define OnGameModeExit admsys_OnGameModeExit | |
226 | #if defined admsys_OnGameModeExit | |
227 | forward admsys_OnGameModeExit(); | |
228 | #endif | |
229 | ||
230 | public OnPlayerConnect(playerid) | |
231 | { | |
232 | AdmSysInfo[playerid][asWarns] = 0; | |
233 | AdmSysInfo[playerid][asMuteTime] = 0; | |
234 | AdmSysInfo[playerid][asAdminLvl] = 0; | |
235 | AdmSysInfo[playerid][asUpdTimer] = -1; | |
236 | AdmSysInfo[playerid][asSpecID] = INVALID_PLAYER_ID; | |
237 | AdmSysInfo[playerid][asLastSpecID] = INVALID_PLAYER_ID; | |
238 | AdmSysInfo[playerid][asGmTestID] = INVALID_PLAYER_ID; | |
239 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
240 | AdmSysInfo[playerid][asIsSpawned] = false; | |
241 | AdmSysInfo[playerid][asIsDead] = false; | |
242 | AdmSysInfo[playerid][asGmTest] = false; | |
243 | #if ADMSYS_SEND_CONNECT_MSGS_TO_ADM | |
244 | new strtmp[78], sname[MAX_PLAYER_NAME + 1], sip[16]; | |
245 | GetPlayerName(playerid, sname, sizeof sname); | |
246 | GetPlayerIp(playerid, sip, sizeof sip); | |
247 | format(strtmp, sizeof strtmp, "[IP: %s] %s[%d] has joined the server", sip, sname, playerid); | |
248 | SendMessageToAdmins(1, ADMSYS_DEFAULT_COLOR, strtmp); | |
249 | #endif | |
250 | #if defined admsys_OnPlayerConnect | |
251 | return admsys_OnPlayerConnect(playerid); | |
252 | #else | |
253 | return 1; | |
254 | #endif | |
255 | } | |
256 | ||
257 | #if defined _ALS_OnPlayerConnect | |
258 | #undef OnPlayerConnect | |
259 | #else | |
260 | #define _ALS_OnPlayerConnect | |
261 | #endif | |
262 | #define OnPlayerConnect admsys_OnPlayerConnect | |
263 | #if defined admsys_OnPlayerConnect | |
264 | forward admsys_OnPlayerConnect(playerid); | |
265 | #endif | |
266 | ||
267 | public OnPlayerDisconnect(playerid, reason) | |
268 | { | |
269 | AdmSysInfo[playerid][asLastAction] = 0; | |
270 | KillTimer(AdmSysInfo[playerid][asUpdTimer]); | |
271 | #if defined foreach | |
272 | foreach(new i : Player) | |
273 | { | |
274 | #else | |
275 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
276 | { | |
277 | if(!IsPlayerConnected(i)) continue; | |
278 | #endif | |
279 | if(AdmSysInfo[i][asSpecID] == playerid) | |
280 | { | |
281 | SendClientMessage(i, ADMSYS_DEFAULT_COLOR, "Player has disconnected"); | |
282 | StopSpectating(i); | |
283 | } | |
284 | } | |
285 | #if defined admsys_OnPlayerDisconnect | |
286 | return admsys_OnPlayerDisconnect(playerid, reason); | |
287 | #else | |
288 | return 1; | |
289 | #endif | |
290 | } | |
291 | ||
292 | #if defined _ALS_OnPlayerDisconnect | |
293 | #undef OnPlayerDisconnect | |
294 | #else | |
295 | #define _ALS_OnPlayerDisconnect | |
296 | #endif | |
297 | #define OnPlayerDisconnect admsys_OnPlayerDisconnect | |
298 | #if defined admsys_OnPlayerDisconnect | |
299 | forward admsys_OnPlayerDisconnect(playerid, reason); | |
300 | #endif | |
301 | ||
302 | public OnPlayerSpawn(playerid) | |
303 | { | |
304 | if(IsPlayerSpectating(playerid)) | |
305 | { | |
306 | for(new i = 12; i >= 0; --i) | |
307 | GivePlayerWeapon(playerid, AdmSysInfo[playerid][asLastWeapon][i], AdmSysInfo[playerid][asLastAmmo][i]); | |
308 | SetPlayerPos(playerid, AdmSysInfo[playerid][asLastPos][0], | |
309 | AdmSysInfo[playerid][asLastPos][1], AdmSysInfo[playerid][asLastPos][2]); | |
310 | SetPlayerFacingAngle(playerid, AdmSysInfo[playerid][asLastAngle]); | |
311 | SetPlayerVirtualWorld(playerid, AdmSysInfo[playerid][asLastVW]); | |
312 | SetPlayerInterior(playerid, AdmSysInfo[playerid][asLastInt]); | |
313 | } | |
314 | AdmSysInfo[playerid][asSpecID] = INVALID_PLAYER_ID; | |
315 | AdmSysInfo[playerid][asLastSpecID] = INVALID_PLAYER_ID; | |
316 | AdmSysInfo[playerid][asIsSpawned] = true; | |
317 | AdmSysInfo[playerid][asLastSpec] = false; | |
318 | AdmSysInfo[playerid][asIsDead] = false; | |
319 | #if defined foreach | |
320 | foreach(new i : Player) | |
321 | { | |
322 | #else | |
323 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
324 | { | |
325 | if(!IsPlayerConnected(i)) continue; | |
326 | #endif | |
327 | if(AdmSysInfo[i][asSpecID] == playerid) UpdateSpectating(i); | |
328 | } | |
329 | #if defined admsys_OnPlayerSpawn | |
330 | return admsys_OnPlayerSpawn(playerid); | |
331 | #else | |
332 | return 1; | |
333 | #endif | |
334 | } | |
335 | ||
336 | #if defined _ALS_OnPlayerSpawn | |
337 | #undef OnPlayerSpawn | |
338 | #else | |
339 | #define _ALS_OnPlayerSpawn | |
340 | #endif | |
341 | #define OnPlayerSpawn admsys_OnPlayerSpawn | |
342 | #if defined admsys_OnPlayerSpawn | |
343 | forward admsys_OnPlayerSpawn(playerid); | |
344 | #endif | |
345 | ||
346 | public OnPlayerDeath(playerid, killerid, reason) | |
347 | { | |
348 | new interior, vw; | |
349 | interior = GetPlayerInterior(playerid); | |
350 | vw = GetPlayerVirtualWorld(playerid); | |
351 | #if defined foreach | |
352 | foreach(new i : Player) | |
353 | { | |
354 | #else | |
355 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
356 | { | |
357 | if(!IsPlayerConnected(i)) continue; | |
358 | #endif | |
359 | if(AdmSysInfo[i][asSpecID] == playerid) | |
360 | { | |
361 | SendClientMessage(i, ADMSYS_DEFAULT_COLOR, "Player has died"); | |
362 | SetPlayerInterior(i, interior); | |
363 | SetPlayerVirtualWorld(i, vw); | |
364 | } | |
365 | #if ADMSYS_SHOW_KILL_LIST_FOR_ADM | |
366 | if(IsPlayerAdminEx(i)) SendDeathMessageToPlayer(i, killerid, playerid, reason); | |
367 | #endif | |
368 | } | |
369 | AdmSysInfo[playerid][asIsSpawned] = false; | |
370 | AdmSysInfo[playerid][asIsDead] = true; | |
371 | #if defined admsys_OnPlayerDeath | |
372 | return admsys_OnPlayerDeath(playerid, killerid, reason); | |
373 | #else | |
374 | return 1; | |
375 | #endif | |
376 | } | |
377 | ||
378 | #if defined _ALS_OnPlayerDeath | |
379 | #undef OnPlayerDeath | |
380 | #else | |
381 | #define _ALS_OnPlayerDeath | |
382 | #endif | |
383 | #define OnPlayerDeath admsys_OnPlayerDeath | |
384 | #if defined admsys_OnPlayerDeath | |
385 | forward admsys_OnPlayerDeath(playerid, killerid, reason); | |
386 | #endif | |
387 | ||
388 | public OnPlayerText(playerid, text[]) | |
389 | { | |
390 | static strtmp[59]; | |
391 | if(AdmSysInfo[playerid][asMuteTime] > 0) | |
392 | { | |
393 | format(strtmp, sizeof strtmp, "You are muted. Remaining mute time: %d minutes %d seconds", | |
394 | floatround(AdmSysInfo[playerid][asMuteTime] / 60, floatround_tozero), AdmSysInfo[playerid][asMuteTime] % 60); | |
395 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
396 | return 0; | |
397 | } | |
398 | #if defined admsys_OnPlayerText | |
399 | return admsys_OnPlayerText(playerid, text); | |
400 | #else | |
401 | return 1; | |
402 | #endif | |
403 | } | |
404 | ||
405 | #if defined _ALS_OnPlayerText | |
406 | #undef OnPlayerText | |
407 | #else | |
408 | #define _ALS_OnPlayerText | |
409 | #endif | |
410 | #define OnPlayerText admsys_OnPlayerText | |
411 | #if defined admsys_OnPlayerText | |
412 | forward admsys_OnPlayerText(playerid, text[]); | |
413 | #endif | |
414 | ||
415 | #if !defined YCMD && !defined _I_ZCMD_INCLUDED | |
416 | public OnPlayerCommandText(playerid, cmdtext[]) | |
417 | { | |
418 | new cmd[32], pos; | |
419 | static params[126]; | |
420 | params[0] = EOS; | |
421 | while(cmdtext[pos] > ' ') | |
422 | { | |
423 | cmd[pos] = cmdtext[pos]; | |
424 | pos++; | |
425 | } | |
426 | while(cmdtext[pos] == ' ') | |
427 | { | |
428 | pos++; | |
429 | if(cmdtext[pos] == '\0') | |
430 | { | |
431 | params = "\1"; | |
432 | break; | |
433 | } | |
434 | } | |
435 | strcat(params, cmdtext[pos]); | |
436 | if(!strcmp(cmd, "/report", true)) return admsys_cmd_report(playerid, params); | |
437 | - | if(!strcmp(cmd, "/achat", true) || !strcmp(cmd, "/adminchat", true)) return admsys_cmd_achat(playerid, params); |
437 | + | if(!strcmp(cmd, "/achat", true) || !strcmp(cmd, "/admchat", true) || !strcmp(cmd, "/adminchat", true)) return admsys_cmd_achat(playerid, params); |
438 | - | if(!strcmp(cmd, "/ahelp", true) || !strcmp(cmd, "/adminhelp", true)) return admsys_cmd_ahelp(playerid, params); |
438 | + | if(!strcmp(cmd, "/ahelp", true) || !strcmp(cmd, "/admhelp", true) || !strcmp(cmd, "/adminhelp", true)) return admsys_cmd_ahelp(playerid, params); |
439 | if(!strcmp(cmd, "/showstats", true)) return admsys_cmd_showstats(playerid, params); | |
440 | if(!strcmp(cmd, "/answer", true)) return admsys_cmd_answer(playerid, params); | |
441 | - | if(!strcmp(cmd, "/apanel", true) || !strcmp(cmd, "/adminpanel", true)) return admsys_cmd_apanel(playerid, params); |
441 | + | if(!strcmp(cmd, "/apanel", true) || !strcmp(cmd, "/admpanel", true) || !strcmp(cmd, "/adminpanel", true)) return admsys_cmd_apanel(playerid, params); |
442 | if(!strcmp(cmd, "/admins", true)) return admsys_cmd_admins(playerid, params); | |
443 | if(!strcmp(cmd, "/eject", true)) return admsys_cmd_eject(playerid, params); | |
444 | ||
445 | if(!strcmp(cmd, "/spec", true)) return admsys_cmd_spec(playerid, params); | |
446 | if(!strcmp(cmd, "/specupdate", true)) return admsys_cmd_specupdate(playerid, params); | |
447 | if(!strcmp(cmd, "/specoff", true)) return admsys_cmd_specoff(playerid, params); | |
448 | - | if(!strcmp(cmd, "/spawnveh", true)) return admsys_cmd_spawnveh(playerid, params); |
448 | + | if(!strcmp(cmd, "/spawnveh", true) || !strcmp(cmd, "/spawnvehicle", true)) return admsys_cmd_spawnveh(playerid, params); |
449 | if(!strcmp(cmd, "/mute", true)) return admsys_cmd_mute(playerid, params); | |
450 | if(!strcmp(cmd, "/unmute", true)) return admsys_cmd_unmute(playerid, params); | |
451 | - | if(!strcmp(cmd, "/asay", true)) return admsys_cmd_asay(playerid, params); |
451 | + | if(!strcmp(cmd, "/asay", true) || !strcmp(cmd, "/admsay", true) || !strcmp(cmd, "/adminsay", true)) return admsys_cmd_asay(playerid, params); |
452 | if(!strcmp(cmd, "/warn", true)) return admsys_cmd_warn(playerid, params); | |
453 | if(!strcmp(cmd, "/kick", true)) return admsys_cmd_kick(playerid, params); | |
454 | if(!strcmp(cmd, "/freeze", true)) return admsys_cmd_freeze(playerid, params); | |
455 | if(!strcmp(cmd, "/unfreeze", true)) return admsys_cmd_unfreeze(playerid, params); | |
456 | if(!strcmp(cmd, "/slap", true)) return admsys_cmd_slap(playerid, params); | |
457 | if(!strcmp(cmd, "/goto", true)) return admsys_cmd_goto(playerid, params); | |
458 | ||
459 | if(!strcmp(cmd, "/suspectlist", true)) return admsys_cmd_suspectlist(playerid, params); | |
460 | if(!strcmp(cmd, "/gethere", true) || !strcmp(cmd, "/get", true)) return admsys_cmd_gethere(playerid, params); | |
461 | - | if(!strcmp(cmd, "/gotoveh", true)) return admsys_cmd_gotoveh(playerid, params); |
461 | + | if(!strcmp(cmd, "/gotoveh", true) || !strcmp(cmd, "/gotovehicle", true)) return admsys_cmd_gotoveh(playerid, params); |
462 | if(!strcmp(cmd, "/ban", true)) return admsys_cmd_ban(playerid, params); | |
463 | if(!strcmp(cmd, "/gmtest", true)) return admsys_cmd_gmtest(playerid, params); | |
464 | if(!strcmp(cmd, "/spawn", true)) return admsys_cmd_spawn(playerid, params); | |
465 | if(!strcmp(cmd, "/unwarn", true)) return admsys_cmd_unwarn(playerid, params); | |
466 | if(!strcmp(cmd, "/banip", true) || !strcmp(cmd, "/blockip", true)) return admsys_cmd_banip(playerid, params); | |
467 | if(!strcmp(cmd, "/cc", true) || !strcmp(cmd, "/clearchat", true)) return admsys_cmd_cc(playerid, params); | |
468 | ||
469 | if(!strcmp(cmd, "/sethealth", true)) return admsys_cmd_sethealth(playerid, params); | |
470 | if(!strcmp(cmd, "/setarmour", true)) return admsys_cmd_setarmour(playerid, params); | |
471 | if(!strcmp(cmd, "/setmoney", true)) return admsys_cmd_setmoney(playerid, params); | |
472 | if(!strcmp(cmd, "/setskin", true)) return admsys_cmd_setskin(playerid, params); | |
473 | if(!strcmp(cmd, "/setint", true) || !strcmp(cmd, "/setinterior", true)) return admsys_cmd_setint(playerid, params); | |
474 | if(!strcmp(cmd, "/setvw", true) || !strcmp(cmd, "/setvirtualworld", true)) return admsys_cmd_setvw(playerid, params); | |
475 | if(!strcmp(cmd, "/giveweapon", true)) return admsys_cmd_giveweapon(playerid, params); | |
476 | - | if(!strcmp(cmd, "/repairveh", true)) return admsys_cmd_repairveh(playerid, params); |
476 | + | if(!strcmp(cmd, "/repairveh", true) || !strcmp(cmd, "/repairvehicle", true)) return admsys_cmd_repairveh(playerid, params); |
477 | if(!strcmp(cmd, "/unbanip", true) || !strcmp(cmd, "/unblockip", true)) return admsys_cmd_unbanip(playerid, params); | |
478 | ||
479 | if(!strcmp(cmd, "/setweather", true)) return admsys_cmd_setweather(playerid, params); | |
480 | if(!strcmp(cmd, "/getall", true)) return admsys_cmd_getall(playerid, params); | |
481 | if(!strcmp(cmd, "/settime", true)) return admsys_cmd_settime(playerid, params); | |
482 | - | if(!strcmp(cmd, "/destroyveh", true)) return admsys_cmd_destroyveh(playerid, params); |
482 | + | if(!strcmp(cmd, "/destroyveh", true) || !strcmp(cmd, "/destroyvehicle", true)) return admsys_cmd_destroyveh(playerid, params); |
483 | if(!strcmp(cmd, "/veh", true) || !strcmp(cmd, "/vehicle", true)) return admsys_cmd_veh(playerid, params); | |
484 | - | if(!strcmp(cmd, "/sban", true)) return admsys_cmd_sban(playerid, params); |
484 | + | if(!strcmp(cmd, "/sban", true) || !strcmp(cmd, "/silentban", true)) return admsys_cmd_sban(playerid, params); |
485 | - | if(!strcmp(cmd, "/skick", true)) return admsys_cmd_skick(playerid, params); |
485 | + | if(!strcmp(cmd, "/skick", true) || !strcmp(cmd, "/silentkick", true)) return admsys_cmd_skick(playerid, params); |
486 | #if defined admsys_OnPlayerCommandText | |
487 | return admsys_OnPlayerCommandText(playerid, cmdtext); | |
488 | #else | |
489 | return 0; | |
490 | #endif | |
491 | } | |
492 | ||
493 | #if defined _ALS_OnPlayerCommandText | |
494 | #undef OnPlayerCommandText | |
495 | #else | |
496 | #define _ALS_OnPlayerCommandText | |
497 | #endif | |
498 | #define OnPlayerCommandText admsys_OnPlayerCommandText | |
499 | #if defined admsys_OnPlayerCommandText | |
500 | forward admsys_OnPlayerCommandText(playerid, cmdtext[]); | |
501 | #endif | |
502 | #endif | |
503 | ||
504 | public OnPlayerStateChange(playerid, newstate, oldstate) | |
505 | { | |
506 | if(newstate == PLAYER_STATE_SPECTATING) | |
507 | { | |
508 | #if defined foreach | |
509 | foreach(new i : Player) | |
510 | { | |
511 | #else | |
512 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
513 | { | |
514 | if(!IsPlayerConnected(i)) continue; | |
515 | #endif | |
516 | if(AdmSysInfo[i][asSpecID] == playerid) | |
517 | { | |
518 | SendClientMessage(i, ADMSYS_DEFAULT_COLOR, "Player is in spectator mode"); | |
519 | StopSpectating(i); | |
520 | } | |
521 | } | |
522 | } | |
523 | else if(PLAYER_STATE_DRIVER <= newstate <= PLAYER_STATE_PASSENGER || PLAYER_STATE_DRIVER <= oldstate <= PLAYER_STATE_PASSENGER) | |
524 | { | |
525 | #if defined foreach | |
526 | foreach(new i : Player) | |
527 | { | |
528 | #else | |
529 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
530 | { | |
531 | if(!IsPlayerConnected(i)) continue; | |
532 | #endif | |
533 | if(AdmSysInfo[i][asSpecID] == playerid) UpdateSpectating(i); | |
534 | } | |
535 | } | |
536 | #if defined admsys_OnPlayerStateChange | |
537 | return admsys_OnPlayerStateChange(playerid, newstate, oldstate); | |
538 | #else | |
539 | return 1; | |
540 | #endif | |
541 | } | |
542 | ||
543 | #if defined _ALS_OnPlayerStateChange | |
544 | #undef OnPlayerStateChange | |
545 | #else | |
546 | #define _ALS_OnPlayerStateChange | |
547 | #endif | |
548 | #define OnPlayerStateChange admsys_OnPlayerStateChange | |
549 | #if defined admsys_OnPlayerStateChange | |
550 | forward admsys_OnPlayerStateChange(playerid, newstate, oldstate); | |
551 | #endif | |
552 | ||
553 | public OnPlayerUpdate(playerid) | |
554 | { | |
555 | if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && | |
556 | AdmSysInfo[playerid][asSpecID] != INVALID_PLAYER_ID && AdmSysInfo[AdmSysInfo[playerid][asSpecID]][asIsDead]) | |
557 | { | |
558 | new Float:pX, Float:pY, Float:pZ, Float:cX, Float:cY, Float:cZ; | |
559 | GetPlayerCameraPos(AdmSysInfo[playerid][asSpecID], cX, cY, cZ); | |
560 | GetPlayerPos(AdmSysInfo[playerid][asSpecID], pX, pY, pZ); | |
561 | SetPlayerCameraPos(playerid, cX, cY, cZ); | |
562 | SetPlayerCameraLookAt(playerid, pX, pY, pZ); | |
563 | } | |
564 | #if defined admsys_OnPlayerUpdate | |
565 | return admsys_OnPlayerUpdate(playerid); | |
566 | #else | |
567 | return 1; | |
568 | #endif | |
569 | } | |
570 | ||
571 | #if defined _ALS_OnPlayerUpdate | |
572 | #undef OnPlayerUpdate | |
573 | #else | |
574 | #define _ALS_OnPlayerUpdate | |
575 | #endif | |
576 | #define OnPlayerUpdate admsys_OnPlayerUpdate | |
577 | #if defined admsys_OnPlayerUpdate | |
578 | forward admsys_OnPlayerUpdate(playerid); | |
579 | #endif | |
580 | ||
581 | public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) | |
582 | { | |
583 | switch(dialogid) | |
584 | { | |
585 | case ADMSYS_DIALOG_TAB_PANEL: | |
586 | { | |
587 | if(response) | |
588 | { | |
589 | static strtmp[3]; | |
590 | format(strtmp, sizeof strtmp, "%d", AdmSysInfo[playerid][asTabPanel]); | |
591 | switch(listitem) | |
592 | { | |
593 | case 0: admsys_cmd_showstats(playerid, strtmp); | |
594 | case 1: | |
595 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_ANSWER, DIALOG_STYLE_INPUT, "Respond on report", "Enter the answer to the report:", "Ok", "Close"); | |
596 | case 2: admsys_cmd_eject(playerid, strtmp); | |
597 | case 3: admsys_cmd_spec(playerid, strtmp); | |
598 | case 4: | |
599 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_MUTE_TIME, DIALOG_STYLE_INPUT, "Mute", "Enter mute time:", "Ok", "Close"); | |
600 | case 5: admsys_cmd_unmute(playerid, strtmp); | |
601 | case 6: | |
602 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_WARN, DIALOG_STYLE_INPUT, "Give warn", "Enter the reason of the warn:", "Ok", "Close"); | |
603 | case 7: | |
604 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_KICK, DIALOG_STYLE_INPUT, "Kick", "Enter the reason of kick:", "Ok", "Close"); | |
605 | case 8: admsys_cmd_freeze(playerid, strtmp); | |
606 | case 9: admsys_cmd_unfreeze(playerid, strtmp); | |
607 | case 10: | |
608 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SLAP, DIALOG_STYLE_INPUT, "Slap", "Enter the reason of slap:", "Ok", "Close"); | |
609 | case 11: admsys_cmd_goto(playerid, strtmp); | |
610 | case 12: admsys_cmd_gethere(playerid, strtmp); | |
611 | case 13: | |
612 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_BAN, DIALOG_STYLE_INPUT, "Ban", "Enter the reason of ban:", "Ok", "Close"); | |
613 | case 14: admsys_cmd_gmtest(playerid, strtmp); | |
614 | case 15: admsys_cmd_spawn(playerid, strtmp); | |
615 | case 16: admsys_cmd_unwarn(playerid, strtmp); | |
616 | case 17: | |
617 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_HEALTH, DIALOG_STYLE_INPUT, "Set health", "Enter the amount of health you want to set:", "Ok", "Close"); | |
618 | case 18: | |
619 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_ARMOUR, DIALOG_STYLE_INPUT, "Set armour", "Enter the amount of armour you want to set:", "Ok", "Close"); | |
620 | case 19: | |
621 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_MONEY, DIALOG_STYLE_INPUT, "Set money", "Enter the amount of money you want to set:", "Ok", "Close"); | |
622 | case 20: | |
623 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_CHANGE_SKIN, DIALOG_STYLE_INPUT, "Set skin", "Enter the ID of the skin you want to set:", "Ok", "Close"); | |
624 | case 21: | |
625 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_INT, DIALOG_STYLE_INPUT, "Set interior", "Enter the ID of the interior you want to set:", "Ok", "Close"); | |
626 | case 22: | |
627 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_VW, DIALOG_STYLE_INPUT, "Set virtual world", "Enter the ID of the virtual world you want to set:", "Ok", "Close"); | |
628 | case 23: | |
629 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GIVE_WEAPON, DIALOG_STYLE_INPUT, "Give weapon", "Enter the ID of the weapon you want to give:", "Ok", "Close"); | |
630 | case 24: admsys_cmd_sban(playerid, strtmp); | |
631 | case 25: admsys_cmd_skick(playerid, strtmp); | |
632 | } | |
633 | } | |
634 | return 1; | |
635 | } | |
636 | case ADMSYS_DIALOG_ANSWER: | |
637 | { | |
638 | if(response) | |
639 | { | |
640 | if(admsys_isnull(inputtext)) | |
641 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_ANSWER, DIALOG_STYLE_INPUT, "Respond on report", "Enter the answer to the report:", "Ok", "Close"); | |
642 | else | |
643 | { | |
644 | static strtmp[145]; | |
645 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
646 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
647 | admsys_cmd_answer(playerid, strtmp); | |
648 | } | |
649 | } | |
650 | return 1; | |
651 | } | |
652 | case ADMSYS_DIALOG_MUTE_TIME: | |
653 | { | |
654 | if(response) | |
655 | { | |
656 | if(admsys_isnull(inputtext)) | |
657 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_MUTE_TIME, DIALOG_STYLE_INPUT, "Mute", "Enter mute time:", "Ok", "Close"); | |
658 | else | |
659 | { | |
660 | format(AdmSysInfo[playerid][asInput], ADMSYS_MAX_TAB_INPUT, "%s", inputtext); | |
661 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_MUTE, DIALOG_STYLE_INPUT, "Mute", "Enter the reason of mute:", "Ok", "Back"); | |
662 | } | |
663 | } | |
664 | return 1; | |
665 | } | |
666 | case ADMSYS_DIALOG_MUTE: | |
667 | { | |
668 | if(response) | |
669 | { | |
670 | if(admsys_isnull(inputtext)) | |
671 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_MUTE, DIALOG_STYLE_INPUT, "Mute", "Enter the reason of mute:", "Ok", "Back"); | |
672 | else | |
673 | { | |
674 | static strtmp[145]; | |
675 | format(strtmp, sizeof strtmp, "%d %s %s", AdmSysInfo[playerid][asTabPanel], AdmSysInfo[playerid][asInput], inputtext); | |
676 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
677 | admsys_cmd_mute(playerid, strtmp); | |
678 | } | |
679 | } | |
680 | else ShowPlayerDialog(playerid, ADMSYS_DIALOG_MUTE_TIME, DIALOG_STYLE_INPUT, "Mute", "Enter the time of mute:", "Ok", "Close"); | |
681 | return 1; | |
682 | } | |
683 | case ADMSYS_DIALOG_WARN: | |
684 | { | |
685 | if(response) | |
686 | { | |
687 | if(admsys_isnull(inputtext)) | |
688 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_WARN, DIALOG_STYLE_INPUT, "Give warn", "Enter the reason of the warn:", "Ok", "Close"); | |
689 | else | |
690 | { | |
691 | static strtmp[145]; | |
692 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
693 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
694 | admsys_cmd_warn(playerid, strtmp); | |
695 | } | |
696 | } | |
697 | return 1; | |
698 | } | |
699 | case ADMSYS_DIALOG_KICK: | |
700 | { | |
701 | if(response) | |
702 | { | |
703 | if(admsys_isnull(inputtext)) | |
704 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_KICK, DIALOG_STYLE_INPUT, "Kick", "Enter the reason of kick:", "Ok", "Close"); | |
705 | else | |
706 | { | |
707 | static strtmp[145]; | |
708 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
709 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
710 | admsys_cmd_kick(playerid, strtmp); | |
711 | } | |
712 | } | |
713 | return 1; | |
714 | } | |
715 | case ADMSYS_DIALOG_SLAP: | |
716 | { | |
717 | if(response) | |
718 | { | |
719 | if(admsys_isnull(inputtext)) | |
720 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SLAP, DIALOG_STYLE_INPUT, "Slap", "Enter the reason of slap:", "Ok", "Close"); | |
721 | else | |
722 | { | |
723 | static strtmp[145]; | |
724 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
725 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
726 | admsys_cmd_slap(playerid, strtmp); | |
727 | } | |
728 | } | |
729 | return 1; | |
730 | } | |
731 | case ADMSYS_DIALOG_BAN: | |
732 | { | |
733 | if(response) | |
734 | { | |
735 | if(admsys_isnull(inputtext)) | |
736 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_BAN, DIALOG_STYLE_INPUT, "Ban", "Enter the reason of ban:", "Ok", "Close"); | |
737 | else | |
738 | { | |
739 | static strtmp[145]; | |
740 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
741 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
742 | admsys_cmd_ban(playerid, strtmp); | |
743 | } | |
744 | } | |
745 | return 1; | |
746 | } | |
747 | case ADMSYS_DIALOG_SET_HEALTH: | |
748 | { | |
749 | if(response) | |
750 | { | |
751 | if(admsys_isnull(inputtext)) | |
752 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_HEALTH, DIALOG_STYLE_INPUT, "Set health", "Enter the amount of health you want to set:", "Ok", "Close"); | |
753 | else | |
754 | { | |
755 | static strtmp[32]; | |
756 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
757 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
758 | admsys_cmd_sethealth(playerid, strtmp); | |
759 | } | |
760 | } | |
761 | return 1; | |
762 | } | |
763 | case ADMSYS_DIALOG_SET_ARMOUR: | |
764 | { | |
765 | if(response) | |
766 | { | |
767 | if(admsys_isnull(inputtext)) | |
768 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_ARMOUR, DIALOG_STYLE_INPUT, "Set armour", "Enter the amount of armour you want to set:", "Ok", "Close"); | |
769 | else | |
770 | { | |
771 | static strtmp[32]; | |
772 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
773 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
774 | admsys_cmd_setarmour(playerid, strtmp); | |
775 | } | |
776 | } | |
777 | return 1; | |
778 | } | |
779 | case ADMSYS_DIALOG_SET_MONEY: | |
780 | { | |
781 | if(response) | |
782 | { | |
783 | if(admsys_isnull(inputtext)) | |
784 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_MONEY, DIALOG_STYLE_INPUT, "Set money", "Enter the amount of money you want to set:", "Ok", "Close"); | |
785 | else | |
786 | { | |
787 | static strtmp[32]; | |
788 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
789 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
790 | admsys_cmd_setmoney(playerid, strtmp); | |
791 | } | |
792 | } | |
793 | return 1; | |
794 | } | |
795 | case ADMSYS_DIALOG_CHANGE_SKIN: | |
796 | { | |
797 | if(response) | |
798 | { | |
799 | if(admsys_isnull(inputtext)) | |
800 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_CHANGE_SKIN, DIALOG_STYLE_INPUT, "Set skin", "Enter the ID of the skin you want to set:", "Ok", "Close"); | |
801 | else | |
802 | { | |
803 | static strtmp[32]; | |
804 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
805 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
806 | admsys_cmd_setskin(playerid, strtmp); | |
807 | } | |
808 | } | |
809 | return 1; | |
810 | } | |
811 | case ADMSYS_DIALOG_SET_INT: | |
812 | { | |
813 | if(response) | |
814 | { | |
815 | if(admsys_isnull(inputtext)) | |
816 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_INT, DIALOG_STYLE_INPUT, "Set interior", "Enter the ID of the interior you want to set:", "Ok", "Close"); | |
817 | else | |
818 | { | |
819 | static strtmp[32]; | |
820 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
821 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
822 | admsys_cmd_setint(playerid, strtmp); | |
823 | } | |
824 | } | |
825 | return 1; | |
826 | } | |
827 | case ADMSYS_DIALOG_SET_VW: | |
828 | { | |
829 | if(response) | |
830 | { | |
831 | if(admsys_isnull(inputtext)) | |
832 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_VW, DIALOG_STYLE_INPUT, "Set virtual world", "Enter the ID of the virtual world you want to set:", "Ok", "Close"); | |
833 | else | |
834 | { | |
835 | static strtmp[32]; | |
836 | format(strtmp, sizeof strtmp, "%d %s", AdmSysInfo[playerid][asTabPanel], inputtext); | |
837 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
838 | admsys_cmd_setvw(playerid, strtmp); | |
839 | } | |
840 | } | |
841 | return 1; | |
842 | } | |
843 | case ADMSYS_DIALOG_GIVE_WEAPON: | |
844 | { | |
845 | if(response) | |
846 | { | |
847 | if(admsys_isnull(inputtext)) | |
848 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GIVE_WEAPON, DIALOG_STYLE_INPUT, "Give weapon", "Enter the ID of the weapon you want to give:", "Ok", "Close"); | |
849 | else | |
850 | { | |
851 | format(AdmSysInfo[playerid][asInput], ADMSYS_MAX_TAB_INPUT, "%s", inputtext); | |
852 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GIVE_WEAPON_AMMO, DIALOG_STYLE_INPUT, "Give weapon", "Enter the number of ammo you want to give:", "Ok", "Back"); | |
853 | } | |
854 | } | |
855 | return 1; | |
856 | } | |
857 | case ADMSYS_DIALOG_GIVE_WEAPON_AMMO: | |
858 | { | |
859 | if(response) | |
860 | { | |
861 | if(admsys_isnull(inputtext)) | |
862 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GIVE_WEAPON_AMMO, DIALOG_STYLE_INPUT, "Give weapon", "Enter the number of ammo you want to give:", "Ok", "Back"); | |
863 | else | |
864 | { | |
865 | static strtmp[32]; | |
866 | format(strtmp, sizeof strtmp, "%d %s %s", AdmSysInfo[playerid][asTabPanel], AdmSysInfo[playerid][asInput], inputtext); | |
867 | AdmSysInfo[playerid][asTabPanel] = INVALID_PLAYER_ID; | |
868 | admsys_cmd_giveweapon(playerid, strtmp); | |
869 | } | |
870 | } | |
871 | else ShowPlayerDialog(playerid, ADMSYS_DIALOG_GIVE_WEAPON, DIALOG_STYLE_INPUT, "Give weapon", "Enter the ID of the weapon you want to give:", "Ok", "Close"); | |
872 | return 1; | |
873 | } | |
874 | case ADMSYS_DIALOG_APANEL: | |
875 | { | |
876 | if(response) | |
877 | { | |
878 | switch(listitem) | |
879 | { | |
880 | case 0: | |
881 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_ACHAT, DIALOG_STYLE_INPUT, "Admin chat", "Write your message:", "Ok", "Close"); | |
882 | case 1: admsys_cmd_ahelp(playerid, "\1"); | |
883 | case 2: admsys_cmd_admins(playerid, "\1"); | |
884 | case 3: | |
885 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SPAWN_VEH, DIALOG_STYLE_INPUT, "Teleport vehicle to respawn", "Enter the ID of vehicle you want to spawn:", "Ok", "Close"); | |
886 | case 4: | |
887 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_ASAY, DIALOG_STYLE_INPUT, "Message from admin", "Write your message:", "Ok", "Close"); | |
888 | case 5: admsys_cmd_suspectlist(playerid, "\1"); | |
889 | case 6: | |
890 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GOTO_VEH, DIALOG_STYLE_INPUT, "Teleport to vehicle", "Enter the ID of vehicle you want to teleport to:", "Ok", "Close"); | |
891 | case 7: | |
892 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_BAN_IP, DIALOG_STYLE_INPUT, "Block IP address", "Enter the IP address you want to block:", "Ok", "Close"); | |
893 | case 8: admsys_cmd_cc(playerid, "\1"); | |
894 | case 9: | |
895 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_REPAIR_VEH, DIALOG_STYLE_INPUT, "Repair vehicle", "Enter the ID of vehicle you want to repair:", "Ok", "Close"); | |
896 | case 10: | |
897 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_UNBAN_IP, DIALOG_STYLE_INPUT, "Unblock IP address", "Enter the IP address you want to unblock:", "Ok", "Close"); | |
898 | case 11: admsys_cmd_getall(playerid, "\1"); | |
899 | case 12: | |
900 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_WEATHER, DIALOG_STYLE_INPUT, "Set weather", "Enter the ID of the weather you want to set:", "Ok", "Close"); | |
901 | case 13: | |
902 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_TIME, DIALOG_STYLE_INPUT, "Set the time of day", "Enter the hour you want to set:", "Ok", "Close"); | |
903 | case 14: | |
904 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_DESTROY_VEH, DIALOG_STYLE_INPUT, "Destroy vehicle", "Enter the ID of vehicle you want to destroy:", "Ok", "Close"); | |
905 | case 15: | |
906 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_CREATE_VEH, DIALOG_STYLE_INPUT, "Create vehicle", "Enter vehicle model you want to create:", "Ok", "Close"); | |
907 | case 16: | |
908 | { | |
909 | if(AdmSysInfo[playerid][asLastAction]) | |
910 | { | |
911 | switch(AdmSysInfo[playerid][asLastAction]) | |
912 | { | |
913 | case 1: SetPlayerHealth(AdmSysInfo[playerid][asLastActionID], AdmSysInfo[playerid][asLastFloatData]); | |
914 | case 2: SetPlayerArmour(AdmSysInfo[playerid][asLastActionID], AdmSysInfo[playerid][asLastFloatData]); | |
915 | case 3: | |
916 | { | |
917 | ResetPlayerMoney(AdmSysInfo[playerid][asLastActionID]); | |
918 | GivePlayerMoney(AdmSysInfo[playerid][asLastActionID], AdmSysInfo[playerid][asLastIntData][0]); | |
919 | } | |
920 | case 4: SetPlayerSkin(AdmSysInfo[playerid][asLastActionID], AdmSysInfo[playerid][asLastIntData][0]); | |
921 | case 5: SetPlayerInterior(AdmSysInfo[playerid][asLastActionID], AdmSysInfo[playerid][asLastIntData][0]); | |
922 | case 6: SetPlayerVirtualWorld(AdmSysInfo[playerid][asLastActionID], AdmSysInfo[playerid][asLastIntData][0]); | |
923 | case 7: | |
924 | GivePlayerWeapon(AdmSysInfo[playerid][asLastActionID], AdmSysInfo[playerid][asLastIntData][0], -AdmSysInfo[playerid][asLastIntData][1]); | |
925 | } | |
926 | AdmSysInfo[playerid][asLastAction] = 0; | |
927 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "The command canceled"); | |
928 | } | |
929 | } | |
930 | } | |
931 | } | |
932 | return 1; | |
933 | } | |
934 | case ADMSYS_DIALOG_ACHAT: | |
935 | { | |
936 | if(response) | |
937 | { | |
938 | if(admsys_isnull(inputtext)) | |
939 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_ACHAT, DIALOG_STYLE_INPUT, "Admin chat", "Write your message:", "Ok", "Close"); | |
940 | else admsys_cmd_achat(playerid, inputtext); | |
941 | } | |
942 | return 1; | |
943 | } | |
944 | case ADMSYS_DIALOG_SPAWN_VEH: | |
945 | { | |
946 | if(response) | |
947 | { | |
948 | if(admsys_isnull(inputtext)) admsys_cmd_spawnveh(playerid, "\1"); | |
949 | else admsys_cmd_spawnveh(playerid, inputtext); | |
950 | } | |
951 | return 1; | |
952 | } | |
953 | case ADMSYS_DIALOG_ASAY: | |
954 | { | |
955 | if(response) | |
956 | { | |
957 | if(admsys_isnull(inputtext)) | |
958 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_ASAY, DIALOG_STYLE_INPUT, "Message from admin", "Write your message:", "Ok", "Close"); | |
959 | else admsys_cmd_asay(playerid, inputtext); | |
960 | } | |
961 | return 1; | |
962 | } | |
963 | case ADMSYS_DIALOG_GOTO_VEH: | |
964 | { | |
965 | if(response) | |
966 | { | |
967 | if(admsys_isnull(inputtext)) | |
968 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GOTO_VEH, DIALOG_STYLE_INPUT, "Teleport to vehicle", "Enter the ID of vehicle you want to teleport to:", "Ok", "Close"); | |
969 | else admsys_cmd_gotoveh(playerid, inputtext); | |
970 | } | |
971 | return 1; | |
972 | } | |
973 | case ADMSYS_DIALOG_BAN_IP: | |
974 | { | |
975 | if(response) | |
976 | { | |
977 | if(admsys_isnull(inputtext)) | |
978 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_BAN_IP, DIALOG_STYLE_INPUT, "Block IP address", "Enter the IP address you want to block:", "Ok", "Close"); | |
979 | else admsys_cmd_banip(playerid, inputtext); | |
980 | } | |
981 | return 1; | |
982 | } | |
983 | case ADMSYS_DIALOG_REPAIR_VEH: | |
984 | { | |
985 | if(response) | |
986 | { | |
987 | if(admsys_isnull(inputtext)) admsys_cmd_repairveh(playerid, "\1"); | |
988 | else admsys_cmd_repairveh(playerid, inputtext); | |
989 | } | |
990 | return 1; | |
991 | } | |
992 | case ADMSYS_DIALOG_UNBAN_IP: | |
993 | { | |
994 | if(response) | |
995 | { | |
996 | if(admsys_isnull(inputtext)) | |
997 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_UNBAN_IP, DIALOG_STYLE_INPUT, "Unblock IP address", "Enter the IP address you want to unblock:", "Ok", "Close"); | |
998 | else admsys_cmd_unbanip(playerid, inputtext); | |
999 | } | |
1000 | return 1; | |
1001 | } | |
1002 | case ADMSYS_DIALOG_SET_WEATHER: | |
1003 | { | |
1004 | if(response) | |
1005 | { | |
1006 | if(admsys_isnull(inputtext)) | |
1007 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_WEATHER, DIALOG_STYLE_INPUT, "Set weather", "Enter the ID of the weather you want to set:", "Ok", "Close"); | |
1008 | else admsys_cmd_setweather(playerid, inputtext); | |
1009 | } | |
1010 | return 1; | |
1011 | } | |
1012 | case ADMSYS_DIALOG_SET_TIME: | |
1013 | { | |
1014 | if(response) | |
1015 | { | |
1016 | if(admsys_isnull(inputtext)) | |
1017 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_SET_TIME, DIALOG_STYLE_INPUT, "Set the time of day", "Enter the hour you want to set:", "Ok", "Close"); | |
1018 | else admsys_cmd_settime(playerid, inputtext); | |
1019 | } | |
1020 | return 1; | |
1021 | } | |
1022 | case ADMSYS_DIALOG_DESTROY_VEH: | |
1023 | { | |
1024 | if(response) | |
1025 | { | |
1026 | if(admsys_isnull(inputtext)) admsys_cmd_destroyveh(playerid, "\1"); | |
1027 | else admsys_cmd_destroyveh(playerid, inputtext); | |
1028 | } | |
1029 | return 1; | |
1030 | } | |
1031 | case ADMSYS_DIALOG_CREATE_VEH: | |
1032 | { | |
1033 | if(response) | |
1034 | { | |
1035 | if(admsys_isnull(inputtext)) | |
1036 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_CREATE_VEH, DIALOG_STYLE_INPUT, "Create vehicle", "Enter vehicle model you want to create:", "Ok", "Close"); | |
1037 | else | |
1038 | { | |
1039 | format(AdmSysInfo[playerid][asInput], ADMSYS_MAX_TAB_INPUT, "%s", inputtext); | |
1040 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_CREATE_VEH_COL_1, DIALOG_STYLE_INPUT, "Create vehicle", "Enter the color 1 for vehicle you want to create:", "Ok", "Back"); | |
1041 | } | |
1042 | } | |
1043 | return 1; | |
1044 | } | |
1045 | case ADMSYS_DIALOG_CREATE_VEH_COL_1: | |
1046 | { | |
1047 | if(response) | |
1048 | { | |
1049 | if(admsys_isnull(inputtext)) admsys_cmd_veh(playerid, AdmSysInfo[playerid][asInput]); | |
1050 | else | |
1051 | { | |
1052 | format(AdmSysInfo[playerid][asInput2], ADMSYS_MAX_TAB_INPUT, "%s", inputtext); | |
1053 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_CREATE_VEH_COL_2, DIALOG_STYLE_INPUT, "Create vehicle", "Enter the color 2 for vehicle you want to create:", "Ok", "Back"); | |
1054 | } | |
1055 | } | |
1056 | else ShowPlayerDialog(playerid, ADMSYS_DIALOG_CREATE_VEH, DIALOG_STYLE_INPUT, "Create vehicle", "Enter vehicle model you want to create:", "Ok", "Close"); | |
1057 | return 1; | |
1058 | } | |
1059 | case ADMSYS_DIALOG_CREATE_VEH_COL_2: | |
1060 | { | |
1061 | if(response) | |
1062 | { | |
1063 | if(admsys_isnull(inputtext)) | |
1064 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_CREATE_VEH_COL_2, DIALOG_STYLE_INPUT, "Create vehicle", "Enter the color 2 for vehicle you want to create:", "Ok", "Back"); | |
1065 | else | |
1066 | { | |
1067 | static strtmp[32]; | |
1068 | format(strtmp, sizeof strtmp, "%s %s %s", AdmSysInfo[playerid][asInput], AdmSysInfo[playerid][asInput2], inputtext); | |
1069 | admsys_cmd_veh(playerid, strtmp); | |
1070 | } | |
1071 | } | |
1072 | else ShowPlayerDialog(playerid, ADMSYS_DIALOG_CREATE_VEH_COL_1, DIALOG_STYLE_INPUT, "Create vehicle", "Enter the color 1 for vehicle you want to create:", "Ok", "Back"); | |
1073 | return 1; | |
1074 | } | |
1075 | case ADMSYS_DIALOG_SUSPECT_LIST: | |
1076 | { | |
1077 | if(response && 0 <= listitem < sizeof SuspectList) | |
1078 | { | |
1079 | if(!StartSpectating(playerid, SuspectList[listitem])) | |
1080 | { | |
1081 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player has disconnected"); | |
1082 | admsys_cmd_suspectlist(playerid, "\1"); | |
1083 | } | |
1084 | else if(AdmSysInfo[playerid][asSpecID] == SuspectList[listitem]) RemovePlayerFromSuspectList(SuspectList[listitem]); | |
1085 | else admsys_cmd_suspectlist(playerid, "\1"); | |
1086 | } | |
1087 | return 1; | |
1088 | } | |
1089 | } | |
1090 | #if defined admsys_OnDialogResponse | |
1091 | return admsys_OnDialogResponse(playerid, dialogid, response, listitem, inputtext); | |
1092 | #else | |
1093 | return 0; | |
1094 | #endif | |
1095 | } | |
1096 | ||
1097 | #if defined _ALS_OnDialogResponse | |
1098 | #undef OnDialogResponse | |
1099 | #else | |
1100 | #define _ALS_OnDialogResponse | |
1101 | #endif | |
1102 | #define OnDialogResponse admsys_OnDialogResponse | |
1103 | #if defined admsys_OnDialogResponse | |
1104 | forward admsys_OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]); | |
1105 | #endif | |
1106 | ||
1107 | public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) | |
1108 | { | |
1109 | #if defined foreach | |
1110 | foreach(new i : Player) | |
1111 | { | |
1112 | #else | |
1113 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
1114 | { | |
1115 | if(!IsPlayerConnected(i)) continue; | |
1116 | #endif | |
1117 | if(AdmSysInfo[i][asSpecID] == playerid) UpdateSpectating(i); | |
1118 | } | |
1119 | #if defined admsys_OnPlayerInteriorChange | |
1120 | return admsys_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid); | |
1121 | #else | |
1122 | return 1; | |
1123 | #endif | |
1124 | } | |
1125 | ||
1126 | #if defined _ALS_OnPlayerInteriorChange | |
1127 | #undef OnPlayerInteriorChange | |
1128 | #else | |
1129 | #define _ALS_OnPlayerInteriorChange | |
1130 | #endif | |
1131 | #define OnPlayerInteriorChange admsys_OnPlayerInteriorChange | |
1132 | #if defined admsys_OnPlayerInteriorChange | |
1133 | forward admsys_OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid); | |
1134 | #endif | |
1135 | ||
1136 | public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) | |
1137 | { | |
1138 | if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && AdmSysInfo[playerid][asSpecID] != INVALID_PLAYER_ID) | |
1139 | { | |
1140 | if(newkeys & KEY_ANALOG_LEFT) | |
1141 | { | |
1142 | new ud = AdmSysInfo[playerid][asSpecID]; | |
1143 | AdmSysInfo[playerid][asSpecID]--; | |
1144 | while(!IsPlayerConnected(AdmSysInfo[playerid][asSpecID]) || IsPlayerSpectating(AdmSysInfo[playerid][asSpecID]) || AdmSysInfo[playerid][asSpecID] == playerid) | |
1145 | { | |
1146 | AdmSysInfo[playerid][asSpecID]--; | |
1147 | if(AdmSysInfo[playerid][asSpecID] < 0) AdmSysInfo[playerid][asSpecID] = GetPlayerPoolSize(); | |
1148 | if(AdmSysInfo[playerid][asSpecID] == ud) break; | |
1149 | } | |
1150 | if(AdmSysInfo[playerid][asSpecID] != ud) UpdateSpectating(playerid); | |
1151 | } | |
1152 | else if(newkeys & KEY_ANALOG_RIGHT) | |
1153 | { | |
1154 | new ud = AdmSysInfo[playerid][asSpecID]; | |
1155 | AdmSysInfo[playerid][asSpecID]++; | |
1156 | while(!IsPlayerConnected(AdmSysInfo[playerid][asSpecID]) || IsPlayerSpectating(AdmSysInfo[playerid][asSpecID]) || AdmSysInfo[playerid][asSpecID] == playerid) | |
1157 | { | |
1158 | AdmSysInfo[playerid][asSpecID]++; | |
1159 | if(AdmSysInfo[playerid][asSpecID] > GetPlayerPoolSize()) AdmSysInfo[playerid][asSpecID] = 0; | |
1160 | if(AdmSysInfo[playerid][asSpecID] == ud) break; | |
1161 | } | |
1162 | if(AdmSysInfo[playerid][asSpecID] != ud) UpdateSpectating(playerid); | |
1163 | } | |
1164 | } | |
1165 | #if defined admsys_OnPlayerKeyStateChange | |
1166 | return admsys_OnPlayerKeyStateChange(playerid, newkeys, oldkeys); | |
1167 | #else | |
1168 | return 1; | |
1169 | #endif | |
1170 | } | |
1171 | ||
1172 | #if defined _ALS_OnPlayerKeyStateChange | |
1173 | #undef OnPlayerKeyStateChange | |
1174 | #else | |
1175 | #define _ALS_OnPlayerKeyStateChange | |
1176 | #endif | |
1177 | #define OnPlayerKeyStateChange admsys_OnPlayerKeyStateChange | |
1178 | #if defined admsys_OnPlayerKeyStateChange | |
1179 | forward admsys_OnPlayerKeyStateChange(playerid, newkeys, oldkeys); | |
1180 | #endif | |
1181 | ||
1182 | public OnPlayerClickPlayer(playerid, clickedplayerid, source) | |
1183 | { | |
1184 | if(IsPlayerAdminEx(playerid)) | |
1185 | { | |
1186 | static strtmp[351], strtmp2[43], strname[MAX_PLAYER_NAME + 1]; | |
1187 | strtmp[0] = EOS; | |
1188 | AdmSysInfo[playerid][asTabPanel] = clickedplayerid; | |
1189 | GetPlayerName(clickedplayerid, strname, sizeof strname); | |
1190 | format(strtmp2, sizeof strtmp2, "Admin panel for %s", strname); | |
1191 | strcat(strtmp, "Show statistics\nRespond on report\nRemove from vehicle"); | |
1192 | if(IsPlayerAdminEx(playerid, 2)) strcat(strtmp, "\nBegin spectate\n\ | |
1193 | Mute\nUnmute\nGive warn\nKick\nFreeze\nUnfreeze\nSlap\nTeleport to player"); | |
1194 | if(IsPlayerAdminEx(playerid, 3)) strcat(strtmp, "\nTeleport to yourself\nBan\n\ | |
1195 | Check for infinite health\nTeleport to respawn\nRemove warn"); | |
1196 | if(IsPlayerAdminEx(playerid, 4)) strcat(strtmp, "\nSet health\nSet armour\nSet money\n\ | |
1197 | Set skin\nSet interior\nSet virtual world\nGive weapon"); | |
1198 | if(IsPlayerAdminEx(playerid, 5)) strcat(strtmp, "\nSilent ban\nSilent kick"); | |
1199 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_TAB_PANEL, DIALOG_STYLE_LIST, strtmp2, strtmp, "Ok", "Close"); | |
1200 | } | |
1201 | #if defined admsys_OnPlayerClickPlayer | |
1202 | return admsys_OnPlayerClickPlayer(playerid, clickedplayerid, source); | |
1203 | #else | |
1204 | return 0; | |
1205 | #endif | |
1206 | } | |
1207 | ||
1208 | #if defined _ALS_OnPlayerClickPlayer | |
1209 | #undef OnPlayerClickPlayer | |
1210 | #else | |
1211 | #define _ALS_OnPlayerClickPlayer | |
1212 | #endif | |
1213 | #define OnPlayerClickPlayer admsys_OnPlayerClickPlayer | |
1214 | #if defined admsys_OnPlayerClickPlayer | |
1215 | forward admsys_OnPlayerClickPlayer(playerid, clickedplayerid, source); | |
1216 | #endif | |
1217 | ||
1218 | admsys_fpublic BanWithDelay(playerid) return Ban(playerid); | |
1219 | ||
1220 | admsys_fpublic KickWithDelay(playerid) return Kick(playerid); | |
1221 | ||
1222 | admsys_fpublic UpdateMuteTime() | |
1223 | { | |
1224 | #if defined foreach | |
1225 | foreach(new i : Player) | |
1226 | { | |
1227 | #else | |
1228 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
1229 | { | |
1230 | if(!IsPlayerConnected(i)) continue; | |
1231 | #endif | |
1232 | if(AdmSysInfo[i][asMuteTime] > 0) | |
1233 | { | |
1234 | AdmSysInfo[i][asMuteTime]--; | |
1235 | if(AdmSysInfo[i][asMuteTime] < 1) | |
1236 | SendClientMessage(i, ADMSYS_DEFAULT_COLOR, "Mute time has expired"); | |
1237 | } | |
1238 | } | |
1239 | return 1; | |
1240 | } | |
1241 | ||
1242 | admsys_fpublic UpdateSpecInfo(playerid) | |
1243 | { | |
1244 | if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING && AdmSysInfo[playerid][asSpecID] != INVALID_PLAYER_ID) | |
1245 | { | |
1246 | static strtmp[100], sname[MAX_PLAYER_NAME + 1], sip[16]; | |
1247 | GetPlayerIp(AdmSysInfo[playerid][asSpecID], sip, sizeof sip); | |
1248 | GetPlayerName(AdmSysInfo[playerid][asSpecID], sname, sizeof sname); | |
1249 | format(strtmp, sizeof strtmp, "~w~~n~~n~~n~~n~~n~~n~Nick: %s~n~ID: %d~n~IP: %s~n~Ping: %d", | |
1250 | sname, AdmSysInfo[playerid][asSpecID], sip, GetPlayerPing(AdmSysInfo[playerid][asSpecID])); | |
1251 | SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(AdmSysInfo[playerid][asSpecID])); | |
1252 | AdmSysInfo[playerid][asUpdTimer] = SetTimerEx("UpdateSpecInfo", 1000, false, "d", playerid); | |
1253 | GameTextForPlayer(playerid, strtmp, 1500, 3); | |
1254 | return 1; | |
1255 | } | |
1256 | return 0; | |
1257 | } | |
1258 | ||
1259 | admsys_fpublic GmTest(playerid) | |
1260 | { | |
1261 | if(AdmSysInfo[playerid][asGmTestID] != INVALID_PLAYER_ID) | |
1262 | { | |
1263 | if(AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTest]) | |
1264 | { | |
1265 | static strtmp[179]; | |
1266 | new vehid, Float:nowhp, Float:nowar, Float:hpdiff, Float:ardiff; | |
1267 | vehid = GetPlayerVehicleID(AdmSysInfo[playerid][asGmTestID]); | |
1268 | if(vehid) GetVehicleHealth(vehid, nowhp); | |
1269 | else | |
1270 | { | |
1271 | GetPlayerHealth(AdmSysInfo[playerid][asGmTestID], nowhp); | |
1272 | GetPlayerArmour(AdmSysInfo[playerid][asGmTestID], nowar); | |
1273 | } | |
1274 | hpdiff = AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestHP] - nowhp; | |
1275 | ardiff = AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestAR] - nowar; | |
1276 | if(hpdiff == 0.0 && ardiff == 0.0) | |
1277 | { | |
1278 | format(strtmp, sizeof strtmp, "Before:\t%.1f health, %.1f armour\nAfter:\t%.1f health, %.1f armour\nHealth and armour hasn't decreased\n\nPerhaps the player uses GodMode.", | |
1279 | AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestHP], AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestAR], nowhp, nowar); | |
1280 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GMTEST, DIALOG_STYLE_MSGBOX, "Check for GodMode", strtmp, "Close", ""); | |
1281 | } | |
1282 | else | |
1283 | { | |
1284 | format(strtmp, sizeof strtmp, "Before:\t%.1f health, %.1f armour\nAfter:\t%.1f health, %.1f armour\nHealth decreased by:\t%.1f\nArmour decreased by:\t%.1f\n\nGodMode isn't detected.\nHealth and armor restored.", | |
1285 | AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestHP], AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestAR], nowhp, nowar, hpdiff, ardiff); | |
1286 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_GMTEST, DIALOG_STYLE_MSGBOX, "Check for GodMode", strtmp, "Close", ""); | |
1287 | if(vehid) SetVehicleHealth(vehid, AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestHP]); | |
1288 | else | |
1289 | { | |
1290 | SetPlayerHealth(AdmSysInfo[playerid][asGmTestID], AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestHP]); | |
1291 | SetPlayerArmour(AdmSysInfo[playerid][asGmTestID], AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTestAR]); | |
1292 | } | |
1293 | } | |
1294 | } | |
1295 | AdmSysInfo[AdmSysInfo[playerid][asGmTestID]][asGmTest] = false; | |
1296 | AdmSysInfo[playerid][asGmTestID] = INVALID_PLAYER_ID; | |
1297 | } | |
1298 | return 1; | |
1299 | } | |
1300 | ||
1301 | CMD:report(playerid, const params[]) return admsys_cmd_report(playerid, params); | |
1302 | admsys_cmd_report(playerid, const params[]) | |
1303 | { | |
1304 | static strtmp[145]; | |
1305 | if(AdmSysInfo[playerid][asMuteTime] > 0) | |
1306 | { | |
1307 | format(strtmp, sizeof strtmp, "You are muted. Remaining mute time: %d minutes %d seconds", | |
1308 | floatround(AdmSysInfo[playerid][asMuteTime] / 60, floatround_tozero), AdmSysInfo[playerid][asMuteTime] % 60); | |
1309 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1310 | } | |
1311 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /report [text]"); | |
1312 | static strname[MAX_PLAYER_NAME + 1]; | |
1313 | GetPlayerName(playerid, strname, sizeof strname); | |
1314 | format(strtmp, sizeof strtmp, "[Report] %s[%d]: %s", strname, playerid, params); | |
1315 | SendMessageToAdmins(1, ADMSYS_DEFAULT_COLOR, strtmp); | |
1316 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1317 | return 1; | |
1318 | } | |
1319 | ||
1320 | CMD:achat(playerid, const params[]) return admsys_cmd_achat(playerid, params); | |
1321 | CMD:admchat(playerid, const params[]) return admsys_cmd_achat(playerid, params); | |
1322 | CMD:adminchat(playerid, const params[]) return admsys_cmd_achat(playerid, params); | |
1323 | admsys_cmd_achat(playerid, const params[]) | |
1324 | { | |
1325 | if(IsPlayerAdminEx(playerid)) | |
1326 | { | |
1327 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /achat [text]"); | |
1328 | static strtmp[145], strname[MAX_PLAYER_NAME + 1]; | |
1329 | strtmp = "[Admin chat] "; | |
1330 | GetPlayerName(playerid, strname, sizeof strname); | |
1331 | strcat(strtmp, strname); | |
1332 | strcat(strtmp, ": "); | |
1333 | strcat(strtmp, params); | |
1334 | SendMessageToAdmins(1, ADMSYS_DEFAULT_COLOR, strtmp); | |
1335 | } | |
1336 | return 1; | |
1337 | } | |
1338 | ||
1339 | CMD:ahelp(playerid, const params[]) return admsys_cmd_ahelp(playerid, params); | |
1340 | CMD:admhelp(playerid, const params[]) return admsys_cmd_ahelp(playerid, params); | |
1341 | CMD:adminhelp(playerid, const params[]) return admsys_cmd_ahelp(playerid, params); | |
1342 | admsys_cmd_ahelp(playerid, const params[]) | |
1343 | { | |
1344 | #pragma unused params | |
1345 | if(IsPlayerAdminEx(playerid)) | |
1346 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_AHELP, DIALOG_STYLE_MSGBOX, "Help with admin commands", AdmSysCmdsStr, "Ok", ""); | |
1347 | return 1; | |
1348 | } | |
1349 | ||
1350 | CMD:showstats(playerid, params[]) return admsys_cmd_showstats(playerid, params); | |
1351 | admsys_cmd_showstats(playerid, params[]) | |
1352 | { | |
1353 | if(IsPlayerAdminEx(playerid)) | |
1354 | { | |
1355 | if(admsys_isnull(params)) params[0] = playerid; | |
1356 | else | |
1357 | { | |
1358 | if(!admsys_IsNumeric(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /showstats [id]"); | |
1359 | params[0] = strval(params); | |
1360 | if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1361 | } | |
1362 | new Float:ghealth, Float:garmour; | |
1363 | static strtmp[38], strtmp2[192], strname[MAX_PLAYER_NAME + 1], gip[16]; | |
1364 | GetPlayerName(params[0], strname, sizeof strname); | |
1365 | GetPlayerHealth(params[0], ghealth); | |
1366 | GetPlayerArmour(params[0], garmour); | |
1367 | GetPlayerIp(params[0], gip, sizeof gip); | |
1368 | format(strtmp, sizeof strtmp, "Info about %s", strname); | |
1369 | format(strtmp2, sizeof strtmp2, "Health: %.1f\nArmour: %.1f\nMoney: %d\nInterior: %d\nVirtual world: %d\nWanted level: %d\nIP address: %s\nPing: %d\nWeapon: %d\nAmmo: %d\nScore: %d\nSkin: %d", | |
1370 | ghealth, garmour, GetPlayerMoney(params[0]), GetPlayerInterior(params[0]), GetPlayerVirtualWorld(params[0]), GetPlayerWantedLevel(params[0]), gip, GetPlayerPing(params[0]), | |
1371 | GetPlayerWeapon(params[0]), GetPlayerAmmo(params[0]), GetPlayerScore(params[0]), GetPlayerSkin(params[0])); | |
1372 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_STATS, DIALOG_STYLE_MSGBOX, strtmp, strtmp2, "Ok", ""); | |
1373 | } | |
1374 | return 1; | |
1375 | } | |
1376 | ||
1377 | CMD:answer(playerid, const params[]) return admsys_cmd_answer(playerid, params); | |
1378 | admsys_cmd_answer(playerid, const params[]) | |
1379 | { | |
1380 | if(IsPlayerAdminEx(playerid)) | |
1381 | { | |
1382 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /answer [id] [text]"); | |
1383 | new pos; | |
1384 | static strtmp[145]; | |
1385 | while(params[pos] > ' ') pos++; | |
1386 | strmid(strtmp, params, 0, pos); | |
1387 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /answer [id] [text]"); | |
1388 | new giveid = strval(strtmp); | |
1389 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1390 | while(params[pos] == ' ') pos++; | |
1391 | if(params[pos] == '\0') return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /answer [id] [text]"); | |
1392 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1393 | GetPlayerName(playerid, strname, sizeof strname); | |
1394 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1395 | format(strtmp, sizeof strtmp, "[Response to report %s] %s: %s", strname2, strname, params[pos]); | |
1396 | SendMessageToAdmins(1, ADMSYS_DEFAULT_COLOR, strtmp); | |
1397 | strtmp = "[Response to report]: "; | |
1398 | strcat(strtmp, params[pos]); | |
1399 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1400 | } | |
1401 | return 1; | |
1402 | } | |
1403 | ||
1404 | CMD:apanel(playerid, const params[]) return admsys_cmd_apanel(playerid, params); | |
1405 | CMD:admpanel(playerid, const params[]) return admsys_cmd_apanel(playerid, params); | |
1406 | CMD:adminpanel(playerid, const params[]) return admsys_cmd_apanel(playerid, params); | |
1407 | admsys_cmd_apanel(playerid, const params[]) | |
1408 | { | |
1409 | #pragma unused params | |
1410 | if(IsPlayerAdminEx(playerid)) | |
1411 | { | |
1412 | static strtmp[361]; | |
1413 | strtmp[0] = EOS; | |
1414 | strcat(strtmp, "Admin chat\nHelp with admin commands\nList of administrators online"); | |
1415 | if(IsPlayerAdminEx(playerid, 2)) strcat(strtmp, "\nTeleport vehicle to respawn\n\ | |
1416 | Message: 'Administrator: [text]'"); | |
1417 | if(IsPlayerAdminEx(playerid, 3)) strcat(strtmp, "\nList of suspected players\n\ | |
1418 | Teleport to vehicle\nBlock IP address\nClear chat"); | |
1419 | if(IsPlayerAdminEx(playerid, 4)) strcat(strtmp, "\nRepair vehicle\nUnblock IP address"); | |
1420 | if(IsPlayerAdminEx(playerid, 5)) strcat(strtmp, "\nTeleport all to yourself\nSet weather\n\ | |
1421 | Set the time of day\nDestroy vehicle\nCreate vehicle"); | |
1422 | strcat(strtmp, "\nUndo the last command"); | |
1423 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_APANEL, DIALOG_STYLE_LIST, "Admin panel", strtmp, "Ok", "Close"); | |
1424 | } | |
1425 | return 1; | |
1426 | } | |
1427 | ||
1428 | CMD:admins(playerid, const params[]) return admsys_cmd_admins(playerid, params); | |
1429 | admsys_cmd_admins(playerid, const params[]) | |
1430 | { | |
1431 | #pragma unused params | |
1432 | if(IsPlayerAdminEx(playerid)) | |
1433 | { | |
1434 | static strtmp[296]; | |
1435 | strtmp[0] = EOS; | |
1436 | static strtmp2[59], strtmp3[MAX_PLAYER_NAME + 1]; | |
1437 | #if defined foreach | |
1438 | foreach(new i : Player) | |
1439 | #else | |
1440 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
1441 | #endif | |
1442 | { | |
1443 | if(IsPlayerAdminEx(i)) | |
1444 | { | |
1445 | GetPlayerName(i, strtmp3, sizeof strtmp3); | |
1446 | format(strtmp2, sizeof strtmp2, "Administrator %s[%d] [Level %d]\n", strtmp3, i, GetPlayerAdminLevel(i)); | |
1447 | strcat(strtmp, strtmp2); | |
1448 | } | |
1449 | } | |
1450 | if(strtmp[0] == '\0') strtmp = "Right now no administrators online"; | |
1451 | ShowPlayerDialog(playerid, ADMSYS_DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "Administrators online", strtmp, "Ok", ""); | |
1452 | } | |
1453 | return 1; | |
1454 | } | |
1455 | ||
1456 | CMD:eject(playerid, const params[]) return admsys_cmd_eject(playerid, params); | |
1457 | admsys_cmd_eject(playerid, const params[]) | |
1458 | { | |
1459 | if(IsPlayerAdminEx(playerid)) | |
1460 | { | |
1461 | new strtmp[66]; | |
1462 | if(admsys_isnull(params)) | |
1463 | { | |
1464 | format(strtmp, sizeof strtmp, "%d", playerid); | |
1465 | return admsys_cmd_eject(playerid, strtmp); | |
1466 | } | |
1467 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1468 | GetPlayerName(playerid, strname, sizeof strname); | |
1469 | for(new i = 1, pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
1470 | { | |
1471 | while(params[pos] == ' ') pos++; | |
1472 | if(params[pos]) | |
1473 | { | |
1474 | oldpos = pos; | |
1475 | while(params[pos] > ' ') pos++; | |
1476 | strmid(strtmp, params, oldpos, pos); | |
1477 | if(!admsys_IsNumeric(strtmp)) | |
1478 | { | |
1479 | strtmp = "Use: /eject [id]"; | |
1480 | if(i > 1) | |
1481 | { | |
1482 | for(j = 2; j <= i; j++) | |
1483 | { | |
1484 | format(strname2, sizeof strname2, " [id %d]", j); | |
1485 | strcat(strtmp, strname2); | |
1486 | } | |
1487 | } | |
1488 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1489 | } | |
1490 | giveid = strval(strtmp); | |
1491 | if(!IsPlayerConnected(giveid)) | |
1492 | { | |
1493 | if(i == 1) strtmp = "Player is not found"; | |
1494 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
1495 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1496 | } | |
1497 | else if(!IsPlayerInAnyVehicle(giveid)) | |
1498 | { | |
1499 | if(i == 1) | |
1500 | { | |
1501 | if(giveid == playerid) strtmp = "You are not in vehicle"; | |
1502 | else strtmp = "Player is not in vehicle"; | |
1503 | } | |
1504 | else format(strtmp, sizeof strtmp, "Player %d is not in vehicle", i); | |
1505 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1506 | } | |
1507 | else | |
1508 | { | |
1509 | RemovePlayerFromVehicle(giveid); | |
1510 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1511 | format(strtmp, sizeof strtmp, "You removed %s[%d] from vehicle", strname2, giveid); | |
1512 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1513 | format(strtmp, sizeof strtmp, "Administrator %s removed you from vehicle", strname); | |
1514 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1515 | } | |
1516 | } | |
1517 | } | |
1518 | } | |
1519 | return 1; | |
1520 | } | |
1521 | ||
1522 | CMD:spec(playerid, params[]) return admsys_cmd_spec(playerid, params); | |
1523 | admsys_cmd_spec(playerid, params[]) | |
1524 | { | |
1525 | if(IsPlayerAdminEx(playerid, 2)) | |
1526 | { | |
1527 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /spec [id]"); | |
1528 | if(!strcmp(params, "off", true)) return admsys_cmd_specoff(playerid, "\1"); | |
1529 | if(!strcmp(params, "update", true)) return admsys_cmd_specupdate(playerid, "\1"); | |
1530 | if(!admsys_IsNumeric(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /spec [id]"); | |
1531 | params[0] = strval(params); | |
1532 | if(!StartSpectating(playerid, params[0])) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1533 | } | |
1534 | return 1; | |
1535 | } | |
1536 | ||
1537 | CMD:specupdate(playerid, const params[]) return admsys_cmd_specupdate(playerid, params); | |
1538 | admsys_cmd_specupdate(playerid, const params[]) | |
1539 | { | |
1540 | #pragma unused params | |
1541 | if(IsPlayerAdminEx(playerid, 2)) UpdateSpectating(playerid); | |
1542 | return 1; | |
1543 | } | |
1544 | ||
1545 | CMD:specoff(playerid, const params[]) return admsys_cmd_specoff(playerid, params); | |
1546 | admsys_cmd_specoff(playerid, const params[]) | |
1547 | { | |
1548 | #pragma unused params | |
1549 | if(IsPlayerAdminEx(playerid, 2)) StopSpectating(playerid); | |
1550 | return 1; | |
1551 | } | |
1552 | ||
1553 | CMD:spawnveh(playerid, params[]) return admsys_cmd_spawnveh(playerid, params); | |
1554 | CMD:spawnvehicle(playerid, params[]) return admsys_cmd_spawnveh(playerid, params); | |
1555 | admsys_cmd_spawnveh(playerid, params[]) | |
1556 | { | |
1557 | if(IsPlayerAdminEx(playerid, 2)) | |
1558 | { | |
1559 | if(admsys_isnull(params)) | |
1560 | { | |
1561 | if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are not in vehicle"); | |
1562 | params[0] = GetPlayerVehicleID(playerid); | |
1563 | } | |
1564 | else | |
1565 | { | |
1566 | if(!admsys_IsNumeric(params)) | |
1567 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /spawnveh [vehicle id]"); | |
1568 | params[0] = strval(params); | |
1569 | if(GetVehicleModel(params[0]) <= 0) | |
1570 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Vehicle is not found"); | |
1571 | } | |
1572 | static strtmp[24]; | |
1573 | SetVehicleToRespawn(params[0]); | |
1574 | format(strtmp, sizeof strtmp, "Vehicle id %d spawned", params[0]); | |
1575 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1576 | } | |
1577 | return 1; | |
1578 | } | |
1579 | ||
1580 | CMD:mute(playerid, const params[]) return admsys_cmd_mute(playerid, params); | |
1581 | admsys_cmd_mute(playerid, const params[]) | |
1582 | { | |
1583 | if(IsPlayerAdminEx(playerid, 2)) | |
1584 | { | |
1585 | if(admsys_isnull(params)) | |
1586 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /mute [id] [time] [reason]"); | |
1587 | static strtmp[145]; | |
1588 | new pos, oldpos; | |
1589 | while(params[pos] > ' ') pos++; | |
1590 | strmid(strtmp, params, 0, pos); | |
1591 | if(!admsys_IsNumeric(strtmp)) | |
1592 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /mute [id] [time] [reason]"); | |
1593 | new giveid = strval(strtmp); | |
1594 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1595 | if(AdmSysInfo[giveid][asMuteTime] > 0) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is already muted"); | |
1596 | if(GetPlayerAdminLevel(playerid) <= GetPlayerAdminLevel(giveid) && playerid != giveid) | |
1597 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't apply this action to the administrator"); | |
1598 | while(params[pos] == ' ') pos++; | |
1599 | oldpos = pos; | |
1600 | while(params[pos] > ' ') pos++; | |
1601 | strmid(strtmp, params, oldpos, pos); | |
1602 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
1603 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /mute [id] [time] [reason]"); | |
1604 | new gtime = strval(strtmp); | |
1605 | if(!(1 <= gtime <= 60)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use time for 1 to 60 minutes"); | |
1606 | while(params[pos] == ' ') pos++; | |
1607 | if(params[pos] == '\0') return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /mute [id] [time] [reason]"); | |
1608 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1609 | AdmSysInfo[giveid][asMuteTime] = gtime * 60; | |
1610 | GetPlayerName(playerid, strname, sizeof strname); | |
1611 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1612 | format(strtmp, sizeof strtmp, "Administrator %s muted %s[%d] on %d minutes. Reason: %s", strname, strname2, giveid, gtime, params[pos]); | |
1613 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
1614 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1615 | #else | |
1616 | SendMessageToAdmins(2, ADMSYS_DEFAULT_COLOR, strtmp); | |
1617 | #endif | |
1618 | format(strtmp, sizeof strtmp, "Administrator %s muted you on %d minutes. Reason: %s", strname, gtime, params[pos]); | |
1619 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1620 | } | |
1621 | return 1; | |
1622 | } | |
1623 | ||
1624 | CMD:unmute(playerid, const params[]) return admsys_cmd_unmute(playerid, params); | |
1625 | admsys_cmd_unmute(playerid, const params[]) | |
1626 | { | |
1627 | if(IsPlayerAdminEx(playerid, 2)) | |
1628 | { | |
1629 | new strtmp[92]; | |
1630 | if(admsys_isnull(params)) | |
1631 | { | |
1632 | format(strtmp, sizeof strtmp, "%d", playerid); | |
1633 | return admsys_cmd_unmute(playerid, strtmp); | |
1634 | } | |
1635 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1636 | GetPlayerName(playerid, strname, sizeof strname); | |
1637 | for(new i = 1, pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
1638 | { | |
1639 | while(params[pos] == ' ') pos++; | |
1640 | if(params[pos]) | |
1641 | { | |
1642 | oldpos = pos; | |
1643 | while(params[pos] > ' ') pos++; | |
1644 | strmid(strtmp, params, oldpos, pos); | |
1645 | if(!admsys_IsNumeric(strtmp)) | |
1646 | { | |
1647 | strtmp = "Use: /unmute [id]"; | |
1648 | if(i > 1) | |
1649 | { | |
1650 | for(j = 2; j <= i; j++) | |
1651 | { | |
1652 | format(strname2, sizeof strname2, " [id %d]", j); | |
1653 | strcat(strtmp, strname2); | |
1654 | } | |
1655 | } | |
1656 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1657 | } | |
1658 | giveid = strval(strtmp); | |
1659 | if(!IsPlayerConnected(giveid)) | |
1660 | { | |
1661 | if(i == 1) strtmp = "Player is not found"; | |
1662 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
1663 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1664 | } | |
1665 | else if(AdmSysInfo[giveid][asMuteTime] < 1) | |
1666 | { | |
1667 | if(i == 1) strtmp = "Player is not muted"; | |
1668 | else format(strtmp, sizeof strtmp, "Player %d is not muted", i); | |
1669 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1670 | } | |
1671 | else | |
1672 | { | |
1673 | AdmSysInfo[giveid][asMuteTime] = 0; | |
1674 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1675 | format(strtmp, sizeof strtmp, "Administrator %s unmuted %s[%d]", strname, strname2, giveid); | |
1676 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
1677 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1678 | #else | |
1679 | SendMessageToAdmins(2, ADMSYS_DEFAULT_COLOR, strtmp); | |
1680 | #endif | |
1681 | format(strtmp, sizeof strtmp, "Administrator %s unmuted you", strname); | |
1682 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1683 | } | |
1684 | } | |
1685 | } | |
1686 | } | |
1687 | return 1; | |
1688 | } | |
1689 | ||
1690 | CMD:asay(playerid, const params[]) return admsys_cmd_asay(playerid, params); | |
1691 | CMD:admsay(playerid, const params[]) return admsys_cmd_asay(playerid, params); | |
1692 | CMD:adminsay(playerid, const params[]) return admsys_cmd_asay(playerid, params); | |
1693 | admsys_cmd_asay(playerid, const params[]) | |
1694 | { | |
1695 | if(IsPlayerAdminEx(playerid, 2)) | |
1696 | { | |
1697 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /asay [text]"); | |
1698 | static strtmp[145], strname[MAX_PLAYER_NAME + 1]; | |
1699 | strtmp = "Administrator "; | |
1700 | GetPlayerName(playerid, strname, sizeof strname); | |
1701 | strcat(strtmp, strname); | |
1702 | strcat(strtmp, ": "); | |
1703 | strcat(strtmp, params); | |
1704 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1705 | } | |
1706 | return 1; | |
1707 | } | |
1708 | ||
1709 | CMD:warn(playerid, const params[]) return admsys_cmd_warn(playerid, params); | |
1710 | admsys_cmd_warn(playerid, const params[]) | |
1711 | { | |
1712 | if(IsPlayerAdminEx(playerid, 2)) | |
1713 | { | |
1714 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /warn [id] [reason]"); | |
1715 | static strtmp[145]; | |
1716 | new pos; | |
1717 | while(params[pos] > ' ') pos++; | |
1718 | strmid(strtmp, params, 0, pos); | |
1719 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /warn [id] [reason]"); | |
1720 | new giveid = strval(strtmp); | |
1721 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1722 | if(GetPlayerAdminLevel(playerid) <= GetPlayerAdminLevel(giveid) && playerid != giveid) | |
1723 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't apply this action to the administrator"); | |
1724 | while(params[pos] == ' ') pos++; | |
1725 | if(params[pos] == '\0') return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /warn [id] [reason]"); | |
1726 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1727 | AdmSysInfo[giveid][asWarns]++; | |
1728 | CallRemoteFunction("OnPlayerWarn", "iii", giveid, playerid, AdmSysInfo[giveid][asWarns]); | |
1729 | GetPlayerName(playerid, strname, sizeof strname); | |
1730 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1731 | format(strtmp, sizeof strtmp, "Administrator %s has given %s[%d] a warn. Reason: %s", strname, strname2, giveid, params[pos]); | |
1732 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
1733 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1734 | #else | |
1735 | SendMessageToAdmins(2, ADMSYS_DEFAULT_COLOR, strtmp); | |
1736 | #endif | |
1737 | format(strtmp, sizeof strtmp, "Administrator %s has given you a warn. Reason: %s", strname, params[pos]); | |
1738 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1739 | if(AdmSysInfo[giveid][asWarns] > ADMSYS_MAX_WARNS) return admsys_cmd_ban(playerid, params); | |
1740 | } | |
1741 | return 1; | |
1742 | } | |
1743 | ||
1744 | CMD:kick(playerid, const params[]) return admsys_cmd_kick(playerid, params); | |
1745 | admsys_cmd_kick(playerid, const params[]) | |
1746 | { | |
1747 | if(IsPlayerAdminEx(playerid, 2)) | |
1748 | { | |
1749 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /kick [id] [reason]"); | |
1750 | static strtmp[145]; | |
1751 | new pos; | |
1752 | while(params[pos] > ' ') pos++; | |
1753 | strmid(strtmp, params, 0, pos); | |
1754 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /kick [id] [reason]"); | |
1755 | new giveid = strval(strtmp); | |
1756 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1757 | if(GetPlayerAdminLevel(playerid) <= GetPlayerAdminLevel(giveid) && playerid != giveid) | |
1758 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't apply this action to the administrator"); | |
1759 | while(params[pos] == ' ') pos++; | |
1760 | if(params[pos] == '\0') return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /kick [id] [reason]"); | |
1761 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1762 | CallRemoteFunction("OnPlayerKick", "iii", giveid, playerid, false); | |
1763 | GetPlayerName(playerid, strname, sizeof strname); | |
1764 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1765 | format(strtmp, sizeof strtmp, "Administrator %s has kicked %s[%d]. Reason: %s", strname, strname2, giveid, params[pos]); | |
1766 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
1767 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1768 | #else | |
1769 | SendMessageToAdmins(2, ADMSYS_DEFAULT_COLOR, strtmp); | |
1770 | #endif | |
1771 | format(strtmp, sizeof strtmp, "Administrator %s has kicked you. Reason: %s", strname, params[pos]); | |
1772 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1773 | SetTimerEx("KickWithDelay", 500, 0, "i", giveid); | |
1774 | } | |
1775 | return 1; | |
1776 | } | |
1777 | ||
1778 | CMD:freeze(playerid, const params[]) return admsys_cmd_freeze(playerid, params); | |
1779 | admsys_cmd_freeze(playerid, const params[]) | |
1780 | { | |
1781 | if(IsPlayerAdminEx(playerid, 2)) | |
1782 | { | |
1783 | new strtmp[95]; | |
1784 | if(admsys_isnull(params)) | |
1785 | { | |
1786 | format(strtmp, sizeof strtmp, "%d", playerid); | |
1787 | return admsys_cmd_freeze(playerid, strtmp); | |
1788 | } | |
1789 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1790 | GetPlayerName(playerid, strname, sizeof strname); | |
1791 | for(new i = 1, pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
1792 | { | |
1793 | while(params[pos] == ' ') pos++; | |
1794 | if(params[pos]) | |
1795 | { | |
1796 | oldpos = pos; | |
1797 | while(params[pos] > ' ') pos++; | |
1798 | strmid(strtmp, params, oldpos, pos); | |
1799 | if(!admsys_IsNumeric(strtmp)) | |
1800 | { | |
1801 | strtmp = "Use: /freeze [id]"; | |
1802 | if(i > 1) | |
1803 | { | |
1804 | for(j = 2; j <= i; j++) | |
1805 | { | |
1806 | format(strname2, sizeof strname2, " [id %d]", j); | |
1807 | strcat(strtmp, strname2); | |
1808 | } | |
1809 | } | |
1810 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1811 | } | |
1812 | giveid = strval(strtmp); | |
1813 | if(!IsPlayerConnected(giveid)) | |
1814 | { | |
1815 | if(i == 1) strtmp = "Player is not found"; | |
1816 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
1817 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1818 | } | |
1819 | else | |
1820 | { | |
1821 | TogglePlayerControllable(giveid, 0); | |
1822 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1823 | format(strtmp, sizeof strtmp, "Administrator %s has frozen %s[%d]", strname, strname2, giveid); | |
1824 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
1825 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1826 | #else | |
1827 | SendMessageToAdmins(2, ADMSYS_DEFAULT_COLOR, strtmp); | |
1828 | #endif | |
1829 | format(strtmp, sizeof strtmp, "Administrator %s has frozen you", strname); | |
1830 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1831 | } | |
1832 | } | |
1833 | } | |
1834 | } | |
1835 | return 1; | |
1836 | } | |
1837 | ||
1838 | CMD:unfreeze(playerid, const params[]) return admsys_cmd_unfreeze(playerid, params); | |
1839 | admsys_cmd_unfreeze(playerid, const params[]) | |
1840 | { | |
1841 | if(IsPlayerAdminEx(playerid, 2)) | |
1842 | { | |
1843 | new strtmp[97]; | |
1844 | if(admsys_isnull(params)) | |
1845 | { | |
1846 | format(strtmp, sizeof strtmp, "%d", playerid); | |
1847 | return admsys_cmd_unfreeze(playerid, strtmp); | |
1848 | } | |
1849 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1850 | GetPlayerName(playerid, strname, sizeof strname); | |
1851 | for(new i = 1, pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
1852 | { | |
1853 | while(params[pos] == ' ') pos++; | |
1854 | if(params[pos]) | |
1855 | { | |
1856 | oldpos = pos; | |
1857 | while(params[pos] > ' ') pos++; | |
1858 | strmid(strtmp, params, oldpos, pos); | |
1859 | if(!admsys_IsNumeric(strtmp)) | |
1860 | { | |
1861 | strtmp = "Use: /unfreeze [id]"; | |
1862 | if(i > 1) | |
1863 | { | |
1864 | for(j = 2; j <= i; j++) | |
1865 | { | |
1866 | format(strname2, sizeof strname2, " [id %d]", j); | |
1867 | strcat(strtmp, strname2); | |
1868 | } | |
1869 | } | |
1870 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1871 | } | |
1872 | giveid = strval(strtmp); | |
1873 | if(!IsPlayerConnected(giveid)) | |
1874 | { | |
1875 | if(i == 1) strtmp = "Player is not found"; | |
1876 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
1877 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1878 | } | |
1879 | else | |
1880 | { | |
1881 | TogglePlayerControllable(giveid, 1); | |
1882 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1883 | format(strtmp, sizeof strtmp, "Administrator %s has unfrozen %s[%d]", strname, strname2, giveid); | |
1884 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
1885 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1886 | #else | |
1887 | SendMessageToAdmins(2, ADMSYS_DEFAULT_COLOR, strtmp); | |
1888 | #endif | |
1889 | format(strtmp, sizeof strtmp, "Administrator %s has unfrozen you", strname); | |
1890 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1891 | } | |
1892 | } | |
1893 | } | |
1894 | } | |
1895 | return 1; | |
1896 | } | |
1897 | ||
1898 | CMD:slap(playerid, const params[]) return admsys_cmd_slap(playerid, params); | |
1899 | admsys_cmd_slap(playerid, const params[]) | |
1900 | { | |
1901 | if(IsPlayerAdminEx(playerid, 2)) | |
1902 | { | |
1903 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /slap [id] [reason]"); | |
1904 | static strtmp[145]; | |
1905 | new pos; | |
1906 | while(params[pos] > ' ') pos++; | |
1907 | strmid(strtmp, params, 0, pos); | |
1908 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /slap [id] [reason]"); | |
1909 | new giveid = strval(strtmp); | |
1910 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1911 | if(GetPlayerAdminLevel(playerid) <= GetPlayerAdminLevel(giveid) && playerid != giveid) | |
1912 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't apply this action to the administrator"); | |
1913 | if(IsPlayerSpectating(giveid)) | |
1914 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is in spectator mode"); | |
1915 | while(params[pos] == ' ') pos++; | |
1916 | if(params[pos] == '\0') return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /slap [id] [reason]"); | |
1917 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1918 | new Float:pX, Float:pY, Float:pZ; | |
1919 | GetPlayerPos(giveid, pX, pY, pZ); | |
1920 | SetPlayerPos(giveid, pX, pY, pZ + 8.0); | |
1921 | PlayerPlaySound(giveid, 1130, 0.0, 0.0, 0.0); | |
1922 | GetPlayerName(playerid, strname, sizeof strname); | |
1923 | GetPlayerName(giveid, strname2, sizeof strname2); | |
1924 | format(strtmp, sizeof strtmp, "Administrator %s slapped %s[%d]. Reason: %s", strname, strname2, giveid, params[pos]); | |
1925 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
1926 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
1927 | #else | |
1928 | SendMessageToAdmins(2, ADMSYS_DEFAULT_COLOR, strtmp); | |
1929 | #endif | |
1930 | format(strtmp, sizeof strtmp, "Administrator %s slapped you. Reason: %s", strname, params[pos]); | |
1931 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1932 | } | |
1933 | return 1; | |
1934 | } | |
1935 | ||
1936 | CMD:goto(playerid, params[]) return admsys_cmd_goto(playerid, params); | |
1937 | admsys_cmd_goto(playerid, params[]) | |
1938 | { | |
1939 | if(IsPlayerAdminEx(playerid, 2)) | |
1940 | { | |
1941 | if(IsPlayerSpectating(playerid)) | |
1942 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are in spectator mode"); | |
1943 | if(admsys_isnull(params) || !admsys_IsNumeric(params)) | |
1944 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /goto [id]"); | |
1945 | params[0] = strval(params); | |
1946 | if(params[0] == playerid) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't specify your id"); | |
1947 | if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
1948 | static strtmp[54], strname[MAX_PLAYER_NAME + 1]; | |
1949 | new Float:pX, Float:pY, Float:pZ; | |
1950 | GetPlayerPos(params[0], pX, pY, pZ); | |
1951 | SetPlayerPos(playerid, pX + 1.0, pY + 1.0, pZ); | |
1952 | SetPlayerInterior(playerid, GetPlayerInterior(params[0])); | |
1953 | SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(params[0])); | |
1954 | GetPlayerName(params[0], strname, sizeof strname); | |
1955 | format(strtmp, sizeof strtmp, "You are teleported to %s[%d]", strname, params[0]); | |
1956 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
1957 | } | |
1958 | return 1; | |
1959 | } | |
1960 | ||
1961 | CMD:suspectlist(playerid, const params[]) return admsys_cmd_suspectlist(playerid, params); | |
1962 | admsys_cmd_suspectlist(playerid, const params[]) | |
1963 | { | |
1964 | #pragma unused params | |
1965 | if(IsPlayerAdminEx(playerid, 3)) | |
1966 | { | |
1967 | UpdateSuspectList(); | |
1968 | new c; | |
1969 | static strtmp[337], strtmp2[43], iname[MAX_PLAYER_NAME + 1]; | |
1970 | strtmp[0] = EOS; | |
1971 | for(new i; i < sizeof SuspectList; ++i) | |
1972 | { | |
1973 | if(SuspectList[i] != INVALID_PLAYER_ID) | |
1974 | { | |
1975 | GetPlayerName(SuspectList[i], iname, sizeof iname); | |
1976 | format(strtmp2, sizeof strtmp2, "%d. %s [ID: %d]\n", i + 1, iname, SuspectList[i]); | |
1977 | strcat(strtmp, strtmp2); | |
1978 | c++; | |
1979 | } | |
1980 | } | |
1981 | if(c) ShowPlayerDialog(playerid, ADMSYS_DIALOG_SUSPECT_LIST, DIALOG_STYLE_LIST, "Waiting for checking", strtmp, "Ok", "Close"); | |
1982 | else SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "List is empty"); | |
1983 | } | |
1984 | return 1; | |
1985 | } | |
1986 | ||
1987 | CMD:gethere(playerid, const params[]) return admsys_cmd_gethere(playerid, params); | |
1988 | CMD:get(playerid, const params[]) return admsys_cmd_gethere(playerid, params); | |
1989 | admsys_cmd_gethere(playerid, const params[]) | |
1990 | { | |
1991 | if(IsPlayerAdminEx(playerid, 3)) | |
1992 | { | |
1993 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /gethere [id]"); | |
1994 | if(!strcmp(params, "all", true)) return admsys_cmd_getall(playerid, "\1"); | |
1995 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
1996 | new strtmp[67], interior, vw, Float:pX, Float:pY, Float:pZ; | |
1997 | GetPlayerName(playerid, strname, sizeof strname); | |
1998 | interior = GetPlayerInterior(playerid); | |
1999 | vw = GetPlayerVirtualWorld(playerid); | |
2000 | GetPlayerPos(playerid, pX, pY, pZ); | |
2001 | pX += 1.0; | |
2002 | pY += 1.0; | |
2003 | for(new i = 1, pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
2004 | { | |
2005 | while(params[pos] == ' ') pos++; | |
2006 | if(params[pos]) | |
2007 | { | |
2008 | oldpos = pos; | |
2009 | while(params[pos] > ' ') pos++; | |
2010 | strmid(strtmp, params, oldpos, pos); | |
2011 | if(!admsys_IsNumeric(strtmp)) | |
2012 | { | |
2013 | strtmp = "Use: /gethere [id]"; | |
2014 | if(i > 1) | |
2015 | { | |
2016 | for(j = 2; j <= i; j++) | |
2017 | { | |
2018 | format(strname2, sizeof strname2, " [id %d]", j); | |
2019 | strcat(strtmp, strname2); | |
2020 | } | |
2021 | } | |
2022 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2023 | } | |
2024 | giveid = strval(strtmp); | |
2025 | if(giveid == playerid) SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't specify your id"); | |
2026 | else if(!IsPlayerConnected(giveid)) | |
2027 | { | |
2028 | if(i == 1) strtmp = "Player is not found"; | |
2029 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
2030 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2031 | } | |
2032 | else | |
2033 | { | |
2034 | SetPlayerPos(giveid, pX, pY, pZ); | |
2035 | SetPlayerVirtualWorld(giveid, vw); | |
2036 | SetPlayerInterior(giveid, interior); | |
2037 | GetPlayerName(giveid, strname2, sizeof strname2); | |
2038 | format(strtmp, sizeof strtmp, "You teleported %s[%d] to himself", strname2, giveid); | |
2039 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2040 | format(strtmp, sizeof strtmp, "Administrator %s teleported you to himself", strname); | |
2041 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2042 | } | |
2043 | } | |
2044 | } | |
2045 | } | |
2046 | return 1; | |
2047 | } | |
2048 | ||
2049 | CMD:gotoveh(playerid, params[]) return admsys_cmd_gotoveh(playerid, params); | |
2050 | CMD:gotovehicle(playerid, params[]) return admsys_cmd_gotoveh(playerid, params); | |
2051 | admsys_cmd_gotoveh(playerid, params[]) | |
2052 | { | |
2053 | if(IsPlayerAdminEx(playerid, 3)) | |
2054 | { | |
2055 | if(IsPlayerSpectating(playerid)) | |
2056 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are in spectator mode"); | |
2057 | if(admsys_isnull(params) || !admsys_IsNumeric(params)) | |
2058 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /gotoveh [vehicle id]"); | |
2059 | params[0] = strval(params); | |
2060 | if(GetVehicleModel(params[0]) <= 0) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Vehicle is not found"); | |
2061 | static strtmp[50]; | |
2062 | new Float:vX, Float:vY, Float:vZ; | |
2063 | GetVehiclePos(params[0], vX, vY, vZ); | |
2064 | SetPlayerPos(playerid, vX, vY, vZ + 2.5); | |
2065 | SetPlayerVirtualWorld(playerid, GetVehicleVirtualWorld(params[0])); | |
2066 | format(strtmp, sizeof strtmp, "You are teleported to vehicle id %d", params[0]); | |
2067 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2068 | } | |
2069 | return 1; | |
2070 | } | |
2071 | ||
2072 | CMD:ban(playerid, const params[]) return admsys_cmd_ban(playerid, params); | |
2073 | admsys_cmd_ban(playerid, const params[]) | |
2074 | { | |
2075 | if(IsPlayerAdminEx(playerid, 3)) | |
2076 | { | |
2077 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /ban [id] [reason]"); | |
2078 | static strtmp[145]; | |
2079 | new pos; | |
2080 | while(params[pos] > ' ') pos++; | |
2081 | strmid(strtmp, params, 0, pos); | |
2082 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /ban [id] [reason]"); | |
2083 | new giveid = strval(strtmp); | |
2084 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2085 | if(GetPlayerAdminLevel(playerid) <= GetPlayerAdminLevel(giveid) && playerid != giveid) | |
2086 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't apply this action to the administrator"); | |
2087 | while(params[pos] == ' ') pos++; | |
2088 | if(params[pos] == '\0') return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /ban [id] [reason]"); | |
2089 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
2090 | CallRemoteFunction("OnPlayerBan", "iii", giveid, playerid, false); | |
2091 | GetPlayerName(playerid, strname, sizeof strname); | |
2092 | GetPlayerName(giveid, strname2, sizeof strname2); | |
2093 | format(strtmp, sizeof strtmp, "Administrator %s has banned %s[%d]. Reason: %s", strname, strname2, giveid, params[pos]); | |
2094 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2095 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2096 | #else | |
2097 | SendMessageToAdmins(3, ADMSYS_DEFAULT_COLOR, strtmp); | |
2098 | #endif | |
2099 | format(strtmp, sizeof strtmp, "Administrator %s has banned you. Reason: %s", strname, params[pos]); | |
2100 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2101 | SetTimerEx("BanWithDelay", 500, 0, "i", giveid); | |
2102 | } | |
2103 | return 1; | |
2104 | } | |
2105 | ||
2106 | CMD:gmtest(playerid, params[]) return admsys_cmd_gmtest(playerid, params); | |
2107 | admsys_cmd_gmtest(playerid, params[]) | |
2108 | { | |
2109 | if(IsPlayerAdminEx(playerid, 3)) | |
2110 | { | |
2111 | if(admsys_isnull(params) || !admsys_IsNumeric(params)) | |
2112 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /gmtest [id]"); | |
2113 | params[0] = strval(params); | |
2114 | if(!IsPlayerConnected(params[0])) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2115 | if(AdmSysInfo[playerid][asGmTestID] != INVALID_PLAYER_ID) | |
2116 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You already checks someone on GodMode"); | |
2117 | if(AdmSysInfo[params[0]][asGmTest]) | |
2118 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player are already checked for GodMode"); | |
2119 | if(!AdmSysInfo[params[0]][asIsSpawned]) | |
2120 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not spawned"); | |
2121 | if(IsPlayerSpectating(params[0])) | |
2122 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is in spectator mode"); | |
2123 | new Float:bx, Float:by, Float:bz; | |
2124 | GetPlayerPos(params[0], bx, by, bz); | |
2125 | if(!IsPlayerInAnyVehicle(params[0])) | |
2126 | { | |
2127 | GetPlayerHealth(params[0], AdmSysInfo[params[0]][asGmTestHP]); | |
2128 | GetPlayerArmour(params[0], AdmSysInfo[params[0]][asGmTestAR]); | |
2129 | } | |
2130 | else GetVehicleHealth(GetPlayerVehicleID(params[0]), AdmSysInfo[params[0]][asGmTestHP]); | |
2131 | AdmSysInfo[params[0]][asGmTest] = true; | |
2132 | AdmSysInfo[playerid][asGmTestID] = params[0]; | |
2133 | CreateExplosionForPlayer(params[0], bx, by, bz + 7.5, 5, 0.5); | |
2134 | SetTimerEx("GmTest", 1000, 0, "d", playerid); | |
2135 | } | |
2136 | return 1; | |
2137 | } | |
2138 | ||
2139 | CMD:spawn(playerid, const params[]) return admsys_cmd_spawn(playerid, params); | |
2140 | admsys_cmd_spawn(playerid, const params[]) | |
2141 | { | |
2142 | if(IsPlayerAdminEx(playerid, 3)) | |
2143 | { | |
2144 | new strtmp[102]; | |
2145 | if(admsys_isnull(params)) | |
2146 | { | |
2147 | format(strtmp, sizeof strtmp, "%d", playerid); | |
2148 | return admsys_cmd_spawn(playerid, strtmp); | |
2149 | } | |
2150 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
2151 | GetPlayerName(playerid, strname, sizeof strname); | |
2152 | for(new i = 1, pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
2153 | { | |
2154 | while(params[pos] == ' ') pos++; | |
2155 | if(params[pos]) | |
2156 | { | |
2157 | oldpos = pos; | |
2158 | while(params[pos] > ' ') pos++; | |
2159 | strmid(strtmp, params, oldpos, pos); | |
2160 | if(!admsys_IsNumeric(strtmp)) | |
2161 | { | |
2162 | strtmp = "Use: /spawn [id]"; | |
2163 | if(i > 1) | |
2164 | { | |
2165 | for(j = 2; j <= i; j++) | |
2166 | { | |
2167 | format(strname2, sizeof strname2, " [id %d]", j); | |
2168 | strcat(strtmp, strname2); | |
2169 | } | |
2170 | } | |
2171 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2172 | } | |
2173 | giveid = strval(strtmp); | |
2174 | if(!IsPlayerConnected(giveid)) | |
2175 | { | |
2176 | if(i == 1) strtmp = "Player is not found"; | |
2177 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
2178 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2179 | } | |
2180 | else | |
2181 | { | |
2182 | if(IsPlayerSpectating(giveid)) TogglePlayerSpectating(giveid, 0); | |
2183 | else SpawnPlayer(giveid); | |
2184 | GetPlayerName(giveid, strname2, sizeof strname2); | |
2185 | format(strtmp, sizeof strtmp, "Administrator %s has spawned %s[%d]", strname, strname2, giveid); | |
2186 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2187 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2188 | #else | |
2189 | SendMessageToAdmins(3, ADMSYS_DEFAULT_COLOR, strtmp); | |
2190 | #endif | |
2191 | format(strtmp, sizeof strtmp, "Administrator %s has spawned you", strname); | |
2192 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2193 | } | |
2194 | } | |
2195 | } | |
2196 | } | |
2197 | return 1; | |
2198 | } | |
2199 | ||
2200 | CMD:unwarn(playerid, const params[]) return admsys_cmd_unwarn(playerid, params); | |
2201 | admsys_cmd_unwarn(playerid, const params[]) | |
2202 | { | |
2203 | if(IsPlayerAdminEx(playerid, 3)) | |
2204 | { | |
2205 | new strtmp[108]; | |
2206 | if(admsys_isnull(params)) | |
2207 | { | |
2208 | format(strtmp, sizeof strtmp, "%d", playerid); | |
2209 | return admsys_cmd_unwarn(playerid, strtmp); | |
2210 | } | |
2211 | static strname[MAX_PLAYER_NAME + 1], strname2[MAX_PLAYER_NAME + 1]; | |
2212 | GetPlayerName(playerid, strname, sizeof strname); | |
2213 | for(new i = 1, pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
2214 | { | |
2215 | while(params[pos] == ' ') pos++; | |
2216 | if(params[pos]) | |
2217 | { | |
2218 | oldpos = pos; | |
2219 | while(params[pos] > ' ') pos++; | |
2220 | strmid(strtmp, params, oldpos, pos); | |
2221 | if(!admsys_IsNumeric(strtmp)) | |
2222 | { | |
2223 | strtmp = "Use: /unwarn [id]"; | |
2224 | if(i > 1) | |
2225 | { | |
2226 | for(j = 2; j <= i; j++) | |
2227 | { | |
2228 | format(strname2, sizeof strname2, " [id %d]", j); | |
2229 | strcat(strtmp, strname2); | |
2230 | } | |
2231 | } | |
2232 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2233 | } | |
2234 | giveid = strval(strtmp); | |
2235 | if(!IsPlayerConnected(giveid)) | |
2236 | { | |
2237 | if(i == 1) strtmp = "Player is not found"; | |
2238 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
2239 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2240 | } | |
2241 | else if(AdmSysInfo[giveid][asWarns] < 1) | |
2242 | { | |
2243 | if(i == 1) strtmp = "Player has no warns"; | |
2244 | else format(strtmp, sizeof strtmp, "Player %d has no warns", i); | |
2245 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2246 | } | |
2247 | else | |
2248 | { | |
2249 | AdmSysInfo[giveid][asWarns]--; | |
2250 | GetPlayerName(giveid, strname2, sizeof strname2); | |
2251 | format(strtmp, sizeof strtmp, "Administrator %s has removed a warn from %s[%d]", strname, strname2, giveid); | |
2252 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2253 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2254 | #else | |
2255 | SendMessageToAdmins(3, ADMSYS_DEFAULT_COLOR, strtmp); | |
2256 | #endif | |
2257 | format(strtmp, sizeof strtmp, "Administrator %s has removed a warn from you", strname); | |
2258 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2259 | } | |
2260 | } | |
2261 | } | |
2262 | } | |
2263 | return 1; | |
2264 | } | |
2265 | ||
2266 | CMD:banip(playerid, const params[]) return admsys_cmd_banip(playerid, params); | |
2267 | CMD:blockip(playerid, const params[]) return admsys_cmd_banip(playerid, params); | |
2268 | admsys_cmd_banip(playerid, const params[]) | |
2269 | { | |
2270 | if(IsPlayerAdminEx(playerid, 3)) | |
2271 | { | |
2272 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /banip [IP]"); | |
2273 | for(new i, c, j = strlen(params); i < j; i++) | |
2274 | { | |
2275 | switch(params[i]) | |
2276 | { | |
2277 | case '*': | |
2278 | { | |
2279 | if(c < 2) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "IP address entered incorrectly"); | |
2280 | } | |
2281 | case '.': c++; | |
2282 | case '0'..'9':{} | |
2283 | default: return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "IP address entered incorrectly"); | |
2284 | } | |
2285 | } | |
2286 | static strtmp[74], strname[MAX_PLAYER_NAME + 1]; | |
2287 | format(strtmp, sizeof strtmp, "banip %s", params); | |
2288 | SendRconCommand(strtmp); | |
2289 | SendRconCommand("reloadbans"); | |
2290 | GetPlayerName(playerid, strname, sizeof strname); | |
2291 | format(strtmp, sizeof strtmp, "Administrator %s has blocked IP %s", strname, params); | |
2292 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2293 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2294 | #else | |
2295 | SendMessageToAdmins(3, ADMSYS_DEFAULT_COLOR, strtmp); | |
2296 | #endif | |
2297 | } | |
2298 | return 1; | |
2299 | } | |
2300 | ||
2301 | CMD:cc(playerid, const params[]) return admsys_cmd_cc(playerid, params); | |
2302 | CMD:clearchat(playerid, const params[]) return admsys_cmd_cc(playerid, params); | |
2303 | admsys_cmd_cc(playerid, const params[]) | |
2304 | { | |
2305 | #pragma unused params | |
2306 | if(IsPlayerAdminEx(playerid, 3)) | |
2307 | { | |
2308 | static strtmp[62], strname[MAX_PLAYER_NAME + 1]; | |
2309 | for(new i = 30; i >= 0; --i) SendClientMessageToAll(-1, " "); | |
2310 | GetPlayerName(playerid, strname, sizeof strname); | |
2311 | format(strtmp, sizeof strtmp, "Administrator %s has cleared the chat", strname); | |
2312 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2313 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2314 | #else | |
2315 | SendMessageToAdmins(3, ADMSYS_DEFAULT_COLOR, strtmp); | |
2316 | #endif | |
2317 | } | |
2318 | return 1; | |
2319 | } | |
2320 | ||
2321 | CMD:sethealth(playerid, const params[]) return admsys_cmd_sethealth(playerid, params); | |
2322 | admsys_cmd_sethealth(playerid, const params[]) | |
2323 | { | |
2324 | if(IsPlayerAdminEx(playerid, 4)) | |
2325 | { | |
2326 | if(admsys_isnull(params)) | |
2327 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /sethealth [id] [health]"); | |
2328 | static strtmp[68]; | |
2329 | new pos, oldpos; | |
2330 | while(params[pos] > ' ') pos++; | |
2331 | strmid(strtmp, params, 0, pos); | |
2332 | if(!admsys_IsNumeric(strtmp)) | |
2333 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /sethealth [id] [health]"); | |
2334 | new giveid = strval(strtmp); | |
2335 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2336 | while(params[pos] == ' ') pos++; | |
2337 | oldpos = pos; | |
2338 | while(params[pos] > ' ') pos++; | |
2339 | strmid(strtmp, params, oldpos, pos); | |
2340 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2341 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /sethealth [id] [health]"); | |
2342 | static strname[MAX_PLAYER_NAME + 1]; | |
2343 | new Float:ghealth = strval(strtmp); | |
2344 | AdmSysInfo[playerid][asLastAction] = 1; | |
2345 | GetPlayerHealth(giveid, AdmSysInfo[playerid][asLastFloatData]); | |
2346 | AdmSysInfo[playerid][asLastActionID] = giveid; | |
2347 | SetPlayerHealth(giveid, ghealth); | |
2348 | GetPlayerName(giveid, strname, sizeof strname); | |
2349 | format(strtmp, sizeof strtmp, "You have set %.1f health to %s[%d]", ghealth, strname, giveid); | |
2350 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2351 | GetPlayerName(playerid, strname, sizeof strname); | |
2352 | format(strtmp, sizeof strtmp, "Administrator %s has set you %.1f health", strname, ghealth); | |
2353 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2354 | } | |
2355 | return 1; | |
2356 | } | |
2357 | ||
2358 | CMD:setarmour(playerid, const params[]) return admsys_cmd_setarmour(playerid, params); | |
2359 | admsys_cmd_setarmour(playerid, const params[]) | |
2360 | { | |
2361 | if(IsPlayerAdminEx(playerid, 4)) | |
2362 | { | |
2363 | if(admsys_isnull(params)) | |
2364 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setarmour [id] [armour]"); | |
2365 | static strtmp[68]; | |
2366 | new pos, oldpos; | |
2367 | while(params[pos] > ' ') pos++; | |
2368 | strmid(strtmp, params, 0, pos); | |
2369 | if(!admsys_IsNumeric(strtmp)) | |
2370 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setarmour [id] [armour]"); | |
2371 | new giveid = strval(strtmp); | |
2372 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2373 | while(params[pos] == ' ') pos++; | |
2374 | oldpos = pos; | |
2375 | while(params[pos] > ' ') pos++; | |
2376 | strmid(strtmp, params, oldpos, pos); | |
2377 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2378 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setarmour [id] [armour]"); | |
2379 | static strname[MAX_PLAYER_NAME + 1]; | |
2380 | new Float:garmour = strval(strtmp); | |
2381 | AdmSysInfo[playerid][asLastAction] = 2; | |
2382 | GetPlayerArmour(giveid, AdmSysInfo[playerid][asLastFloatData]); | |
2383 | AdmSysInfo[playerid][asLastActionID] = giveid; | |
2384 | SetPlayerArmour(giveid, garmour); | |
2385 | GetPlayerName(giveid, strname, sizeof strname); | |
2386 | format(strtmp, sizeof strtmp, "You have set %.1f armour to %s[%d]", garmour, strname, giveid); | |
2387 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2388 | GetPlayerName(playerid, strname, sizeof strname); | |
2389 | format(strtmp, sizeof strtmp, "Administrator %s has set you %.1f armour", strname, garmour); | |
2390 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2391 | } | |
2392 | return 1; | |
2393 | } | |
2394 | ||
2395 | CMD:setmoney(playerid, const params[]) return admsys_cmd_setmoney(playerid, params); | |
2396 | admsys_cmd_setmoney(playerid, const params[]) | |
2397 | { | |
2398 | if(IsPlayerAdminEx(playerid, 4)) | |
2399 | { | |
2400 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setmoney [id] [money]"); | |
2401 | static strtmp[64]; | |
2402 | new pos, oldpos; | |
2403 | while(params[pos] > ' ') pos++; | |
2404 | strmid(strtmp, params, 0, pos); | |
2405 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setmoney [id] [money]"); | |
2406 | new giveid = strval(strtmp); | |
2407 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2408 | while(params[pos] == ' ') pos++; | |
2409 | oldpos = pos; | |
2410 | while(params[pos] > ' ') pos++; | |
2411 | strmid(strtmp, params, oldpos, pos); | |
2412 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2413 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setmoney [id] [money]"); | |
2414 | static strname[MAX_PLAYER_NAME + 1]; | |
2415 | new gmoney = strval(strtmp); | |
2416 | AdmSysInfo[playerid][asLastAction] = 3; | |
2417 | AdmSysInfo[playerid][asLastIntData][0] = GetPlayerMoney(giveid); | |
2418 | AdmSysInfo[playerid][asLastActionID] = giveid; | |
2419 | ResetPlayerMoney(giveid); | |
2420 | GivePlayerMoney(giveid, gmoney); | |
2421 | GetPlayerName(giveid, strname, sizeof strname); | |
2422 | format(strtmp, sizeof strtmp, "You have set $%d to %s[%d]", gmoney, strname, giveid); | |
2423 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2424 | GetPlayerName(playerid, strname, sizeof strname); | |
2425 | format(strtmp, sizeof strtmp, "Administrator %s has set you $%d", strname, gmoney); | |
2426 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2427 | } | |
2428 | return 1; | |
2429 | } | |
2430 | ||
2431 | CMD:setskin(playerid, const params[]) return admsys_cmd_setskin(playerid, params); | |
2432 | admsys_cmd_setskin(playerid, const params[]) | |
2433 | { | |
2434 | if(IsPlayerAdminEx(playerid, 4)) | |
2435 | { | |
2436 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setskin [id] [skin]"); | |
2437 | static strtmp[60]; | |
2438 | new pos, oldpos; | |
2439 | while(params[pos] > ' ') pos++; | |
2440 | strmid(strtmp, params, 0, pos); | |
2441 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setskin [id] [skin]"); | |
2442 | new giveid = strval(strtmp); | |
2443 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2444 | while(params[pos] == ' ') pos++; | |
2445 | oldpos = pos; | |
2446 | while(params[pos] > ' ') pos++; | |
2447 | strmid(strtmp, params, oldpos, pos); | |
2448 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2449 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setskin [id] [skin]"); | |
2450 | new skinid = strval(strtmp); | |
2451 | if(!(0 <= skinid <= 311)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use ID of skin from 0 to 311"); | |
2452 | static strname[MAX_PLAYER_NAME + 1]; | |
2453 | AdmSysInfo[playerid][asLastAction] = 4; | |
2454 | AdmSysInfo[playerid][asLastIntData][0] = GetPlayerSkin(giveid); | |
2455 | AdmSysInfo[playerid][asLastActionID] = giveid; | |
2456 | SetPlayerSkin(giveid, skinid); | |
2457 | GetPlayerName(giveid, strname, sizeof strname); | |
2458 | format(strtmp, sizeof strtmp, "You have changed the skin to %d to %s[%d]", skinid, strname, giveid); | |
2459 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2460 | GetPlayerName(playerid, strname, sizeof strname); | |
2461 | format(strtmp, sizeof strtmp, "Administrator %s has changed your skin to %d", strname, skinid); | |
2462 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2463 | } | |
2464 | return 1; | |
2465 | } | |
2466 | ||
2467 | CMD:setint(playerid, const params[]) return admsys_cmd_setint(playerid, params); | |
2468 | CMD:setinterior(playerid, const params[]) return admsys_cmd_setint(playerid, params); | |
2469 | admsys_cmd_setint(playerid, const params[]) | |
2470 | { | |
2471 | if(IsPlayerAdminEx(playerid, 4)) | |
2472 | { | |
2473 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setint [id] [interior]"); | |
2474 | static strtmp[70]; | |
2475 | new pos, oldpos; | |
2476 | while(params[pos] > ' ') pos++; | |
2477 | strmid(strtmp, params, 0, pos); | |
2478 | if(!admsys_IsNumeric(strtmp)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setint [id] [interior]"); | |
2479 | new giveid = strval(strtmp); | |
2480 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2481 | while(params[pos] == ' ') pos++; | |
2482 | oldpos = pos; | |
2483 | while(params[pos] > ' ') pos++; | |
2484 | strmid(strtmp, params, oldpos, pos); | |
2485 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2486 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setint [id] [interior]"); | |
2487 | static strname[MAX_PLAYER_NAME + 1]; | |
2488 | new gint = strval(strtmp); | |
2489 | AdmSysInfo[playerid][asLastAction] = 5; | |
2490 | AdmSysInfo[playerid][asLastIntData][0] = GetPlayerInterior(giveid); | |
2491 | AdmSysInfo[playerid][asLastActionID] = giveid; | |
2492 | SetPlayerInterior(giveid, gint); | |
2493 | GetPlayerName(giveid, strname, sizeof strname); | |
2494 | format(strtmp, sizeof strtmp, "You have set the interior to %d to %s[%d]", gint, strname, giveid); | |
2495 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2496 | GetPlayerName(playerid, strname, sizeof strname); | |
2497 | format(strtmp, sizeof strtmp, "Administrator %s has set your interior to %d", strname, gint); | |
2498 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2499 | } | |
2500 | return 1; | |
2501 | } | |
2502 | ||
2503 | CMD:setvw(playerid, const params[]) return admsys_cmd_setvw(playerid, params); | |
2504 | CMD:setvirtualworld(playerid, const params[]) return admsys_cmd_setvw(playerid, params); | |
2505 | admsys_cmd_setvw(playerid, const params[]) | |
2506 | { | |
2507 | if(IsPlayerAdminEx(playerid, 4)) | |
2508 | { | |
2509 | if(admsys_isnull(params)) | |
2510 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setvw [id] [vw]"); | |
2511 | static strtmp[82]; | |
2512 | new pos, oldpos; | |
2513 | while(params[pos] > ' ') pos++; | |
2514 | strmid(strtmp, params, 0, pos); | |
2515 | if(!admsys_IsNumeric(strtmp)) | |
2516 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setvw [id] [vw]"); | |
2517 | new giveid = strval(strtmp); | |
2518 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2519 | while(params[pos] == ' ') pos++; | |
2520 | oldpos = pos; | |
2521 | while(params[pos] > ' ') pos++; | |
2522 | strmid(strtmp, params, oldpos, pos); | |
2523 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2524 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setvw [id] [vw]"); | |
2525 | static strname[MAX_PLAYER_NAME + 1]; | |
2526 | new gvw = strval(strtmp); | |
2527 | AdmSysInfo[playerid][asLastAction] = 6; | |
2528 | AdmSysInfo[playerid][asLastIntData][0] = GetPlayerVirtualWorld(giveid); | |
2529 | AdmSysInfo[playerid][asLastActionID] = giveid; | |
2530 | SetPlayerVirtualWorld(giveid, gvw); | |
2531 | GetPlayerName(giveid, strname, sizeof strname); | |
2532 | format(strtmp, sizeof strtmp, "You have set the virtual world to %d to %s[%d]", gvw, strname, giveid); | |
2533 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2534 | GetPlayerName(playerid, strname, sizeof strname); | |
2535 | format(strtmp, sizeof strtmp, "Administrator %s has set your virtual world to %d", strname, gvw); | |
2536 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2537 | } | |
2538 | return 1; | |
2539 | } | |
2540 | ||
2541 | CMD:giveweapon(playerid, const params[]) return admsys_cmd_giveweapon(playerid, params); | |
2542 | admsys_cmd_giveweapon(playerid, const params[]) | |
2543 | { | |
2544 | if(IsPlayerAdminEx(playerid, 4)) | |
2545 | { | |
2546 | if(admsys_isnull(params)) | |
2547 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /giveweapon [id] [weapon] [ammo]"); | |
2548 | static strtmp[79]; | |
2549 | new pos, oldpos; | |
2550 | while(params[pos] > ' ') pos++; | |
2551 | strmid(strtmp, params, 0, pos); | |
2552 | if(!admsys_IsNumeric(strtmp)) | |
2553 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /giveweapon [id] [weapon] [ammo]"); | |
2554 | new giveid = strval(strtmp); | |
2555 | if(!IsPlayerConnected(giveid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not found"); | |
2556 | while(params[pos] == ' ') pos++; | |
2557 | oldpos = pos; | |
2558 | while(params[pos] > ' ') pos++; | |
2559 | strmid(strtmp, params, oldpos, pos); | |
2560 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2561 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /giveweapon [id] [weapon] [ammo]"); | |
2562 | new gweapon = strval(strtmp); | |
2563 | if(!(0 <= gweapon <= 46)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use the ID of weapon from 0 to 46"); | |
2564 | while(params[pos] == ' ') pos++; | |
2565 | oldpos = pos; | |
2566 | while(params[pos] > ' ') pos++; | |
2567 | strmid(strtmp, params, oldpos, pos); | |
2568 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2569 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /giveweapon [id] [weapon] [ammo]"); | |
2570 | static strname[MAX_PLAYER_NAME + 1]; | |
2571 | new gammo = strval(strtmp); | |
2572 | AdmSysInfo[playerid][asLastAction] = 7; | |
2573 | AdmSysInfo[playerid][asLastIntData][0] = gweapon; | |
2574 | AdmSysInfo[playerid][asLastIntData][1] = gammo; | |
2575 | AdmSysInfo[playerid][asLastActionID] = giveid; | |
2576 | GivePlayerWeapon(giveid, gweapon, gammo); | |
2577 | GetPlayerName(giveid, strname, sizeof strname); | |
2578 | format(strtmp, sizeof strtmp, "You have gave the weapon %d with %d ammo to %s[%d]", gweapon, gammo, strname, giveid); | |
2579 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2580 | GetPlayerName(playerid, strname, sizeof strname); | |
2581 | format(strtmp, sizeof strtmp, "Administrator %s gave you weapon %d with %d ammo", strname, gweapon, gammo); | |
2582 | SendClientMessage(giveid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2583 | } | |
2584 | return 1; | |
2585 | } | |
2586 | ||
2587 | CMD:repairveh(playerid, params[]) return admsys_cmd_repairveh(playerid, params); | |
2588 | CMD:repairvehicle(playerid, params[]) return admsys_cmd_repairveh(playerid, params); | |
2589 | admsys_cmd_repairveh(playerid, params[]) | |
2590 | { | |
2591 | if(IsPlayerAdminEx(playerid, 4)) | |
2592 | { | |
2593 | if(admsys_isnull(params)) | |
2594 | { | |
2595 | if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are not in vehicle"); | |
2596 | params[0] = GetPlayerVehicleID(playerid); | |
2597 | } | |
2598 | else | |
2599 | { | |
2600 | if(!admsys_IsNumeric(params)) | |
2601 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /repairveh [vehicle id]"); | |
2602 | params[0] = strval(params); | |
2603 | if(GetVehicleModel(params[0]) <= 0) | |
2604 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Vehicle is not found"); | |
2605 | } | |
2606 | static strtmp[25]; | |
2607 | RepairVehicle(params[0]); | |
2608 | format(strtmp, sizeof strtmp, "Vehicle id %d repaired", params[0]); | |
2609 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2610 | } | |
2611 | return 1; | |
2612 | } | |
2613 | ||
2614 | CMD:unbanip(playerid, const params[]) return admsys_cmd_unbanip(playerid, params); | |
2615 | CMD:unblockip(playerid, const params[]) return admsys_cmd_unbanip(playerid, params); | |
2616 | admsys_cmd_unbanip(playerid, const params[]) | |
2617 | { | |
2618 | if(IsPlayerAdminEx(playerid, 4)) | |
2619 | { | |
2620 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /unbanip [IP]"); | |
2621 | for(new i, j = strlen(params); i < j; i++) | |
2622 | { | |
2623 | switch(params[i]) | |
2624 | { | |
2625 | case '*', '.', '0'..'9':{} | |
2626 | default: return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "IP address entered incorrectly"); | |
2627 | } | |
2628 | } | |
2629 | static strtmp[76], strname[MAX_PLAYER_NAME + 1]; | |
2630 | format(strtmp, sizeof strtmp, "unbanip %s", params); | |
2631 | SendRconCommand(strtmp); | |
2632 | SendRconCommand("reloadbans"); | |
2633 | GetPlayerName(playerid, strname, sizeof strname); | |
2634 | format(strtmp, sizeof strtmp, "Administrator %s unblocked the IP %s", strname, params); | |
2635 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2636 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2637 | #else | |
2638 | SendMessageToAdmins(4, ADMSYS_DEFAULT_COLOR, strtmp); | |
2639 | #endif | |
2640 | } | |
2641 | return 1; | |
2642 | } | |
2643 | ||
2644 | CMD:setweather(playerid, params[]) return admsys_cmd_setweather(playerid, params); | |
2645 | admsys_cmd_setweather(playerid, params[]) | |
2646 | { | |
2647 | if(IsPlayerAdminEx(playerid, 5)) | |
2648 | { | |
2649 | if(admsys_isnull(params) || !admsys_IsNumeric(params)) | |
2650 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /setweather [weather]"); | |
2651 | params[0] = strval(params); | |
2652 | if(!(0 <= params[0] <= 20)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Weather ID should be from 0 to 20"); | |
2653 | SetWeather(params[0]); | |
2654 | #if defined foreach | |
2655 | foreach(new i : Player) | |
2656 | #else | |
2657 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
2658 | #endif | |
2659 | { | |
2660 | SetPlayerWeather(i, params[0]); | |
2661 | } | |
2662 | static strtmp[66], strname[MAX_PLAYER_NAME + 1]; | |
2663 | GetPlayerName(playerid, strname, sizeof strname); | |
2664 | format(strtmp, sizeof strtmp, "Administrator %s changed the weather to %d", strname, params[0]); | |
2665 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2666 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2667 | #else | |
2668 | SendMessageToAdmins(5, ADMSYS_DEFAULT_COLOR, strtmp); | |
2669 | #endif | |
2670 | } | |
2671 | return 1; | |
2672 | } | |
2673 | ||
2674 | CMD:getall(playerid, const params[]) return admsys_cmd_getall(playerid, params); | |
2675 | admsys_cmd_getall(playerid, const params[]) | |
2676 | { | |
2677 | #pragma unused params | |
2678 | if(IsPlayerAdminEx(playerid, 5)) | |
2679 | { | |
2680 | new Float:pX, Float:pY, Float:pZ; | |
2681 | GetPlayerPos(playerid, pX, pY, pZ); | |
2682 | pX += 1.0; | |
2683 | pY += 1.0; | |
2684 | new interior = GetPlayerInterior(playerid), vw = GetPlayerVirtualWorld(playerid); | |
2685 | #if defined foreach | |
2686 | foreach(new i : Player) | |
2687 | { | |
2688 | #else | |
2689 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
2690 | { | |
2691 | if(!IsPlayerConnected(i) || IsPlayerNPC(i)) continue; | |
2692 | #endif | |
2693 | if(i != playerid) | |
2694 | { | |
2695 | SetPlayerVirtualWorld(i, vw); | |
2696 | SetPlayerInterior(i, interior); | |
2697 | SetPlayerPos(i, pX, pY, pZ); | |
2698 | } | |
2699 | } | |
2700 | static strtmp[67], strname[MAX_PLAYER_NAME + 1]; | |
2701 | GetPlayerName(playerid, strname, sizeof strname); | |
2702 | format(strtmp, sizeof strtmp, "Administrator %s teleported all to himself", strname); | |
2703 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2704 | } | |
2705 | return 1; | |
2706 | } | |
2707 | ||
2708 | CMD:settime(playerid, params[]) return admsys_cmd_settime(playerid, params); | |
2709 | admsys_cmd_settime(playerid, params[]) | |
2710 | { | |
2711 | if(IsPlayerAdminEx(playerid, 5)) | |
2712 | { | |
2713 | if(admsys_isnull(params) || !admsys_IsNumeric(params)) | |
2714 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /settime [hour]"); | |
2715 | params[0] = strval(params); | |
2716 | if(!(0 <= params[0] <= 23)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "The hour must be between 0 and 23"); | |
2717 | SetWorldTime(params[0]); | |
2718 | #if defined foreach | |
2719 | foreach(new i : Player) | |
2720 | #else | |
2721 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
2722 | #endif | |
2723 | { | |
2724 | SetPlayerTime(i, params[0], 0); | |
2725 | } | |
2726 | static strtmp[70], strname[MAX_PLAYER_NAME + 1]; | |
2727 | GetPlayerName(playerid, strname, sizeof strname); | |
2728 | format(strtmp, sizeof strtmp, "Administrator %s changed the time to %d hours", strname, params[0]); | |
2729 | #if ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
2730 | SendClientMessageToAll(ADMSYS_DEFAULT_COLOR, strtmp); | |
2731 | #else | |
2732 | SendMessageToAdmins(5, ADMSYS_DEFAULT_COLOR, strtmp); | |
2733 | #endif | |
2734 | } | |
2735 | return 1; | |
2736 | } | |
2737 | ||
2738 | CMD:destroyveh(playerid, params[]) return admsys_cmd_destroyveh(playerid, params); | |
2739 | CMD:destroyvehicle(playerid, params[]) return admsys_cmd_destroyveh(playerid, params); | |
2740 | admsys_cmd_destroyveh(playerid, params[]) | |
2741 | { | |
2742 | if(IsPlayerAdminEx(playerid, 5)) | |
2743 | { | |
2744 | if(admsys_isnull(params)) | |
2745 | { | |
2746 | if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are not in vehicle"); | |
2747 | params[0] = GetPlayerVehicleID(playerid); | |
2748 | } | |
2749 | else | |
2750 | { | |
2751 | if(!admsys_IsNumeric(params)) | |
2752 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /destroyveh [vehicle id]"); | |
2753 | params[0] = strval(params); | |
2754 | if(GetVehicleModel(params[0]) <= 0) | |
2755 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Vehicle is not found"); | |
2756 | } | |
2757 | static strtmp[26]; | |
2758 | DestroyVehicle(params[0]); | |
2759 | format(strtmp, sizeof strtmp, "Vehicle id %d destroyed", params[0]); | |
2760 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2761 | } | |
2762 | return 1; | |
2763 | } | |
2764 | ||
2765 | CMD:veh(playerid, const params[]) return admsys_cmd_veh(playerid, params); | |
2766 | CMD:vehicle(playerid, const params[]) return admsys_cmd_veh(playerid, params); | |
2767 | admsys_cmd_veh(playerid, const params[]) | |
2768 | { | |
2769 | if(IsPlayerAdminEx(playerid, 5)) | |
2770 | { | |
2771 | if(IsPlayerSpectating(playerid)) | |
2772 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are in spectator mode"); | |
2773 | if(admsys_isnull(params)) | |
2774 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /veh [vehicle id] [color 1] [color 2]"); | |
2775 | static strtmp[48]; | |
2776 | new pos, oldpos; | |
2777 | while(params[pos] > ' ') pos++; | |
2778 | strmid(strtmp, params, 0, pos); | |
2779 | if(!admsys_IsNumeric(strtmp)) | |
2780 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /veh [vehicle id] [color 1] [color 2]"); | |
2781 | new gveh = strval(strtmp); | |
2782 | if(!(400 <= gveh <= 611)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use the vehicle ID from 400 to 611"); | |
2783 | while(params[pos] == ' ') pos++; | |
2784 | oldpos = pos; | |
2785 | new gcolor1, gcolor2; | |
2786 | if(params[oldpos] == '\0') | |
2787 | { | |
2788 | gcolor1 = random(256); | |
2789 | gcolor2 = random(256); | |
2790 | } | |
2791 | else | |
2792 | { | |
2793 | while(params[pos] > ' ') pos++; | |
2794 | strmid(strtmp, params, oldpos, pos); | |
2795 | if(!admsys_IsNumeric(strtmp)) | |
2796 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /veh [vehicle id] [color 1] [color 2]"); | |
2797 | gcolor1 = strval(strtmp); | |
2798 | if(!(0 <= gcolor1 <= 255)) | |
2799 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use the color 1 from 0 to 255"); | |
2800 | while(params[pos] == ' ') pos++; | |
2801 | oldpos = pos; | |
2802 | while(params[pos] > ' ') pos++; | |
2803 | strmid(strtmp, params, oldpos, pos); | |
2804 | if(params[oldpos] == '\0' || !admsys_IsNumeric(strtmp)) | |
2805 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /veh [vehicle id] [color 1] [color 2]"); | |
2806 | gcolor2 = strval(strtmp); | |
2807 | if(!(0 <= gcolor2 <= 255)) | |
2808 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use the color 2 from 0 to 255"); | |
2809 | } | |
2810 | new vid, Float:pX, Float:pY, Float:pZ, Float:pAngle; | |
2811 | GetPlayerPos(playerid, pX, pY, pZ); | |
2812 | GetPlayerFacingAngle(playerid, pAngle); | |
2813 | vid = CreateVehicle(gveh, pX, pY, pZ, pAngle, gcolor1, gcolor2, -1); | |
2814 | SetVehicleVirtualWorld(vid, GetPlayerVirtualWorld(playerid)); | |
2815 | LinkVehicleToInterior(vid, GetPlayerInterior(playerid)); | |
2816 | PutPlayerInVehicle(playerid, vid, 0); | |
2817 | format(strtmp, sizeof strtmp, "Vehicle id %d with colors %d and %d spawned", vid, gcolor1, gcolor2); | |
2818 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2819 | } | |
2820 | return 1; | |
2821 | } | |
2822 | ||
2823 | CMD:skick(playerid, const params[]) return admsys_cmd_skick(playerid, params); | |
2824 | CMD:silentkick(playerid, const params[]) return admsys_cmd_skick(playerid, params); | |
2825 | admsys_cmd_skick(playerid, const params[]) | |
2826 | { | |
2827 | if(IsPlayerAdminEx(playerid, 5)) | |
2828 | { | |
2829 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /skick [id]"); | |
2830 | static strtmp2[10]; | |
2831 | for(new i = 1, strtmp[32], pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
2832 | { | |
2833 | while(params[pos] == ' ') pos++; | |
2834 | if(params[pos]) | |
2835 | { | |
2836 | oldpos = pos; | |
2837 | while(params[pos] > ' ') pos++; | |
2838 | strmid(strtmp, params, oldpos, pos); | |
2839 | if(!admsys_IsNumeric(strtmp)) | |
2840 | { | |
2841 | strtmp = "Use: /skick [id]"; | |
2842 | if(i > 1) | |
2843 | { | |
2844 | for(j = 2; j <= i; j++) | |
2845 | { | |
2846 | format(strtmp2, sizeof strtmp2, " [id %d]", j); | |
2847 | strcat(strtmp, strtmp2); | |
2848 | } | |
2849 | } | |
2850 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2851 | } | |
2852 | giveid = strval(strtmp); | |
2853 | if(!IsPlayerConnected(giveid)) | |
2854 | { | |
2855 | if(i == 1) strtmp = "Player is not found"; | |
2856 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
2857 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2858 | } | |
2859 | else | |
2860 | { | |
2861 | CallRemoteFunction("OnPlayerKick", "iii", giveid, playerid, true); | |
2862 | Kick(giveid); | |
2863 | } | |
2864 | } | |
2865 | } | |
2866 | } | |
2867 | return 1; | |
2868 | } | |
2869 | ||
2870 | CMD:sban(playerid, const params[]) return admsys_cmd_sban(playerid, params); | |
2871 | CMD:silentban(playerid, const params[]) return admsys_cmd_sban(playerid, params); | |
2872 | admsys_cmd_sban(playerid, const params[]) | |
2873 | { | |
2874 | if(IsPlayerAdminEx(playerid, 5)) | |
2875 | { | |
2876 | if(admsys_isnull(params)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Use: /sban [id]"); | |
2877 | static strtmp2[10]; | |
2878 | for(new i = 1, strtmp[32], pos, oldpos, giveid, j; i <= ADMSYS_MAX_GIVE_PLAYERS_IN_CMD; i++) | |
2879 | { | |
2880 | while(params[pos] == ' ') pos++; | |
2881 | if(params[pos]) | |
2882 | { | |
2883 | oldpos = pos; | |
2884 | while(params[pos] > ' ') pos++; | |
2885 | strmid(strtmp, params, oldpos, pos); | |
2886 | if(!admsys_IsNumeric(strtmp)) | |
2887 | { | |
2888 | strtmp = "Use: /sban [id]"; | |
2889 | if(i > 1) | |
2890 | { | |
2891 | for(j = 2; j <= i; j++) | |
2892 | { | |
2893 | format(strtmp2, sizeof strtmp2, " [id %d]", j); | |
2894 | strcat(strtmp, strtmp2); | |
2895 | } | |
2896 | } | |
2897 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2898 | } | |
2899 | giveid = strval(strtmp); | |
2900 | if(!IsPlayerConnected(giveid)) | |
2901 | { | |
2902 | if(i == 1) strtmp = "Player is not found"; | |
2903 | else format(strtmp, sizeof strtmp, "Player %d is not found", i); | |
2904 | SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, strtmp); | |
2905 | } | |
2906 | else | |
2907 | { | |
2908 | CallRemoteFunction("OnPlayerBan", "iii", giveid, playerid, true); | |
2909 | Ban(giveid); | |
2910 | } | |
2911 | } | |
2912 | } | |
2913 | } | |
2914 | return 1; | |
2915 | } | |
2916 | ||
2917 | stock SetPlayerAdminLevel(playerid, lvl) | |
2918 | { | |
2919 | if(!IsPlayerConnected(playerid)) return 0; | |
2920 | if(!(0 <= lvl <= 5)) return -1; | |
2921 | AdmSysInfo[playerid][asAdminLvl] = lvl; | |
2922 | return 1; | |
2923 | } | |
2924 | ||
2925 | stock GetPlayerAdminLevel(playerid) | |
2926 | { | |
2927 | if(!IsPlayerConnected(playerid)) return 0; | |
2928 | if(IsPlayerAdmin(playerid)) return 5; | |
2929 | return AdmSysInfo[playerid][asAdminLvl]; | |
2930 | } | |
2931 | ||
2932 | stock IsPlayerAdminEx(playerid, lvl = 1) return (GetPlayerAdminLevel(playerid) >= lvl); | |
2933 | ||
2934 | stock SetPlayerMuteTime(playerid, time) | |
2935 | { | |
2936 | if(!IsPlayerConnected(playerid)) return 0; | |
2937 | if(time < 0) return -1; | |
2938 | AdmSysInfo[playerid][asMuteTime] = time; | |
2939 | return 1; | |
2940 | } | |
2941 | ||
2942 | stock GetPlayerMuteTime(playerid) return (IsPlayerConnected(playerid) ? AdmSysInfo[playerid][asMuteTime] : 0); | |
2943 | ||
2944 | stock UpdateSuspectList() | |
2945 | { | |
2946 | new c; | |
2947 | for(new i, j; i < sizeof SuspectList; ++i) | |
2948 | { | |
2949 | if(!IsPlayerConnected(SuspectList[i])) | |
2950 | { | |
2951 | c++; | |
2952 | for(j = i; j < sizeof(SuspectList) - 1; ++j) SuspectList[j] = SuspectList[j + 1]; | |
2953 | SuspectList[j] = INVALID_PLAYER_ID; | |
2954 | } | |
2955 | } | |
2956 | return c; | |
2957 | } | |
2958 | ||
2959 | stock AddPlayerInSuspectList(playerid) | |
2960 | { | |
2961 | UpdateSuspectList(); | |
2962 | if(IsPlayerConnected(playerid)) | |
2963 | { | |
2964 | new i; | |
2965 | for(i = sizeof(SuspectList) - 1; i >= 0; --i) | |
2966 | { | |
2967 | if(SuspectList[i] == playerid) return 0; | |
2968 | } | |
2969 | new tmp1 = SuspectList[0], tmp2; | |
2970 | for(i = 0; i < sizeof(SuspectList) - 1; ++i) | |
2971 | { | |
2972 | tmp2 = SuspectList[i + 1]; | |
2973 | SuspectList[i + 1] = tmp1; | |
2974 | tmp1 = tmp2; | |
2975 | } | |
2976 | SuspectList[0] = playerid; | |
2977 | return 1; | |
2978 | } | |
2979 | return 0; | |
2980 | } | |
2981 | ||
2982 | stock RemovePlayerFromSuspectList(playerid) | |
2983 | { | |
2984 | for(new i = sizeof(SuspectList) - 1; i >= 0; --i) | |
2985 | { | |
2986 | if(SuspectList[i] == playerid) | |
2987 | { | |
2988 | SuspectList[i] = INVALID_PLAYER_ID; | |
2989 | break; | |
2990 | } | |
2991 | } | |
2992 | UpdateSuspectList(); | |
2993 | return 1; | |
2994 | } | |
2995 | ||
2996 | stock SendMessageToAdmins(lvl, color, const msg[]) | |
2997 | { | |
2998 | #if defined foreach | |
2999 | foreach(new i : Player) | |
3000 | #else | |
3001 | for(new i = GetPlayerPoolSize(); i >= 0; --i) | |
3002 | #endif | |
3003 | { | |
3004 | if(GetPlayerAdminLevel(i) >= lvl) SendClientMessage(i, color, msg); | |
3005 | } | |
3006 | return 1; | |
3007 | } | |
3008 | ||
3009 | static stock admsys_IsNumeric(const string[]) | |
3010 | { | |
3011 | new length = strlen(string); | |
3012 | if(length == 0) return 0; | |
3013 | for(new i; i < length; i++) | |
3014 | { | |
3015 | if(!('0' <= string[i] <= '9' || i == 0 && (string[i] == '-' || string[i] == '+'))) return 0; | |
3016 | } | |
3017 | return 1; | |
3018 | } | |
3019 | ||
3020 | static IsPlayerSpectating(playerid) return IsPlayerConnected(AdmSysInfo[playerid][asSpecID]); | |
3021 | ||
3022 | static StartSpectating(playerid, specid) | |
3023 | { | |
3024 | if(!IsPlayerConnected(playerid) || !IsPlayerConnected(specid)) return 0; | |
3025 | if(playerid == specid) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You can't spectate yourself"); | |
3026 | if(IsPlayerSpectating(specid)) return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is in spectator mode"); | |
3027 | if(AdmSysInfo[playerid][asSpecID] == specid) return UpdateSpectating(playerid); | |
3028 | if(!AdmSysInfo[specid][asIsSpawned] && !AdmSysInfo[specid][asIsDead]) | |
3029 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player is not spawned"); | |
3030 | if(!IsPlayerSpectating(playerid)) | |
3031 | { | |
3032 | for(new i = 12; i >= 0; --i) | |
3033 | GetPlayerWeaponData(playerid, i, AdmSysInfo[playerid][asLastWeapon][i], AdmSysInfo[playerid][asLastAmmo][i]); | |
3034 | GetPlayerPos(playerid, AdmSysInfo[playerid][asLastPos][0], | |
3035 | AdmSysInfo[playerid][asLastPos][1], AdmSysInfo[playerid][asLastPos][2]); | |
3036 | AdmSysInfo[playerid][asLastSpec] = (GetPlayerState(playerid) == PLAYER_STATE_SPECTATING); | |
3037 | GetPlayerFacingAngle(playerid, AdmSysInfo[playerid][asLastAngle]); | |
3038 | AdmSysInfo[playerid][asLastVW] = GetPlayerVirtualWorld(playerid); | |
3039 | AdmSysInfo[playerid][asLastInt] = GetPlayerInterior(playerid); | |
3040 | } | |
3041 | AdmSysInfo[playerid][asLastSpecID] = AdmSysInfo[playerid][asSpecID]; | |
3042 | TogglePlayerSpectating(playerid, 1); | |
3043 | if(AdmSysInfo[specid][asIsDead]) SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "Player has died"); | |
3044 | SetPlayerInterior(playerid, GetPlayerInterior(specid)); | |
3045 | SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(specid)); | |
3046 | if(IsPlayerInAnyVehicle(specid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(specid)); | |
3047 | else PlayerSpectatePlayer(playerid, specid); | |
3048 | AdmSysInfo[playerid][asSpecID] = specid; | |
3049 | UpdateSpecInfo(playerid); | |
3050 | return 1; | |
3051 | } | |
3052 | ||
3053 | static UpdateSpectating(playerid) | |
3054 | { | |
3055 | if(!IsPlayerConnected(playerid)) return 0; | |
3056 | if(AdmSysInfo[playerid][asSpecID] == INVALID_PLAYER_ID) | |
3057 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are not in spectator mode"); | |
3058 | if(!IsPlayerConnected(AdmSysInfo[playerid][asSpecID])) return StopSpectating(playerid); | |
3059 | TogglePlayerSpectating(playerid, 1); | |
3060 | SetPlayerInterior(playerid, GetPlayerInterior(AdmSysInfo[playerid][asSpecID])); | |
3061 | SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(AdmSysInfo[playerid][asSpecID])); | |
3062 | if(IsPlayerInAnyVehicle(AdmSysInfo[playerid][asSpecID])) | |
3063 | PlayerSpectateVehicle(playerid, GetPlayerVehicleID(AdmSysInfo[playerid][asSpecID])); | |
3064 | else PlayerSpectatePlayer(playerid, AdmSysInfo[playerid][asSpecID]); | |
3065 | return 1; | |
3066 | } | |
3067 | ||
3068 | static StopSpectating(playerid) | |
3069 | { | |
3070 | if(!IsPlayerConnected(playerid)) return 0; | |
3071 | if(AdmSysInfo[playerid][asSpecID] == INVALID_PLAYER_ID) | |
3072 | return SendClientMessage(playerid, ADMSYS_DEFAULT_COLOR, "You are not in spectator mode"); | |
3073 | if(AdmSysInfo[playerid][asLastSpecID] == INVALID_PLAYER_ID || AdmSysInfo[playerid][asLastSpecID] == AdmSysInfo[playerid][asSpecID]) | |
3074 | { | |
3075 | AdmSysInfo[playerid][asSpecID] = INVALID_PLAYER_ID; | |
3076 | AdmSysInfo[playerid][asLastSpecID] = INVALID_PLAYER_ID; | |
3077 | TogglePlayerSpectating(playerid, AdmSysInfo[playerid][asLastSpec]); | |
3078 | KillTimer(AdmSysInfo[playerid][asUpdTimer]); | |
3079 | } | |
3080 | else | |
3081 | { | |
3082 | AdmSysInfo[playerid][asSpecID] = AdmSysInfo[playerid][asLastSpecID]; | |
3083 | AdmSysInfo[playerid][asLastSpecID] = INVALID_PLAYER_ID; | |
3084 | UpdateSpectating(playerid); | |
3085 | } | |
3086 | return 1; | |
3087 | } | |
3088 | ||
3089 | #undef ADMSYS_SEND_ACTION_MSGS_TO_ALL | |
3090 | #undef ADMSYS_SEND_CONNECT_MSGS_TO_ADM | |
3091 | #undef ADMSYS_SHOW_KILL_LIST_FOR_ADM | |
3092 | ||
3093 | #undef ADMSYS_DEFAULT_COLOR | |
3094 | ||
3095 | #undef ADMSYS_MAX_WARNS | |
3096 | #undef ADMSYS_MAX_TAB_INPUT | |
3097 | #undef ADMSYS_MAX_SUSPECTS_IN_TABLE | |
3098 | #undef ADMSYS_MAX_GIVE_PLAYERS_IN_CMD | |
3099 | ||
3100 | #undef admsys_isnull | |
3101 | #undef admsys_fpublic |