amx_ss
sebul
29.09.2010
Mam taki plugin
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
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.
#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.
;((
29.09.2010
Dodam, że warninga z SyncMessage na innym plugu też miałem, ale warning NIE POWODUJE BŁĘDÓW w pluginie !
kamioool
29.09.2010
Wystarczy usunąć instrukcje.
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") }
sebul
29.09.2010
ekhmmmale warning NIE POWODUJE BŁĘDÓW w pluginie !
ale wolę, żeby było bez tego.
Czyli po prostu chce to zrobić na cacy i przy okazji czegoś się może nauczyć.
Dodano 29 wrzesień 2010 - 16:58:
No to tak jakby zrobił, bo skomentowałem to, ale jak widać, to nie wszystko, bo wyskoczył ten warning.Wystarczy usunąć instrukcje.
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") }
MaDaFaKa
29.09.2010
Skompiluj ten kod lokalnie(przez amxstudio), ponieważ mi działa bez problemów:
Użytkownik MaDaFaKa edytował ten post 29.09.2010 16:08
#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;
}
Użytkownik MaDaFaKa edytował ten post 29.09.2010 16:08
sebul
29.09.2010
hmmm... Najlepiej jakbym pozostawił to bez komentarza, ale... To że działa, to ja wiem, ale moje pytanie było takie, jak zrobić, żeby nie było tego błędu co na początku, a ten błąd robi się dlatego, bo chce usunąć tego ifa, że gdy ss jest jako 30 z kolei to zabija gracza i wyświetla info, że musi wrzucić screany.Skompiluj ten kod lokalnie(przez amxstudio), ponieważ mi działa bez problemów:
#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;
}
Czyli może podam jak ja to zrobiłem
#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) {
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++;
}
return PLUGIN_HANDLED;
}
MaDaFaKa
29.09.2010
Masz kod. Dobrze się kompiluje i powinien działać.
Użytkownik MaDaFaKa edytował ten post 29.09.2010 17:08
#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;
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>");
}
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++;
}
return PLUGIN_HANDLED;
}
Użytkownik MaDaFaKa edytował ten post 29.09.2010 17:08
sebul
29.09.2010
No dzięki, ale już sam doszedłem do tego, teraz kod wygląda tak
No i wszystko działa, ale czy da radę zrobić jakoś tak, żeby nie sprawdzał który to z kolei screan? bo jak dałem zamiast
tak
albo
To ssy się nie robiły.
#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;
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>");
}
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<100) {
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++;
}
return PLUGIN_HANDLED;
}
No i wszystko działa, ale czy da radę zrobić jakoś tak, żeby nie sprawdzał który to z kolei screan? bo jak dałem zamiast
if(screen<100) {
tak
if(screen) {
albo
if(screen>0) {
To ssy się nie robiły.