Knives Only - Problem Block Player

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 372
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 22 пъти
Получена благодарност: 2 пъти
Обратна връзка:

Knives Only - Problem Block Player

Мнение от lantimilan » 14 Мар 2019, 00:46

Hello sometimes when i set cvar in console i can see player can blocked in one space cant walk maybe its bug not happen all time but sometimes, i test plugin worked maybe someone can tell me if it code okey or need to change anything

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>

new knifeonly = 0;
new choice[2];
new voteknivesonly[] = "\yVetem Thika?\w^n^n1. Aktive^n2. Joaktive";

public plugin_init () {
	register_plugin ( "Knives Only", "0.1a", "SilverTide" );
	register_concmd ( "amx_thika", "cmdvetem_thika", ADMIN_CVAR, "- Aktivizohet ose fiket Vetem Thika." );
	register_concmd ( "amx_votothika", "cmdvoto_vetemthika", ADMIN_CVAR, "- Fillon nje votim per te mundesuar lojen Vetem Thika." );
	register_concmd ( "say /votothika", "cmdvotimi", ADMIN_CVAR, "- Fillon nje votim per te mundesuar loje Vetem Thika." );
	register_menucmd ( register_menuid("\yVetem Thika?"), (1<<0)|(1<<1), "count_votes" );
	register_event ( "CurWeapon", "knife", "b" );
}

public cmdvetem_thika ( id ) {
	new arg[2];
	read_argv ( 1, arg, 1 );
	set_hudmessage ( 200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2 );
	
	if ( equal ( arg, "1" ) ) {
		knifeonly = 1;
		client_cmd ( id, "weapon_knife" );
		console_print ( id, "[LS] Moda Vetem Thika eshte Aktivizuar, suksese." );
		show_hudmessage ( 0, "[LS] Moda Vetem Thika u Aktivizua, suksese te gjitheve." );
	} else if ( equal ( arg, "0" ) ) {
		knifeonly = 0
		console_print ( id, "[LS] Moda Vetem Thika eshte q'aktivizuar." );
		show_hudmessage ( 0, "[LS] Moda Vetem Thika eshte q'aktivizuar, ju mund te blini arme ne rundin e ri." );
	} else {
		if ( knifeonly == 0 ){
			console_print ( id, "Perdorimi: amx_thika 1 = Aktive 0 = Joaktive Aktualisht eshte: OFF" );
		}
		if ( knifeonly == 1 ){
			console_print ( id, "Perdorimi: amx_thika 1 = Aktive 0 = Joaktive Aktualisht eshte: ON" );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public knife ( id ) {
        if ( knifeonly == 0 ) {
            // Do Nothing;
        }
        if ( knifeonly == 1 ) {
            new clip, ammo;
            new usersweapon = get_user_weapon ( id, clip, ammo );
            
            if ( usersweapon == CSW_KNIFE ) {
                // Do Nothing
            } else {
				// Bury player and strip of weapons, then return to starting position
				new origin[3];
				get_user_origin ( id, origin );
				origin[2] -= 500;
				set_user_origin ( id, origin );
				new iwpn, iwpns[32], nwpn[32];
				get_user_weapons ( id, iwpns, iwpn );
				for ( new a = 0; a < iwpn; ++a ) {
					get_weaponname ( iwpns[a], nwpn, 31 );
					engclient_cmd ( id, "drop", nwpn );
				}
				new origin2[3];
				get_user_origin ( id, origin2 );
				origin2[2] += 500;
				set_user_origin ( id, origin2 );
				// Select the knife
				client_cmd ( id, "weapon_knife" );
            }
        }
        return PLUGIN_CONTINUE;
}

public cmdvotimi ( id ) {
    new Float:voting = get_cvar_float ( "amx_last_voting" );
    if ( voting > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Nje votim eshte hedhur^1 ." );
        return PLUGIN_HANDLED;
    }
    if ( voting && voting + get_cvar_float ( "amx_vote_delay" ) > get_gametime() ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Ju lutemi prisni per nje kohe te shkurter para se te jeni ne gjendje te votoni perseri." );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    new name[32];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float("amx_vote_time") + 10.0;
    get_user_info ( id, "name", name, 31 );
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_hudmessage ( 200, 0, 0, 0.05, 0.65, 2, 0.02, 30.0, 0.03, 0.3, 2 );
		
    show_hudmessage ( 0, "[LS] Admini %s ka filluar nje votim per Moden Vetem Thika", name );
    set_task ( votetime, "check_the_votes" );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public cmdvoto_vetemthika ( id ) {
    new Float:voting = get_cvar_float ( "amx_last_voting" );
    if ( voting > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Nje votim eshte hedhur^1 ." );
        return PLUGIN_HANDLED;
    }
    if ( voting && voting + get_cvar_float( "amx_vote_delay" ) > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Ju lutemi prisni per nje kohe te shkurter para se te jeni ne gjendje te votoni perseri." );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float ( "amx_vote_time" ) + 10.0;
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_task ( votetime, "check_the_votes" );
    ColorChat(0, GREEN, "^1[^4LS^1] ^3Votimi ka filluar^1 ." );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public count_votes ( id, key ) {
    if ( get_cvar_float ( "amx_vote_answers" ) ) {
        new name[32];
        get_user_name ( id, name, 31 );
        ColorChat(0, GREEN, "^1[^4LS^1] ^4%s ^1votoj per ^4%s", name, key ? "perseri vetem thika" : "per thika vetem" );
    }
    ++choice[key];
    return PLUGIN_HANDLED;
}

public check_the_votes ( id ) {
    if ( choice[0] > choice[1] ) {
        server_cmd ( "amx_thika 1" );
        ColorChat(0, GREEN, "^1[^4LS^1] Rezultatet e votimi per ^4Vetem Thike ^1jane keto: (Per ^"%d^") (Kunder ^"%d^"). *", choice[0], choice[1] );
    } else {
        server_cmd ( "amx_thika 0" );
        ColorChat(0, GREEN, "^1[^4LS^1] Rezultatet e votimi per ^4Vetem Thike ^1jane keto: (Per ^"%d^") (Kunder ^"%d^"). *", choice[0], choice[1] );
    }
    return PLUGIN_CONTINUE;
}
Последно промяна от lantimilan на 14 Мар 2019, 15:04, променено общо 1 път.

Аватар
Autumn Shade
Извън линия
Developer
Developer
Мнения: 267
Регистриран на: 14 Мар 2019, 13:20
Се отблагодари: 48 пъти
Получена благодарност: 144 пъти

Knives Only

Мнение от Autumn Shade » 14 Мар 2019, 13:44

lantimilan написа:
14 Мар 2019, 00:46
Hello sometimes when i set cvar in console i can see player can blocked in one space cant walk maybe its bug not happen all time but sometimes, i test plugin worked maybe someone can tell me if it code okey or need to change anything

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>

new knifeonly = 0;
new choice[2];
new voteknivesonly[] = "\yVetem Thika?\w^n^n1. Aktive^n2. Joaktive";

public plugin_init () {
	register_plugin ( "Knives Only", "0.1a", "SilverTide" );
	register_concmd ( "amx_thika", "cmdvetem_thika", ADMIN_CVAR, "- Aktivizohet ose fiket Vetem Thika." );
	register_concmd ( "amx_votothika", "cmdvoto_vetemthika", ADMIN_CVAR, "- Fillon nje votim per te mundesuar lojen Vetem Thika." );
	register_concmd ( "say /votothika", "cmdvotimi", ADMIN_CVAR, "- Fillon nje votim per te mundesuar loje Vetem Thika." );
	register_menucmd ( register_menuid("\yVetem Thika?"), (1<<0)|(1<<1), "count_votes" );
	register_event ( "CurWeapon", "knife", "b" );
}

public cmdvetem_thika ( id ) {
	new arg[2];
	read_argv ( 1, arg, 1 );
	set_hudmessage ( 200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2 );
	
	if ( equal ( arg, "1" ) ) {
		knifeonly = 1;
		client_cmd ( id, "weapon_knife" );
		console_print ( id, "[LS] Moda Vetem Thika eshte Aktivizuar, suksese." );
		show_hudmessage ( 0, "[LS] Moda Vetem Thika u Aktivizua, suksese te gjitheve." );
	} else if ( equal ( arg, "0" ) ) {
		knifeonly = 0
		console_print ( id, "[LS] Moda Vetem Thika eshte q'aktivizuar." );
		show_hudmessage ( 0, "[LS] Moda Vetem Thika eshte q'aktivizuar, ju mund te blini arme ne rundin e ri." );
	} else {
		if ( knifeonly == 0 ){
			console_print ( id, "Perdorimi: amx_thika 1 = Aktive 0 = Joaktive Aktualisht eshte: OFF" );
		}
		if ( knifeonly == 1 ){
			console_print ( id, "Perdorimi: amx_thika 1 = Aktive 0 = Joaktive Aktualisht eshte: ON" );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public knife ( id ) {
        if ( knifeonly == 0 ) {
            // Do Nothing;
        }
        if ( knifeonly == 1 ) {
            new clip, ammo;
            new usersweapon = get_user_weapon ( id, clip, ammo );
            
            if ( usersweapon == CSW_KNIFE ) {
                // Do Nothing
            } else {
				// Bury player and strip of weapons, then return to starting position
				new origin[3];
				get_user_origin ( id, origin );
				origin[2] -= 500;
				set_user_origin ( id, origin );
				new iwpn, iwpns[32], nwpn[32];
				get_user_weapons ( id, iwpns, iwpn );
				for ( new a = 0; a < iwpn; ++a ) {
					get_weaponname ( iwpns[a], nwpn, 31 );
					engclient_cmd ( id, "drop", nwpn );
				}
				new origin2[3];
				get_user_origin ( id, origin2 );
				origin2[2] += 500;
				set_user_origin ( id, origin2 );
				// Select the knife
				client_cmd ( id, "weapon_knife" );
            }
        }
        return PLUGIN_CONTINUE;
}

public cmdvotimi ( id ) {
    new Float:voting = get_cvar_float ( "amx_last_voting" );
    if ( voting > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Nje votim eshte hedhur^1 ." );
        return PLUGIN_HANDLED;
    }
    if ( voting && voting + get_cvar_float ( "amx_vote_delay" ) > get_gametime() ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Ju lutemi prisni per nje kohe te shkurter para se te jeni ne gjendje te votoni perseri." );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    new name[32];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float("amx_vote_time") + 10.0;
    get_user_info ( id, "name", name, 31 );
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_hudmessage ( 200, 0, 0, 0.05, 0.65, 2, 0.02, 30.0, 0.03, 0.3, 2 );
		
    show_hudmessage ( 0, "[LS] Admini %s ka filluar nje votim per Moden Vetem Thika", name );
    set_task ( votetime, "check_the_votes" );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public cmdvoto_vetemthika ( id ) {
    new Float:voting = get_cvar_float ( "amx_last_voting" );
    if ( voting > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Nje votim eshte hedhur^1 ." );
        return PLUGIN_HANDLED;
    }
    if ( voting && voting + get_cvar_float( "amx_vote_delay" ) > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Ju lutemi prisni per nje kohe te shkurter para se te jeni ne gjendje te votoni perseri." );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float ( "amx_vote_time" ) + 10.0;
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_task ( votetime, "check_the_votes" );
    ColorChat(0, GREEN, "^1[^4LS^1] ^3Votimi ka filluar^1 ." );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public count_votes ( id, key ) {
    if ( get_cvar_float ( "amx_vote_answers" ) ) {
        new name[32];
        get_user_name ( id, name, 31 );
        ColorChat(0, GREEN, "^1[^4LS^1] ^4%s ^1votoj per ^4%s", name, key ? "perseri vetem thika" : "per thika vetem" );
    }
    ++choice[key];
    return PLUGIN_HANDLED;
}

public check_the_votes ( id ) {
    if ( choice[0] > choice[1] ) {
        server_cmd ( "amx_thika 1" );
        ColorChat(0, GREEN, "^1[^4LS^1] Rezultatet e votimi per ^4Vetem Thike ^1jane keto: (Per ^"%d^") (Kunder ^"%d^"). *", choice[0], choice[1] );
    } else {
        server_cmd ( "amx_thika 0" );
        ColorChat(0, GREEN, "^1[^4LS^1] Rezultatet e votimi per ^4Vetem Thike ^1jane keto: (Per ^"%d^") (Kunder ^"%d^"). *", choice[0], choice[1] );
    }
    return PLUGIN_CONTINUE;
}
Greetings. It is due to this part of the code:

Код за потвърждение: Избери целия код

new origin[3];
				get_user_origin ( id, origin );
				origin[2] -= 500;
				set_user_origin ( id, origin );
				new iwpn, iwpns[32], nwpn[32];
				get_user_weapons ( id, iwpns, iwpn );
				for ( new a = 0; a < iwpn; ++a ) {
					get_weaponname ( iwpns[a], nwpn, 31 );
					engclient_cmd ( id, "drop", nwpn );
				}
				new origin2[3];
				get_user_origin ( id, origin2 );
				origin2[2] += 500;
				set_user_origin ( id, origin2 );
				// Select the knife
				client_cmd ( id, "weapon_knife" );
				
What it does is, it moves the player into the ground and strips the weapons by dropping them into the ground then returning to the previous position. This might be a little buggy, but you can do it a lot easier. Find this part of the code and change it with:

strip_user_weapons(id); give_item(id,"weapon_knife");

Let me know if it works.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 6459
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 114 пъти
Получена благодарност: 862 пъти
Обратна връзка:

Knives Only

Мнение от OciXCrom » 14 Мар 2019, 14:51

Fix your title. "Knives Only" doesn't say that there is a problem with the plugin and what kind of problem - mention that in your title. You're not new, so you should know these stuff already. Titles like "Problem with X" aren't allowed either - explain in short details what is the problem.

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 372
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 22 пъти
Получена благодарност: 2 пъти
Обратна връзка:

Knives Only

Мнение от lantimilan » 14 Мар 2019, 15:03

OciXCrom написа:
14 Мар 2019, 14:51
Fix your title. "Knives Only" doesn't say that there is a problem with the plugin and what kind of problem - mention that in your title. You're not new, so you should know these stuff already. Titles like "Problem with X" aren't allowed either - explain in short details what is the problem.
Yes sure i apologise i think problem its big to write all , i write just knives only now i fixed , sorry for mistake.

Autum :
I test your code your change when i write in console blocked show this error

Код за потвърждение: Избери целия код

L 03/14/2019 - 16:26:02: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190314.log")
L 03/14/2019 - 16:26:02: [AMXX] Displaying debug trace (plugin "test.amxx", version "0.1a")
L 03/14/2019 - 16:26:02: [AMXX] Run time error 3: stack error 
L 03/14/2019 - 16:26:02: [AMXX] Displaying debug trace (plugin "test.amxx", version "0.1a")
L 03/14/2019 - 16:26:02: [AMXX] Run time error 3: stack error 

Аватар
Autumn Shade
Извън линия
Developer
Developer
Мнения: 267
Регистриран на: 14 Мар 2019, 13:20
Се отблагодари: 48 пъти
Получена благодарност: 144 пъти

Knives Only

Мнение от Autumn Shade » 14 Мар 2019, 17:33

lantimilan написа:
14 Мар 2019, 15:03
OciXCrom написа:
14 Мар 2019, 14:51
Fix your title. "Knives Only" doesn't say that there is a problem with the plugin and what kind of problem - mention that in your title. You're not new, so you should know these stuff already. Titles like "Problem with X" aren't allowed either - explain in short details what is the problem.
Yes sure i apologise i think problem its big to write all , i write just knives only now i fixed , sorry for mistake.

Autum :
I test your code your change when i write in console blocked show this error

Код за потвърждение: Избери целия код

L 03/14/2019 - 16:26:02: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190314.log")
L 03/14/2019 - 16:26:02: [AMXX] Displaying debug trace (plugin "test.amxx", version "0.1a")
L 03/14/2019 - 16:26:02: [AMXX] Run time error 3: stack error 
L 03/14/2019 - 16:26:02: [AMXX] Displaying debug trace (plugin "test.amxx", version "0.1a")
L 03/14/2019 - 16:26:02: [AMXX] Run time error 3: stack error 
Okay, go to plugins.ini, find the plugin line and write debug after the .amxx extension. Then post the log once again. Usually this error appears if the heap is full

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 372
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 22 пъти
Получена благодарност: 2 пъти
Обратна връзка:

Knives Only

Мнение от lantimilan » 14 Мар 2019, 17:35

Autumn Shade написа:
14 Мар 2019, 17:33
lantimilan написа:
14 Мар 2019, 15:03
OciXCrom написа:
14 Мар 2019, 14:51
Fix your title. "Knives Only" doesn't say that there is a problem with the plugin and what kind of problem - mention that in your title. You're not new, so you should know these stuff already. Titles like "Problem with X" aren't allowed either - explain in short details what is the problem.
Yes sure i apologise i think problem its big to write all , i write just knives only now i fixed , sorry for mistake.

Autum :
I test your code your change when i write in console blocked show this error

Код за потвърждение: Избери целия код

L 03/14/2019 - 16:26:02: Info (map "de_dust2") (file "addons/amxmodx/logs/error_20190314.log")
L 03/14/2019 - 16:26:02: [AMXX] Displaying debug trace (plugin "test.amxx", version "0.1a")
L 03/14/2019 - 16:26:02: [AMXX] Run time error 3: stack error 
L 03/14/2019 - 16:26:02: [AMXX] Displaying debug trace (plugin "test.amxx", version "0.1a")
L 03/14/2019 - 16:26:02: [AMXX] Run time error 3: stack error 
Okay, go to plugins.ini, find the plugin line and write debug after the .amxx extension. Then post the log once again. Usually this error appears if the heap is full
When i set plugins i write debug : http://prntscr.com/mxvb6k

Аватар
Autumn Shade
Извън линия
Developer
Developer
Мнения: 267
Регистриран на: 14 Мар 2019, 13:20
Се отблагодари: 48 пъти
Получена благодарност: 144 пъти

Knives Only - Problem Block Player

Мнение от Autumn Shade » 14 Мар 2019, 17:37

Yes, that is correct

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 372
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 22 пъти
Получена благодарност: 2 пъти
Обратна връзка:

Knives Only - Problem Block Player

Мнение от lantimilan » 14 Мар 2019, 17:55

I have from set plugin its active and show error with debug

Аватар
<VeCo>
Извън линия
AMXX Скриптър
AMXX Скриптър
Мнения: 145
Регистриран на: 28 Яну 2019, 19:01
Се отблагодари: 11 пъти
Получена благодарност: 72 пъти
Обратна връзка:

Knives Only - Problem Block Player

Мнение от <VeCo> » 14 Мар 2019, 18:00

Show us your code
:pepo_think3:

Аватар
lantimilan
Извън линия
Foreigner
Foreigner
Мнения: 372
Регистриран на: 29 Ное 2017, 22:49
Се отблагодари: 22 пъти
Получена благодарност: 2 пъти
Обратна връзка:

Knives Only - Problem Block Player

Мнение от lantimilan » 14 Мар 2019, 19:09

<VeCo> написа:
14 Мар 2019, 18:00
Show us your code

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <fun>

new knifeonly = 0;
new choice[2];
new voteknivesonly[] = "\yVetem Thika?\w^n^n1. Aktive^n2. Joaktive";

public plugin_init () {
	register_plugin ( "Knives Only", "0.1a", "SilverTide" );
	register_concmd ( "amx_thika", "cmdvetem_thika", ADMIN_CVAR, "- Aktivizohet ose fiket Vetem Thika." );
	register_concmd ( "amx_votothika", "cmdvoto_vetemthika", ADMIN_CVAR, "- Fillon nje votim per te mundesuar lojen Vetem Thika." );
	register_concmd ( "say /votothika", "cmdvotimi", ADMIN_CVAR, "- Fillon nje votim per te mundesuar loje Vetem Thika." );
	register_menucmd ( register_menuid("\yVetem Thika?"), (1<<0)|(1<<1), "count_votes" );
	register_event ( "CurWeapon", "knife", "b" );
}

public cmdvetem_thika ( id ) {
	new arg[2];
	read_argv ( 1, arg, 1 );
	set_hudmessage ( 200, 100, 0, -1.0, 0.25, 0, 1.0, 5.0, 0.1, 0.2, 2 );
	
	if ( equal ( arg, "1" ) ) {
		knifeonly = 1;
		client_cmd ( id, "weapon_knife" );
		console_print ( id, "[LS] Moda Vetem Thika eshte Aktivizuar, suksese." );
		show_hudmessage ( 0, "[LS] Moda Vetem Thika u Aktivizua, suksese te gjitheve." );
	} else if ( equal ( arg, "0" ) ) {
		knifeonly = 0
		console_print ( id, "[LS] Moda Vetem Thika eshte q'aktivizuar." );
		show_hudmessage ( 0, "[LS] Moda Vetem Thika eshte q'aktivizuar, ju mund te blini arme ne rundin e ri." );
	} else {
		if ( knifeonly == 0 ){
			console_print ( id, "Perdorimi: amx_thika 1 = Aktive 0 = Joaktive Aktualisht eshte: OFF" );
		}
		if ( knifeonly == 1 ){
			console_print ( id, "Perdorimi: amx_thika 1 = Aktive 0 = Joaktive Aktualisht eshte: ON" );
		}
	}
	
	return PLUGIN_CONTINUE;
}

public knife ( id ) {
    if ( knifeonly == 1 ) {
        strip_user_weapons(id);
        give_item(id, "weapon_knife");
    }

    return PLUGIN_CONTINUE;
}

public cmdvotimi ( id ) {
    new Float:voting = get_cvar_float ( "amx_last_voting" );
    if ( voting > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Nje votim eshte hedhur^1 ." );
        return PLUGIN_HANDLED;
    }
    if ( voting && voting + get_cvar_float ( "amx_vote_delay" ) > get_gametime() ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Ju lutemi prisni per nje kohe te shkurter para se te jeni ne gjendje te votoni perseri." );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    new name[32];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float("amx_vote_time") + 10.0;
    get_user_info ( id, "name", name, 31 );
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_hudmessage ( 200, 0, 0, 0.05, 0.65, 2, 0.02, 30.0, 0.03, 0.3, 2 );
		
    show_hudmessage ( 0, "[LS] Admini %s ka filluar nje votim per Moden Vetem Thika", name );
    set_task ( votetime, "check_the_votes" );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public cmdvoto_vetemthika ( id ) {
    new Float:voting = get_cvar_float ( "amx_last_voting" );
    if ( voting > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Nje votim eshte hedhur^1 ." );
        return PLUGIN_HANDLED;
    }
    if ( voting && voting + get_cvar_float( "amx_vote_delay" ) > get_gametime () ) {
        ColorChat(id, GREEN, "^1[^4LS^1] ^3Ju lutemi prisni per nje kohe te shkurter para se te jeni ne gjendje te votoni perseri." );
        return PLUGIN_HANDLED;
    }
    new menu_msg[256];
    format ( menu_msg, 255, voteknivesonly );
    new Float:votetime = get_cvar_float ( "amx_vote_time" ) + 10.0;
    set_cvar_float ( "amx_last_voting", get_gametime() + votetime );
    show_menu ( 0, (1<<0)|(1<<1), menu_msg, floatround ( votetime ) );
    set_task ( votetime, "check_the_votes" );
    ColorChat(0, GREEN, "^1[^4LS^1] ^3Votimi ka filluar^1 ." );
    choice[0] = choice[1] = 0;
    return PLUGIN_HANDLED; 
}

public count_votes ( id, key ) {
    if ( get_cvar_float ( "amx_vote_answers" ) ) {
        new name[32];
        get_user_name ( id, name, 31 );
        ColorChat(0, GREEN, "^1[^4LS^1] ^4%s ^1votoj per ^4%s", name, key ? "perseri vetem thika" : "per thika vetem" );
    }
    ++choice[key];
    return PLUGIN_HANDLED;
}

public check_the_votes ( id ) {
    if ( choice[0] > choice[1] ) {
        server_cmd ( "amx_thika 1" );
        ColorChat(0, GREEN, "^1[^4LS^1] Rezultatet e votimi per ^4Vetem Thike ^1jane keto: (Per ^"%d^") (Kunder ^"%d^"). *", choice[0], choice[1] );
    } else {
        server_cmd ( "amx_thika 0" );
        ColorChat(0, GREEN, "^1[^4LS^1] Rezultatet e votimi per ^4Vetem Thike ^1jane keto: (Per ^"%d^") (Kunder ^"%d^"). *", choice[0], choice[1] );
    }
    return PLUGIN_CONTINUE;
}

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 3 госта