Siema,
Szukam pluginu który po wpisaniu odpowiedniej komendy przez admina wywoła graczowi test na 32 bity. Nie chodzi mi o taki co po wejściu na serwer każdemu wywali testem.
Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
|
Napisano 01.03.2015 12:42
Siema,
Szukam pluginu który po wpisaniu odpowiedniej komendy przez admina wywoła graczowi test na 32 bity. Nie chodzi mi o taki co po wejściu na serwer każdemu wywali testem.
Napisano 01.03.2015 14:46
Sorki administracjo.
/***************************************************
This plugin is to test if players have set 32-bit.
Multiple pictures are show to each player and he or she needs to
choose proper one (in menu). If player does not choose properly
after X tries he or she is disconnected. Pictures are show after
the player dies, not to disturb the gameplay.
CVARs (default):
32bit_max_tries "2"
32bit_immunity_flag ""
Plugin is using "data/lang/32bit_test.txt" language file.
***************************************************/
#include <amxmodx>
#include <amxmisc>
new g_test_details[33][3];
new g_tested[33];
new g_tries[33];
new g_quick_test[33];
new g_immunity_flag;
new p_tested32bit[33];
new p_max_tries;
new p_immunity_flag;
new p_warmup_active; //this cvar is to prevent from testing players during warmup. When "amx_warmup_active" is "1" then tests do not occur (you can use it for custom warmup)
public plugin_init(){
register_plugin("32-bit test","2.0","Czesio");
register_dictionary("32bit_test.txt");
p_max_tries = register_cvar("32bit_max_tries", "2");
p_immunity_flag = register_cvar("32bit_immunity_flag", "");
p_warmup_active = register_cvar("amx_warmup_active", "0");
new tmp[32];
for(new i=1; i<33; i++){
formatex(tmp,31,"tested32bit_%d",i);
p_tested32bit[i] = register_cvar(tmp,"0");
g_tested[i] = get_pcvar_num(p_tested32bit[i]);
}
get_pcvar_string(p_immunity_flag, tmp, 31);
g_immunity_flag = read_flags(tmp);
register_menucmd(register_menuid("menu_start"), 511, "menu_start_handler");
register_menucmd(register_menuid("menu_a"), 511, "menu_a_handler");
register_menucmd(register_menuid("menu_b"), 511, "menu_b_handler");
register_menucmd(register_menuid("menu_c"), 511, "menu_c_handler");
register_concmd("amx_bittest", "test_pre", ADMIN_CVAR, "amx_ittest <nick/id>")
}
public client_connect(id){
g_tries[id] = 0;
g_quick_test[id] = 0;
}
public test_pre(id, level ,cid) {
if(!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED;
new nazwa[33]
read_argv(1, nazwa, 32)
new player = cmd_target(id, nazwa, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
if (!player) {
client_print(id, print_console, "Nie ma takiego gracza!")
return PLUGIN_HANDLED
}
test_player(id)
get_user_name(player, nazwa, 32)
client_print(id, print_console, "Test zostanie wykonany na graczu: %s", nazwa)
return PLUGIN_CONTINUE
}
public test_player(id){
if(get_pcvar_num(p_warmup_active))
return;
if(is_user_connected(id) && !is_user_bot(id) && !is_user_hltv(id) && g_tested[id] != get_user_userid(id)){
if(get_user_flags(id) & g_immunity_flag){
g_tested[id] = get_user_userid(id);
return;
}
g_tries[id]++;
if(g_tries[id] > get_pcvar_num(p_max_tries)){
test_failed(id);
}
else{
g_test_details[id][0] = random(8) + 1;
g_test_details[id][1] = random(8) + 1;
g_test_details[id][2] = random(8) + 1;
if(g_quick_test[id])
show_menu_test(id,0);
else
show_menu_start(id);
}
}
}
public menu_start_handler(id,key){
key++;
if(key == 1)
show_menu_test(id,0);
else if(key == 2)
kick_player(id);
else if(key == 4)
show_more_info(id);
else if(key == 5){
g_quick_test[id] = 1;
show_menu_test(id,0);
}
else
show_menu_start(id);
}
public menu_a_handler(id,key){
menu_test_handler(id, key, 0);
}
public menu_b_handler(id,key){
menu_test_handler(id, key, 1);
}
public menu_c_handler(id,key){
menu_test_handler(id, key, 2);
}
public menu_test_handler(id, key, stage){
key++;
if(key == 9)
show_menu_test(id, stage);
else if(stage == 2 && key == g_test_details[id][stage])
test_passed(id);
else if(key == g_test_details[id][stage])
show_menu_test(id, stage + 1);
else
test_failed(id);
}
public show_menu_start(id){
new menu_body[1000];
formatex(menu_body, 999, "\w%L^n^n\w1. %L^n\w2. %L^n^n\w4. %L^n\w5. %L", id, "WELCOME", id, "WELCOME_ANS1", id, "WELCOME_ANS2", id, "WELCOME_ANS4", id, "WELCOME_ANS5");
show_menu(id, 511, menu_body, -1, "menu_start");
}
public show_menu_test(id, stage){
new menu_body[1000];
if(stage == 0){
formatex(menu_body, 999, "\w%L^n^n\w1. A1^n\w2. A2^n\w3.\w A3^n\w4.\w A4^n\w5.\w A5^n\w6.\w A6^n\w7.\w A7^n\w8.\w A8^n^n\w9. %L", id, "CHOOSE_PICTURE", id, "SHOW_AGAIN");
show_menu(id, 511, menu_body, -1, "menu_a");
}
else if(stage == 1){
formatex(menu_body, 999, "\w%L^n^n\w1. B1^n\w2. B2^n\w3.\w B3^n\w4.\w B4^n\w5.\w B5^n\w6.\w B6^n\w7.\w B7^n\w8.\w B8^n^n\w9. %L", id, "CHOOSE_PICTURE", id, "SHOW_AGAIN");
show_menu(id, 511, menu_body, -1, "menu_b");
}
else{
formatex(menu_body, 999, "\w%L^n^n\w1. C1^n\w2. C2^n\w3.\w C3^n\w4.\w C4^n\w5.\w C5^n\w6.\w C6^n\w7.\w C7^n\w8.\w C8^n^n\w9. %L", id, "CHOOSE_PICTURE", id, "SHOW_AGAIN");
show_menu(id, 511, menu_body, -1, "menu_c");
}
if(!g_quick_test[id] || stage == 0)
do_motd(id, stage);
}
public show_more_info(id){
do_motd(id, -1);
show_menu_start(id);
}
public do_motd(id,stage){
new motd[2000];
new find_string[50];
new replace_string[50];
motd = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd'><html><head><style type='text/css'>body{background:black;color:#fff;font:bold 16px Arial;text-align:center;margin:0;padding:0}th,td{padding-top:4px}b,u{display:inline-block;width:16px;height:48px}td b{background:#808080}td u{background:#7f7f7f}th b{background:#878787}th u{background:#787878}</style><meta http-equiv='content-type' content='text/html;charset=UTF-8'/></head>";
if(stage != -1 && g_quick_test[id] == 0){
new c;
if(stage == 0)
c = 'A';
else if(stage == 1)
c = 'B';
else if(stage == 2)
c = 'C';
format(motd,1999,"%s<body><br/>%L<br/><br/><table cellpadding='0' cellspacing='5' style='margin:0 auto'><tr><td>%c1<br><b></b><u></u><b></b></td><td>%c2<br><b></b><u></u><b></b></td><td>%c3<br><b></b><u></u><b></b></td><td>%c4<br><b></b><u></u><b></b></td><td>%c5<br><b></b><u></u><b></b></td><td>%c6<br><b></b><u></u><b></b></td><td>%c7<br><b></b><u></u><b></b></td><td>%c8<br><b></b><u></u><b></b></td></tr></table><br/>%L %d / 3</body></html>",motd,id,"DETAILS",c,c,c,c,c,c,c,c,id,"STAGE",stage+1);
formatex(find_string,49,"<td>%c%d<br><b></b><u></u><b></b></td>",c, g_test_details[id][stage]);
formatex(replace_string,49,"<th>%c%d<br><b></b><u></u><b></b></th>",c, g_test_details[id][stage]);
replace(motd, 1999, find_string, replace_string);
}
else if(stage != -1){
strcat(motd,"<body><table cellpadding='0' cellspacing='5' style='margin:0 auto'><tr><td>A1<br><b></b><u></u><b></b></td><td>A2<br><b></b><u></u><b></b></td><td>A3<br><b></b><u></u><b></b></td><td>A4<br><b></b><u></u><b></b></td><td>A5<br><b></b><u></u><b></b></td><td>A6<br><b></b><u></u><b></b></td><td>A7<br><b></b><u></u><b></b></td><td>A8<br><b></b><u></u><b></b></td></tr>",1999);
strcat(motd,"<tr><td>B1<br><b></b><u></u><b></b></td><td>B2<br><b></b><u></u><b></b></td><td>B3<br><b></b><u></u><b></b></td><td>B4<br><b></b><u></u><b></b></td><td>B5<br><b></b><u></u><b></b></td><td>B6<br><b></b><u></u><b></b></td><td>B7<br><b></b><u></u><b></b></td><td>B8<br><b></b><u></u><b></b></td></tr>",1999);
strcat(motd,"<tr><td>C1<br><b></b><u></u><b></b></td><td>C2<br><b></b><u></u><b></b></td><td>C3<br><b></b><u></u><b></b></td><td>C4<br><b></b><u></u><b></b></td><td>C5<br><b></b><u></u><b></b></td><td>C6<br><b></b><u></u><b></b></td><td>C7<br><b></b><u></u><b></b></td><td>C8<br><b></b><u></u><b></b></td></tr></table></body></html>",1999);
formatex(find_string,49,"<td>A%d<br><b></b><u></u><b></b></td>",g_test_details[id][0]);
formatex(replace_string,49,"<th>A%d<br><b></b><u></u><b></b></th>",g_test_details[id][0]);
replace(motd,1999,find_string,replace_string);
formatex(find_string,49,"<td>B%d<br><b></b><u></u><b></b></td>",g_test_details[id][1]);
formatex(replace_string,49,"<th>B%d<br><b></b><u></u><b></b></th>",g_test_details[id][1]);
replace(motd,1999,find_string,replace_string);
formatex(find_string,49,"<td>C%d<br><b></b><u></u><b></b></td>",g_test_details[id][2]);
formatex(replace_string,49,"<th>C%d<br><b></b><u></u><b></b></th>",g_test_details[id][2]);
replace(motd,1999,find_string,replace_string);
}
else{
format(motd,1999,"%s<body><br/>%L</body></html>", motd, id, "MORE_INFO");
}
show_motd(id, motd, "32-bit test");
}
public test_passed(id){
g_tested[id] = get_user_userid(id);
set_pcvar_num(p_tested32bit[id], g_tested[id]);
client_print(id,print_chat,"[TEST] %L",LANG_PLAYER,"TEST_OK");
}
public test_failed(id){
if(g_tries[id] >= get_pcvar_num(p_max_tries)){
kick_player(id);
}
else{
if(get_pcvar_num(p_max_tries) - g_tries[id] == 1)
client_print(id,print_chat,"[TEST] %L",LANG_PLAYER,"TEST_BAD_1_TRY_LEFT",get_pcvar_num(p_max_tries) - g_tries[id]);
else
client_print(id,print_chat,"[TEST] %L",LANG_PLAYER,"TEST_BAD",get_pcvar_num(p_max_tries) - g_tries[id]);
}
}
public kick_player(id){
server_cmd("kick #%d 16-bit video", get_user_userid(id));
}
komenda:
amx_bittest <gracz/idgracza> // gracz z flagą ADMIN_CVAR
Napisano 01.03.2015 16:55
Dzięki
Niestety nie chce się skompilować:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team 32bit_test.sma(179) : error 075: input line too long (after substitutions) 32bit_test.sma(191) : error 075: input line too long (after substitutions) 32bit_test.sma(242) : error 001: expected token: "}", but found "-end of file-" 3 Errors. Could not locate output file 32bit_test.amxx (compile failed).
Napisano 01.03.2015 17:14
Ja u siebie skompilowałem bezproblemowo.
Napisano 01.03.2015 18:37
U mnie nie działa. Jedynie, że jeden błąd zniknął:
Welcome to the AMX Mod X 1.8.1-300 Compiler. Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team 32bit_test.sma(179) : error 075: input line too long (after substitutions) 32bit_test.sma(191) : error 075: input line too long (after substitutions) 2 Errors. Could not locate output file 32bit_test.amxx (compile failed).
Napisano 01.03.2015 21:50
Napisano 02.03.2015 14:00
Może mi ktoś to skompilować? Dam + za to po lokalnie też wywala, że jest za długa linia
Napisano 29.03.2015 11:58
Pomocy!!!
Napisano 29.03.2015 22:06
No i niby za co to ostrzeżenie i minusowy punkt? Chyba jak potrzebuję pomocy to podbijam temat, nie? I nie robię tego codziennie tylko co parę dni, chyba to widać? Widać ktoś ma kompleksy i się wyżywa na forum.
Laska d*py nie dała na dobranoc?
Tosty się spaliły?
Mama nie kupiła cukierka?
Użytkownik Spectre edytował ten post 29.03.2015 22:10
Napisano 29.03.2015 22:20
raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.0 użytkowników, 1 gości, 0 anonimowych