Serwery wiaderko.com Zwiń / Rozwiń kategorię

HashJama [TP] 193.33.176.148:27015 | tp.wiaderko.com status serwera HashJama [TP] połącz

HashJama CS:GO [DM] 193.33.176.53:27015 | dm.wiaderko.com status serwera HashJama CS:GO [DM] połącz

HashJama CS:GO [FFA] 193.33.176.15:27015 | ffa.wiaderko.com status serwera HashJama CS:GO FFA [FFA] połącz

HashJama [TeamSpeak 3] 62.210.99.220:9987 | ts.wiaderko.com status serwera HashJama [TP ELITE] 62.210.99.220:27015 połącz

SPONSOR:
pukawka.pl

Nabór na JUNIOR ADMINA forum - Więcej informacji > Klik <
Pokaż wyniki od 1 do 2 z 2
  1. #1
    Starsza lamka Awatar PROwOkAtOr112
    Dołączył
    Aug 2010
    Wiek
    23
    Posty
    50
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Domyślnie Poprawnosc pisania?

    Witam. Zabralem sie za pisanie moda Gun XP mod na swoj serwer. Znam C/ C++ itp. a pluginow nigdy nie pisalem. Aczkolwiek wydaje sie to proste.. Prosze sprawdzic czy robie to dobrze,

    Kod:
    /* Plugin generated by AMXX-Studio */
    
    #include "../configs/csgxpmod.cfg"
    #include <amxmodx>
    #include <amxmisc>
    #include <sqlx>
    #include <hamsandwich>
    #include <fun>
    
    #define PLUGIN "CSGunXPMod"
    #define VERSION "0.1"
    #define AUTHOR "PROwOkAtOr"
    
    
    new Handle:csm_database;
    new csm_killstatus[CSGXP_SERVER_SLOTS];
    
    
    public plugin_init()
    {
    	register_plugin( PLUGIN, VERSION, AUTHOR );
    	
    	new x = 0;
    	for( x = 0; x < 36; ++x ) csm_killstatus[x] = 0;
    	
    	register_event( "DeathMsg", "player_kill", "a" );
    	register_event( "ResetHUD", "player_spawn_protection", "be" );
    	
    	database_init( );
    }
    
    
    /*
    public client_connect( id )
    {
    	new username[32];
    	new query[128];
    	
    	get_user_name( id, username, charsmax( username ) );
    	
    
    	formatex( query, 128, "SELECT * FROM `cs_player_list` WHERE name = '%s' );", username );
    	
    	
    	new szAuth[33];
    	new szKey[40];
    
    	if ( get_pcvar_num(savexp) == 0 )
    	{
    		get_user_ip( id, szAuth , charsmax(szAuth), 1);
    		formatex( szKey , 63 , "%s-IP" , szAuth);
    	}
    	else if ( get_pcvar_num(savexp) == 1 )
    	{
    		get_user_authid( id , szAuth , charsmax(szAuth) );
    		formatex( szKey , 63 , "%s-ID" , szAuth);
    	}
    	else if ( get_pcvar_num(savexp) == 2 )
    	{
    		get_user_name( id, szAuth , charsmax(szAuth) );
    		formatex( szKey , 63 , "%s-NAME" , szAuth);
    	}
    
    	if ( !get_pcvar_num(save_type) )
    	{
    		new szData[256];
    
    		formatex(szData , 255, "%i#%i#", PlayerLevel[id], PlayerXp[id]) 
    			
    		nvault_get(g_Vault, szKey, szData, 255) 
    
    		replace_all(szData , 255, "#", " ")
    		new xp[32], level[32] 
    		parse(szData, level, 31, xp, 31) 
    		PlayerLevel[id] = str_to_num(level)
    		PlayerXp[id] = str_to_num(xp)  
    	}
    	else
    	{
    		static szQuery[ 128 ], iData[ 1 ]; 
    		formatex( szQuery, 127, "SELECT `player_level`, `player_xp` FROM `mytable` WHERE ( `player_id` = '%s' );", szAuth ); 
         
    		iData[ 0 ] = id;
    		SQL_ThreadQuery( g_hTuple, "QuerySelectData", szQuery, iData, 1 );
    	}
    }
    */
    
    
    public client_disconnect( id )
    {
    	csm_killstatus[id] = 0;
    	if( task_exists( id ) ) remove_task( id );
    }
    
    
    public player_respawn( id ) { set_task( float( csgxp_respawn[0] ), "player_respawn_task", id ); }
    public player_respawn_task( id )
    {
    	ExecuteHamB( Ham_CS_RoundRespawn, id );
    	remove_task( id );
    }
    
    
    public player_spawn_protection( id ) { set_task( 0.1, "player_spawn_protection_on", id ); }
    public player_spawn_protection_on( id )
    {
    	new Float:task_time = float(get_cvar_num("mp_freezetime")) + float(csgxp_respawn[2]);
    	
    	set_user_godmode( id, 1 );
    	
    	if( get_user_team( id ) == 1 )
    	set_user_rendering( id, kRenderFxGlowShell, csgxp_respawn[3], csgxp_respawn[4], csgxp_respawn[5], kRenderNormal, csgxp_respawn[1] );
    	else if( get_user_team( id ) == 2 )
    	set_user_rendering( id, kRenderFxGlowShell, csgxp_respawn[6], csgxp_respawn[7], csgxp_respawn[8], kRenderNormal, csgxp_respawn[1] );
    	
    	set_task( task_time, "player_spawn_protection_off", id );
    }
    public player_spawn_protection_off( id )
    {
    	set_user_godmode( id, 0 );
    	set_user_rendering( id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, csgxp_respawn[1] );
    	remove_task( id );
    }
    
    
    public player_kill( )
    {
    	new killer_id 	= read_data( 1 );
    	new victim_id 	= read_data( 2 );
    	new headshot  	= read_data( 3 );
    	new gun		= read_data( 4 );
    	
    	if( is_user_connected( killer_id ) )
    	{
    		csm_killstatus[killer_id]++;
    		
    		if( csgxp_kills[0] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[0] ) kill_bonus( killer_id, 0 );
    		else if( csgxp_kills[1] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[1] ) kill_bonus( killer_id, 1 );
    		else if( csgxp_kills[2] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[2] ) kill_bonus( killer_id, 2 );
    		else if( csgxp_kills[3] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[3] ) kill_bonus( killer_id, 3 );
    		else if( csgxp_kills[4] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[4] ) kill_bonus( killer_id, 4 );
    		else if( csgxp_kills[5] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[5] ) kill_bonus( killer_id, 5 );
    		else if( csgxp_kills[6] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[6] ) kill_bonus( killer_id, 6 );
    		else if( csgxp_kills[7] == 1 && csm_killstatus[killer_id] == csgxp_kills_required[7] ) kill_bonus( killer_id, 7 );
    		else kill_normal( killer_id );
    		
    		return;
    	}
    	
    	if( is_user_connected( victim_id ) )
    	{
    		csm_killstatus[victim_id] = 0;
    		player_respawn( victim_id );
    	}
    }
    
    
    public kill_bonus( id, bonus_id )
    {
    	set_hudmessage( 255, 0, 0, -1.0, 0.30, 0, 0.0, 2.5, 0.3, 0.3 );
    	show_hudmessage( id, csgxp_kills_names[bonus_id] );
    	client_cmd( id, csgxp_kills_sounds[bonus_id] );
    	
    	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), { 0, 0, 0 }, id );
    	write_short( 3000 );
    	write_short( 1000 );
    	write_short( 2 );
    	write_byte( 255 );
    	write_byte( 0 );
    	write_byte( 0 );
    	write_byte( 140 );
    	message_end( );
    }
    
    
    public kill_normal( id )
    {
    	message_begin( MSG_ONE, get_user_msgid( "ScreenFade" ), { 0, 0, 0 }, id );
    	write_short( 2000 );
    	write_short( 200 );
    	write_short( 2 );
    	write_byte( 0 );
    	write_byte( 255 );
    	write_byte( 0 );
    	write_byte( 90 );
    	message_end( );
    }
    
    
    public database_init( )
    {
    	new query_players[] =
    	"CREATE TABLE IF NOT EXISTS `cs_player_list` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `pass` VARCHAR(32) DEFAULT NULL, `iposteam` VARCHAR(32) DEFAULT NULL, `name` VARCHAR(32) NOT NULL, `xp` INT UNSIGNED NOT NULL, INDEX idx_players( `name` ) ) ENGINE=InnoDB";
    	new query_statistic_general[] =
    	"CREATE TABLE IF NOT EXISTS `cs_statistic_general` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `suicides` INT UNSIGNED NOT NULL, `kills` INT UNSIGNED NOT NULL, `killed_count` INT UNSIGNED NOT NULL, `shoots` BIGINT UNSIGNED NOT NULL, `hits` BIGINT UNSIGNED NOT NULL ) ENGINE=InnoDB;";
    	new query_statistic_kills[] =
    	"CREATE TABLE IF NOT EXISTS `cs_statistic_kills` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `triple` INT UNSIGNED NOT NULL, `mega` INT UNSIGNED NOT NULL, `ultra` INT UNSIGNED NOT NULL, `spree` INT UNSIGNED NOT NULL, `rampage` INT UNSIGNED NOT NULL, `wsick` INT UNSIGNED NOT NULL, `monster` INT UNSIGNED NOT NULL, `holy` INT UNSIGNED NOT NULL ) ENGINE=InnoDB;";
    	new query_statistic_addkills[] =
    	"CREATE TABLE IF NOT EXISTS `cs_statistic_addkills` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `headshot` INT UNSIGNED NOT NULL, `grenade` INT UNSIGNED NOT NULL, `knife` INT UNSIGNED NOT NULL, `payback` INT UNSIGNED NOT NULL, `headhunter` INT UNSIGNED NOT NULL ) ENGINE=InnoDB;";
    	new query_statistic_pweapons[] =
    	"CREATE TABLE IF NOT EXISTS `cs_statistic_pweapons` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `glock` INT UNSIGNED NOT NULL, `usp` INT UNSIGNED NOT NULL, `p228` INT UNSIGNED NOT NULL, `fiveseven` INT UNSIGNED NOT NULL, `deagle` INT UNSIGNED NOT NULL, `elite` INT UNSIGNED NOT NULL ) ENGINE=InnoDB;";
    	new query_statistic_sweapons[] =
    	"CREATE TABLE IF NOT EXISTS `cs_statistic_sweapons` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `tmp` INT UNSIGNED NOT NULL, `mac` INT UNSIGNED NOT NULL, `ump` INT UNSIGNED NOT NULL, `mp5` INT UNSIGNED NOT NULL, `p90` INT UNSIGNED NOT NULL, `m3` INT UNSIGNED NOT NULL, `xm1014` INT UNSIGNED NOT NULL, `m249` INT UNSIGNED NOT NULL ) ENGINE=InnoDB;";
    	new query_statistic_mweapons[] =
    	"CREATE TABLE IF NOT EXISTS `cs_statistic_mweapons` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `scout` INT UNSIGNED NOT NULL, `awp` INT UNSIGNED NOT NULL, `famas` INT UNSIGNED NOT NULL, `gali` INT UNSIGNED NOT NULL, `ak47` INT UNSIGNED NOT NULL, `m4` INT UNSIGNED NOT NULL, `aug` INT UNSIGNED NOT NULL, `sg552` INT UNSIGNED NOT NULL, `sg550` INT UNSIGNED NOT NULL, `g3sg1` INT UNSIGNED NOT NULL ) ENGINE=InnoDB;";
    	new query_options[] =
    	"CREATE TABLE IF NOT EXISTS `cs_player_options` ( `id` INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, `fav_gun` TINYINT UNSIGNED NOT NULL, `btw_kills` TINYINT UNSIGNED NOT NULL, `vip` TINYINT UNSIGNED DEFAULT 0, `admin` TINYINT UNSIGNED DEFAULT 0, `lock_method` TINYINT DEFAULT NULL, `begin_time` MEDIUMINT UNSIGNED NOT NULL ) ENGINE=InnoDB;";
    	
    	
    	csm_database = SQL_MakeDbTuple( csgxp_mysql[0], csgxp_mysql[1], csgxp_mysql[2], csgxp_mysql[3] );
    	SQL_ThreadQuery( csm_database, "database_query", query_players );
    	SQL_ThreadQuery( csm_database, "database_query", query_statistic_general );
    	SQL_ThreadQuery( csm_database, "database_query", query_statistic_kills );
    	SQL_ThreadQuery( csm_database, "database_query", query_statistic_addkills );
    	SQL_ThreadQuery( csm_database, "database_query", query_statistic_pweapons );
    	SQL_ThreadQuery( csm_database, "database_query", query_statistic_sweapons );
    	SQL_ThreadQuery( csm_database, "database_query", query_statistic_mweapons );
    	SQL_ThreadQuery( csm_database, "database_query", query_options );
    }
    
    
    public database_query( fail_state, Handle:handle_query, error_str[ ], error, data[ ], data_size, Float:queue_time )
    {
    	if( fail_state == TQUERY_CONNECT_FAILED  || fail_state == TQUERY_QUERY_FAILED ) 
    	log_amx( "%s", error_str ); 		
    }

  2. #2
    Adminus pospolitus Awatar naven
    Dołączył
    Jan 2008
    Wiek
    25
    Posty
    10,802
    Thanks
    31
    Thanked 652 Times in 605 Posts

    Domyślnie Odp: Poprawnosc pisania?

    Dałeś 100+ linii kodu, sprecyzuj pytanie...
    Najlepszy hosting Hidden Content href="Hidden Content target="_blank">tutaj
    Konfiguracja amxx, instalacja pluginów, pisanie pluginów AMXX. Więcej info na Hidden Content

    "At the end of the day, there are always going to be mental disorders and people who cause violence for no other reason than the fact that they're fucked up and lost. And all we can do is try to learn from it." Corey Taylor.

Podobne wątki

  1. Config - poprawnosc
    By Cukieras in forum OffTopic - Counter Strike, Steam
    Odpowiedzi: 0
    Ostatni post / autor: 17-07-2011, 15:43
  2. Program do pisania na filmie?
    By Uzumakii in forum Pytania z odpowiedzią
    Odpowiedzi: 2
    Ostatni post / autor: 03-02-2011, 21:15
  3. Program do pisania i kompilacji .sma
    By SMGpol in forum Pisanie pluginów AMXX
    Odpowiedzi: 1
    Ostatni post / autor: 09-01-2011, 00:30
  4. Kurs pisania pluginów do AMX
    By Luksor in forum Amx Mod X
    Odpowiedzi: 6
    Ostatni post / autor: 21-09-2008, 21:49
  5. Regulamin pisania podań
    By mosh in forum Archiwum forum
    Odpowiedzi: 3
    Ostatni post / autor: 14-01-2008, 13:24

Odwiedzający poszukiwali:

Nikt jeszcze nie odwiedził tej strony poprzez wyszukiwarki

Uprawnienia umieszczania postów

  • Nie możesz zakładać nowych tematów
  • Nie możesz pisać wiadomości
  • Nie możesz dodawać załączników
  • Nie możesz edytować swoich postów
  •