Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

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.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

32bit_test - plugin przy wyborze z menu kary karze admina zamiast gracza

32bit test grafika

  • Zamknięty Temat jest zamknięty
2 odpowiedzi w tym temacie

#1 CzarnaDupa

    Najgorszy z najgorszych >.<

  • Użytkownik

Reputacja: 83
Zaawansowany

  • Postów:268
  • GG:
  • Imię:Michał
  • Lokalizacja:Mielec
Offline

Napisano 12.04.2014 13:30

tak jak w temacie, plugin już modyfikowany kilka razy w jakimś tam temacie tutaj na forum lecz nadal karze nie tego kogo powinien ;)

 

/***************************************************

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.

***************************************************/

#pragma semicolon 1
#include <amxmodx> 
#include <amxmisc>
#define TASKID 18923

new g_test_details[33][3];
new his_tester[33];

public plugin_init(){
	register_plugin("32-bit test","2.0","Czesio edited by MarWit");
	register_dictionary("32bit_test.txt");
	register_clcmd("amx_32bit", "cmd32Bit", ADMIN_SLAY, "<nick>");
	
	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");
}

public cmd32Bit(id, level, cid)
{	
	if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED;

	new text[33];
	read_argv(1, text, 32);
	remove_quotes(text);
	new target = cmd_target(id, text, 8);
	if(!target) client_print(id, print_console, "Nie ma takiego gracza");
	
	test_player(target, id);
	return PLUGIN_HANDLED;
}

public test_player(id, admin){
	if(is_user_connected(id) && !is_user_bot(id) && !is_user_hltv(id)){
		g_test_details[id][0] = random(8) + 1;
		g_test_details[id][1] = random(8) + 1;
		g_test_details[id][2] = random(8) + 1;
		show_menu_test(id,0);
		his_tester[id] = admin;
	}
}

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_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");
	}
	do_motd(id, stage);
}

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){
		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){
	client_print(id,print_chat,"[TEST] %L",LANG_PLAYER,"TEST_OK");
	new nick[33];
	get_user_name(id, nick, 32);
	client_print(his_tester[id], print_chat, "[32BIT] Gracz %s przeszedl test POZYTYWNIE", nick);
	his_tester[id] = 0;
}

public test_failed(id){
	new nick[33];
	get_user_name(id, nick, 32);
	client_print(his_tester[id], print_chat, "[32BIT] Gracz %s przeszedl test NEGATYWNIE", nick);
	CoZrobic(his_tester[id], id);
	his_tester[id] = 0;
}

public CoZrobic(id, player)
{
	new menu = menu_create("Co chcesz zrobic?", "handleCoZrobic");
	new tmp[2];
	formatex(tmp, 1, "%d", player);
	menu_additem(menu, "Kicknij gracza", tmp);
	menu_additem(menu, "Zbanuj gracza (60 min)", tmp);
	menu_additem(menu, "Slaynij gracza", tmp);
	menu_additem(menu, "Powtorz test", tmp);
	menu_setprop(menu, MPROP_EXITNAME, "Nic");
	menu_display(id, menu);
}

public handleCoZrobic(id, menu, item)
{
	if(item == MENU_EXIT)
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}
	new access, callback, data[64];
	menu_item_getinfo(menu, item, access,  data, charsmax(data), _, _, callback);
	new iPlayer = str_to_num(data);
	new player[33];
	get_user_name(iPlayer, player, 32);
	
	
	switch(item)
	{
		case 0: client_cmd(id, "amx_kick ^"%s^" ^"Software^"", player);
		case 1: client_cmd(id, "amx_ban 60 ^"%s^" ^"Grafika software / 16bit^"", player);
		case 2: client_cmd(id, "amx_slay ^"%s^"", player);
		case 3: client_cmd(id, "amx_32bit ^"%s^"", player);
	}
	return PLUGIN_CONTINUE;
}



  • +
  • -
  • 0

#2 O'Zone

    Wszechobecny

  • Użytkownik

Reputacja: 594
Wszechwiedzący

  • Postów:409
  • Steam:steam
Offline

Napisano 12.04.2014 23:27

Spróbuj zamienić:

CoZrobic(his_tester[id], id);

Na:

CoZrobic(id, his_tester[id]);

  • +
  • -
  • 0
Pomogłem? Daj Dołączona grafika

#3 CzarnaDupa

    Najgorszy z najgorszych >.<

  • Autor tematu
  • Użytkownik

Reputacja: 83
Zaawansowany

  • Postów:268
  • GG:
  • Imię:Michał
  • Lokalizacja:Mielec
Offline

Napisano 13.04.2014 00:30   Najlepsza odpowiedź

Niestety to nie ta funkcja


  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: 32bit test grafika,

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych