Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Plugin generated by AMXX-Studio */
- #include <amxmodx>
- #include <amxmisc>
- #include <dhudmessage>
- #include <hamsandwich>
- #include <colorchat>
- #include <fun>
- #include <cstrike>
- #include <engine>
- #include <fakemeta>
- #define PLUGIN "Heavy Team Turnir"
- #define VERSION "1.0"
- #define AUTHOR "Fr0zen"
- #define OFFSET_CLIPAMMO 51
- #define OFFSET_LINUX_WEAPONS 4
- #define fm_cs_set_weapon_ammo(%1,%2) set_pdata_int(%1, OFFSET_CLIPAMMO, %2, OFFSET_LINUX_WEAPONS)
- // players offsets
- #define m_pActiveItem 373
- new bool:pokrenutturnir;
- new PokretanjeTurnira[ 33 ];
- const iCountTime = 30;
- new g_iCountdownEntity;
- new g_iCounter;
- const NOCLIP_WPN_BS = ((1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FLASHBANG)|(1<<CSW_KNIFE)|(1<<CSW_C4));
- new const g_MaxClipAmmo[] =
- {
- 0,
- 13, //CSW_P228
- 0,
- 10, //CSW_SCOUT
- 0, //CSW_HEGRENADE
- 7, //CSW_XM1014
- 0, //CSW_C4
- 30,//CSW_MAC10
- 30, //CSW_AUG
- 0, //CSW_SMOKEGRENADE
- 15,//CSW_ELITE
- 20,//CSW_FIVESEVEN
- 25,//CSW_UMP45
- 30, //CSW_SG550
- 35, //CSW_GALIL
- 25, //CSW_FAMAS
- 12,//CSW_USP
- 20,//CSW_GLOCK18
- 10, //CSW_AWP
- 30,//CSW_MP5NAVY
- 100,//CSW_M249
- 8, //CSW_M3
- 30, //CSW_M4A1
- 30,//CSW_TMP
- 20, //CSW_G3SG1
- 0, //CSW_FLASHBANG
- 7, //CSW_DEAGLE
- 30, //CSW_SG552
- 30, //CSW_AK47
- 0, //CSW_KNIFE
- 50//CSW_P90
- };
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_clcmd("say /turnir", "Turnir");
- RegisterHam(Ham_Spawn, "player", "hamspawn", 1);
- set_task(1.0, "Obavjestenje", _, _, _, "b");
- }
- public client_putinserver(id)
- {
- set_task(0.2, "PokretanjeTurniraProvera", id );
- register_event("CurWeapon" , "Event_CurWeapon" , "be" , "1=1" );
- }
- public Turnir(id)
- {
- if(PokretanjeTurnira[id]) {
- new menu = menu_create("\rDa li Zelis Pokrenuti Turnir?", "Turnir_Handle") ;
- menu_additem(menu, "\yDa ");
- menu_additem(menu, "\yNe");
- menu_display(id, menu);
- }
- else
- ColorChat(id, TEAM_COLOR, "^4[Turnir]^3 Nemas dozvolu za pokretanje turnira");
- }
- public Turnir_Handle(id, iMenu, iItem)
- {
- switch(iItem)
- {
- case 0:
- {
- turnir2(id);
- }
- case 1:
- {
- menu_destroy(iMenu);
- }
- case MENU_EXIT:
- {
- menu_destroy(iMenu);
- return PLUGIN_HANDLED;
- }
- }
- return PLUGIN_CONTINUE;
- }
- public turnir2(id)
- {
- if(pokrenutturnir) {
- ColorChat(id, TEAM_COLOR,"^4[Turnir]^3 Turnir je vec pokrenut");
- return PLUGIN_HANDLED;
- }
- set_task(1.0, "Event_CurWeapon", id);
- ColorChat(0, TEAM_COLOR, "^4[TURNIR]^3 Turnir je poceo, sretno svima :)");
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage(0, "Turnir je poceo ,sretno svima :)");
- server_cmd("amx_cvar mp_timelimit 60")
- g_iCountdownEntity = create_entity( "info_target" );
- entity_set_string( g_iCountdownEntity , EV_SZ_classname , "countdown_entity" );
- register_think( "countdown_entity" , "fw_CountdownEntThink" );
- set_task(3570.0, "ShowCountdown", id); // ovde ide 3570.0
- set_task(900.0, "minuta45", id);
- set_task(1800.0, "minuta30", id);
- set_task(2700.0, "minuta15", id);
- set_task(3000.0, "minuta10", id);
- set_task(3300.0, "minuta5", id);
- set_task(3420.0, "minuta3", id);
- server_cmd("amx_cvar sv_restartround 1");
- pokrenutturnir = true;
- return PLUGIN_HANDLED;
- }
- public ShowCountdown()
- {
- g_iCounter = iCountTime;
- entity_set_float( g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 1.0 );
- is_valid_ent(g_iCountdownEntity)
- is_valid_ent(g_iCounter)
- }
- public fw_CountdownEntThink( iEntity )
- {
- if ( iEntity == g_iCountdownEntity )
- {
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage( 0 , "[Turnir se zavrsava za : %d ]" , --g_iCounter );
- if ( g_iCounter )
- entity_set_float( g_iCountdownEntity , EV_FL_nextthink , get_gametime() + 1.0 );
- else
- server_cmd( "amx_map de_inferno" );
- }
- }
- public PokretanjeTurniraProvera( id ) {
- new SteamID[ 32 ];
- get_user_authid( id, SteamID, 31 );
- new broj_linija = file_size( "addons/amxmodx/configs/t-admin.ini", 1 );
- new linija[ 256 ], broj;
- for( new i = 0; i < broj_linija; i++ ) {
- read_file( "addons/amxmodx/configs/t-admin.ini", i, linija, 255, broj );
- if( broj > 0 && containi( linija, SteamID ) != -1 )
- PokretanjeTurnira[ id ] = true;
- }
- return PLUGIN_CONTINUE;
- }
- public hamspawn ( iPlayer ) {
- if(pokrenutturnir == true && is_user_alive( iPlayer ) ) {
- give_item( iPlayer, "weapon_hegrenade");
- give_item( iPlayer, "weapon_flashbang");
- give_item( iPlayer, "weapon_flashbang");
- give_item( iPlayer, "weapon_smokegrenade");
- }
- }
- public minuta45 ()
- {
- ColorChat(0, TEAM_COLOR, "^x04[Turnir]^x03 Turnir se zavrsava za^4 45 minuta.");
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage( 0 , "[Turnir se zavrsava za 45 minuta.]");
- }
- public minuta30 ()
- {
- ColorChat(0, TEAM_COLOR, "^x04[Turnir]^x03 Turnir se zavrsava za^4 30 minuta.");
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage( 0 , "[Turnir se zavrsava za 30 minuta.]");
- }
- public minuta15 ()
- {
- ColorChat(0, TEAM_COLOR, "^x04[Turnir]^x03 Turnir se zavrsava za^4 15 minuta.");
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage( 0 , "[Turnir se zavrsava za 15 minuta.]");
- }
- public minuta10()
- {
- ColorChat(0, TEAM_COLOR, "^x04[Turnir]^x03 Turnir se zavrzava za^4 10 minuta.");
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage(0, "[Turnir se zavrzava za 10 minuta.]")
- }
- public minuta5 ()
- {
- ColorChat(0, TEAM_COLOR, "^x04[Turnir]^x03 Turnir se zavrsava za^4 5 minuta.");
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage( 0 , "[Turnir se zavrsava za 5 minuta.]");
- }
- public minuta3 ()
- {
- ColorChat(0, TEAM_COLOR, "^x04[Turnir]^x03 Turnir se zavrsava za^4 3 minuta.");
- set_dhudmessage( 0, 255, 255, -1.0, -1.0, 0, 6.0, 6.0 );
- show_dhudmessage( 0 , "[Turnir se zavrsava za 3 minuta.]");
- }
- public Obavjestenje() {
- if(pokrenutturnir == true) {
- set_dhudmessage(0, 255, 255, 0.81, 0.52, 0, 6.0, 12.0); // ovde ide -1,0
- show_dhudmessage(0, "[Turnir je u toku]^n[Turnir Plugin by Fr0zen]");
- }
- }
- public Event_CurWeapon( id )
- {
- new iWeapon = read_data(2);
- if( !( NOCLIP_WPN_BS & (1<<iWeapon) ) && pokrenutturnir == true)
- fm_cs_set_weapon_ammo( get_pdata_cbase(id, m_pActiveItem) , g_MaxClipAmmo[ iWeapon ] );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement