#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define PLUGIN "Screenshot"
#define VERSION "1.0"
#define AUTHOR "mis"
// 0, 0, 255 - RGB (Kolory)
// 0.02 - położenie X
// 0.17 - położenie Y
// 6.0 - k**wa zapomniałem
// 10.0 - czas wyświetlania
new screen = 0;
new nick;
new gSyncMessage;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_concmd("amx_ss", "screeny", ADMIN_ALL, "amx_ss <nick lub userid gracza> <komenda zrobi wybranemu graczowi 2 screenshoty>");
gSyncMessage = CreateHudSyncObj();
}
public killplayer(player) {
user_silentkill(player)
}
public info(player) {
show_motd(player, "infoss.html","Instrukcja wrzucania screenshotow! ")
}
public screeny(id,level,cid) {
if(!cmd_access(id,level,cid,2))
return PLUGIN_HANDLED;
new argument[32]
read_argv(1,argument,31)
new player = cmd_target(id,argument,31)
new name[32], nip[32], pname[32], pip[32], timer[32], mapa[32], file[32], data[9];
get_user_name(id, name, 31); // Uzytkownik, Nick
get_user_ip(id, nip, 31); // Uzytkownik IP
get_user_name(player, pname, 31); // Gracz, Nick
get_user_ip(player, pip, 31); // Gracz IP
get_mapname(mapa, 31); // mapa
get_time("%d/%m/%Y - %H:%M:%S", timer, 31); // czas
get_time("%Y%m", data, 8); // czas do pliku
format(file, 31, "screeny_%s.log", data); // nazwa pliku
if(nick!=player) {
screen=0;
}
if(screen<30) {
client_cmd(player,"snapshot")
client_cmd(player,"screenshot")
console_print(id, "******************************************************")
console_print(id, "** Zrobiles 2 screeny ** 1 bmp || 1 tga ** ! **")
console_print(id, "** Nick gracza: %s IP: %s **",pname, pip)
console_print(id, "** %s **", timer)
console_print(id, "******************************************************")
//server_cmd("amx_chat Admin: %s zrobil screeny graczowi: %s", name, pname)
//client_print(amx_chat, print_chat, "** Trwa robienie screenow graczowi %s przez admina %s", pname, name)
//client_print(id, print_chat, "** Wiecej informacji w konsoli")
nick=player;
log_to_file(file, "Mapa: %s | Admin: %s (IP: %s) zrobil 2 screenshoty graczowi: %s (IP: %s)", mapa, name, nip, pname, pip)
screen++;
}
if(screen==30) {
screen = 0;
set_hudmessage(3, 128, 32, 0.02, 0.17, 0, 6.0, 10.0)
ShowSyncHudMsg(id,gSyncMessage, "Admin: %s Zrobil 30 screenshotow ^nGraczowi: %s", name,pname)
client_print(player,print_chat,"Admin: %s zrobil Ci 30 screenow (15 .tga i 15 .bmp)",name)
console_print(player, "******************************************************")
console_print(player, "** Admin: %s Zrobil Ci 30 screenshotow ** 15 bmp || 15 tga ** ! **",name)
console_print(player, "** %s **", timer)
console_print(player, "** Wejdz na www.***.pl by uzyskac wiecej informacji !! **")
console_print(player, "******************************************************")
set_task(6.0,"killplayer",player)
cs_set_user_team(player,CS_TEAM_SPECTATOR);
//show_motd(player, "infoss.html","Instrukcja wrzucania screenshotow!")
set_task(2.0,"info",player)
client_cmd(player, "kill")
}
return PLUGIN_HANDLED;
}
Trochę już go edytowałem, ale nie bardzo wiem, co zrobić, żeby nie było tego podziału, że jak wartość ss jest mniejsza niż 30, to robi "to", a jak jest już 30 to robi "to". Na początku skomentowałem tego drugiego ifa i plugin się skompilował, ale wyskoczył błąd
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team Warning: Symbol is assigned a value that is never used: "gSyncMessage" on line 92 Header size: 700 bytes Code size: 4492 bytes Data size: 2520 bytes Stack/heap size: 16384 bytes; estimated max. usage=781 cells (3124 bytes) Total requirements: 24096 bytes 1 Warning. Done.Pewnie i z tym błędem wszystko by działało, ale wolę, żeby było bez tego.
Co zrobić, żeby nie było żadnych dodatkowych funkcji, typu wyświetlanie motd po 30 ssach, itp.? Chce żeby było samo to co jest przed 30 screanem.