Статистиката да се запазва в Vault

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
cgozzie
Извън линия
Потребител
Потребител
Мнения: 1319
Регистриран на: 13 Окт 2016, 22:10
Местоположение: Варна
Се отблагодари: 245 пъти
Получена благодарност: 43 пъти

Статистиката да се запазва в Vault

Мнение от cgozzie » 09 Апр 2018, 11:02

Ще ми преработите ли плъгина да запазва статистиката в Vault в момента не запазва нищо само отчита докато си в играта излезеш и пак влезеш почваш от начало.Да ги запазва по IP: ако е възможно.

score_hud.sma

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

#include <amxmodx>


#define PLUGIN		"Score HUD"
#define VERSION		"1.0"
#define AUTHOR 		"AndrewZ"
	
enum _:SCORE_DATA
{
	DISABLE,
	KILLS,
	HEADSHOTS,
	KNIFEKILLS,
	GRENADEKILLS,
	DEATHS
}

new g_user_score[ 33 ][ SCORE_DATA + 1 ]
new g_maxplayers
	
new bool:g_reset_data

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	
	g_maxplayers = get_maxplayers()
	
	register_clcmd( "say /score", "cmd_score" )
	
	register_event( "DeathMsg", "event_death", "a" )
	register_event( "TextMsg", "event_textmsg_restart", "a", "2=#Game_will_restart_in" )
	
	register_logevent( "logevent_game_commencing", 2, "1=Game_Commencing" )
	register_logevent( "logevent_round_start", 2, "1=Round_Start" )
	
	set_task( 1.0, "rtask_show_hud", _, _, _, "b" )
}

public cmd_score( id )
{
	if( g_user_score[ id ][ DISABLE ] )
	{
		g_user_score[ id ][ DISABLE ] = 0
		client_print( id, print_chat, "HUD Statistics informer is on" )
	}
	else
	{
		g_user_score[ id ][ DISABLE ] = 1
		client_print( id, print_chat, "HUD Statistics informer is off." )
	}
	
	return PLUGIN_HANDLED
}	

public clear_data( id )
{
	if( !id )
	{
		for( new i = 1; i <= g_maxplayers; i ++ )
		{
			for( new data; data <= SCORE_DATA; data ++ )
				g_user_score[ i ][ data ] = 0
		}
	}
	else
	{
		for( new data; data <= SCORE_DATA; data ++ )
			g_user_score[ id ][ data ] = 0
	}
}


public client_connect( id ) 		clear_data( id )
public client_disconnect( id ) 		clear_data( id )
public logevent_game_commencing()	clear_data( 0 )
public event_textmsg_restart() 		g_reset_data = true
public logevent_round_start()
{
	if( g_reset_data )
	{
		clear_data( 0 )
		g_reset_data = false
	}
}

public event_death()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new weapon[ 12 ]; read_data( 4, weapon, 11 )
	
	if( !is_user_connected( killer ) && !is_user_connected( victim ) )
		return
		
	if( killer == victim )
	{
		g_user_score[ victim ][ DEATHS ] ++
		return
	}
		
	g_user_score[ killer ][ KILLS ] ++
	
	if( headshot )
		g_user_score[ killer ][ HEADSHOTS ] ++
		
	if( equal( weapon, "knife" ) )
		g_user_score[ killer ][ KNIFEKILLS ] ++
	else if( equal( weapon, "grenade" ) )
		g_user_score[ killer ][ GRENADEKILLS ] ++
	
	g_user_score[ victim ][ DEATHS ] ++
}
	

public rtask_show_hud()
{
	for( new id = 1; id <= g_maxplayers; id ++ )
	{
		if( !is_user_alive( id ) || g_user_score[ id ][ DISABLE ] )
			continue
		
		new Float:kd, 
			Float:k = float( g_user_score[ id ][ KILLS ] ), 
			Float:d = float( g_user_score[ id ][ DEATHS ] )
		
		if( k && d )
			kd = k / d
			
		else kd = 0.0
		
		
		set_hudmessage(255, 255, 255, -1.0, 0.89, 0, 6.0, 1.0)
		
		show_hudmessage
		( 
			id, "Kills: %d | Headshots: %d | Knife kills: %d | Grenade kills: %d | Deaths: %d | К/D: %.2f", 
			g_user_score[ id ][ KILLS ], 
			g_user_score[ id ][ HEADSHOTS ], 
			g_user_score[ id ][ KNIFEKILLS ], 
			g_user_score[ id ][ GRENADEKILLS],
			g_user_score[ id ][ DEATHS ],
			kd
		)
	}
}
Изображение

Аватар
Fr0sTt
Извън линия
Потребител
Потребител
Мнения: 138
Регистриран на: 16 Фев 2018, 19:11

Статистиката да се запазва в Vault

Мнение от Fr0sTt » 09 Апр 2018, 11:27

Виж тук е обяснено как става.

Аватар
cgozzie
Извън линия
Потребител
Потребител
Мнения: 1319
Регистриран на: 13 Окт 2016, 22:10
Местоположение: Варна
Се отблагодари: 245 пъти
Получена благодарност: 43 пъти

Статистиката да се запазва в Vault

Мнение от cgozzie » 09 Апр 2018, 14:12

Стига сте казвали ей тук така става нито съм скриптър нито нищо нали ако знаех сам щях да си го направя и теми изобщо няма да пускам,се едно аз да ва впрегна в мойта работа и да ти кажа ей така става ама изобщо като не си го бачкал ще се пулите и до там.Щом пускам тема а и не само аз в форума значи не ми е ясно как да се направи нали за това е форума.Секи път едно и също ако може някой да го направи да го направи извинявам се ако някой си помисли че се карам не е така но се нервя когато ми постнете ей така се прави уважавам помощта на секи 1 от форума не за 100 път съм го казал.
Изображение

Аватар
Fr0sTt
Извън линия
Потребител
Потребител
Мнения: 138
Регистриран на: 16 Фев 2018, 19:11

Статистиката да се запазва в Vault

Мнение от Fr0sTt » 09 Апр 2018, 14:48

Тествай:

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

#include <amxmodx>
#include <nvault>

#define PLUGIN		"Score HUD"
#define VERSION		"1.0"
#define AUTHOR 		"AndrewZ"
	
enum _:SCORE_DATA
{
	DISABLE,
	KILLS,
	HEADSHOTS,
	KNIFEKILLS,
	GRENADEKILLS,
	DEATHS
}

new g_user_score[ 33 ][ SCORE_DATA + 1 ]
new g_maxplayers
new g_iVault	
new bool:g_reset_data

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	
	g_maxplayers = get_maxplayers()
	
	register_clcmd( "say /score", "cmd_score" )
	
	register_event( "DeathMsg", "event_death", "a" )
	register_event( "TextMsg", "event_textmsg_restart", "a", "2=#Game_will_restart_in" )
	
	register_logevent( "logevent_game_commencing", 2, "1=Game_Commencing" )
	register_logevent( "logevent_round_start", 2, "1=Round_Start" )
	
	set_task( 1.0, "rtask_show_hud", _, _, _, "b" )
	g_iVault = nvault_open("ScoreHUD")
}

public cmd_score( id )
{
	if( g_user_score[ id ][ DISABLE ] )
	{
		g_user_score[ id ][ DISABLE ] = 0
		client_print( id, print_chat, "HUD Statistics informer is on" )
	}
	else
	{
		g_user_score[ id ][ DISABLE ] = 1
		client_print( id, print_chat, "HUD Statistics informer is off." )
	}
	
	return PLUGIN_HANDLED
}	

public clear_data( id )
{
	if( !id )
	{
		for( new i = 1; i <= g_maxplayers; i ++ )
		{
			for( new data; data <= SCORE_DATA; data ++ )
				g_user_score[ i ][ data ] = 0
		}
	}
	else
	{
		for( new data; data <= SCORE_DATA; data ++ )
			g_user_score[ id ][ data ] = 0
	}
}
public plugin_end() nvault_close(g_iVault)

public client_putinserver( id ) 		UseVault(id, 1)

public client_disconnect( id ) 		UseVault(id, 0)

public logevent_game_commencing()	clear_data( 0 )

public event_textmsg_restart() 		g_reset_data = true
public logevent_round_start()
{
	if( g_reset_data )
	{
		clear_data( 0 )
		g_reset_data = false
	}
}

public event_death()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new weapon[ 12 ]; read_data( 4, weapon, 11 )
	
	if( !is_user_connected( killer ) && !is_user_connected( victim ) )
		return
		
	if( killer == victim )
	{
		g_user_score[ victim ][ DEATHS ] ++
		return
	}
		
	g_user_score[ killer ][ KILLS ] ++
	
	if( headshot )
		g_user_score[ killer ][ HEADSHOTS ] ++
		
	if( equal( weapon, "knife" ) )
		g_user_score[ killer ][ KNIFEKILLS ] ++
	else if( equal( weapon, "grenade" ) )
		g_user_score[ killer ][ GRENADEKILLS ] ++
	
	g_user_score[ victim ][ DEATHS ] ++
}
	

public rtask_show_hud()
{
	for( new id = 1; id <= g_maxplayers; id ++ )
	{
		if( !is_user_alive( id ) || g_user_score[ id ][ DISABLE ] )
			continue
		
		new Float:kd, 
			Float:k = float( g_user_score[ id ][ KILLS ] ), 
			Float:d = float( g_user_score[ id ][ DEATHS ] )
		
		if( k && d )
			kd = k / d
			
		else kd = 0.0
		
		
		set_hudmessage(255, 255, 255, -1.0, 0.89, 0, 6.0, 1.0)
		
		show_hudmessage
		( 
			id, "Kills: %d | Headshots: %d | Knife kills: %d | Grenade kills: %d | Deaths: %d | К/D: %.2f", 
			g_user_score[ id ][ KILLS ], 
			g_user_score[ id ][ HEADSHOTS ], 
			g_user_score[ id ][ KNIFEKILLS ], 
			g_user_score[ id ][ GRENADEKILLS],
			g_user_score[ id ][ DEATHS ],
			kd
		)
	}
}
UseVault(id, iType)
{        
    new szName[32], szData[16]
    get_user_name(id, szName, charsmax(szName))
    
    switch(iType)
    {
        case 0:
        {
            formatex(szData, charsmax(szData), "%i|%i|%i|%i|%i"
        ,g_user_score[ id ][ KILLS ]    , g_user_score[ id ][ HEADSHOTS ], 
			g_user_score[ id ][ KNIFEKILLS ], 
			g_user_score[ id ][ GRENADEKILLS],
			g_user_score[ id ][ DEATHS ])
            nvault_set(g_iVault, szName, szData)
        }
        case 1:
        {
            nvault_get(g_iVault, szName, szData, charsmax(szData))
            replace_all(szData, charsmax(szData), "|", " ")
            
            new szArg[5][8]
            parse(szData, szArg[0], charsmax(szArg[]), szArg[1], charsmax(szArg[]))
            parse(szData, szArg[2], charsmax(szArg[]), szArg[3], charsmax(szArg[]))
            parse(szData, szArg[4], charsmax(szArg[]))
            g_user_score[ id ][ KILLS ] = str_to_num(szArg[0]))
            g_user_score[ id ][ HEADSHOTS ] = str_to_num(szArg[1]))
            g_user_score[ id ][ KNIFEKILLS ] = str_to_num(szArg[2]))
	    g_user_score[ id ][ GRENADEKILLS] = str_to_num(szArg[3]))
            g_user_score[ id ][ DEATHS ] = str_to_num(szArg[4]))
        } 
    }
}
Последно промяна от Fr0sTt на 09 Апр 2018, 14:52, променено общо 1 път.

Аватар
hackera457
Извън линия
Потребител
Потребител
Мнения: 768
Регистриран на: 01 Ное 2016, 09:46
Местоположение: София
Се отблагодари: 1 път
Получена благодарност: 124 пъти
Обратна връзка:

Статистиката да се запазва в Vault

Мнение от hackera457 » 09 Апр 2018, 14:49

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

#include <amxmodx>
#include <fvault>


#define PLUGIN		"Score HUD"
#define VERSION		"1.0"
#define AUTHOR 		"AndrewZ"
	
enum _:SCORE_DATA
{
	DISABLE,
	KILLS,
	HEADSHOTS,
	KNIFEKILLS,
	GRENADEKILLS,
	DEATHS
}

new const g_szVault[] = "ScoreHUD"

new g_user_score[ 33 ][ SCORE_DATA + 1 ]
new g_maxplayers
	
new bool:g_reset_data

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	
	g_maxplayers = get_maxplayers()
	
	register_clcmd( "say /score", "cmd_score" )
	
	register_event( "DeathMsg", "event_death", "a" )
	register_event( "TextMsg", "event_textmsg_restart", "a", "2=#Game_will_restart_in" )
	
	register_logevent( "logevent_game_commencing", 2, "1=Game_Commencing" )
	register_logevent( "logevent_round_start", 2, "1=Round_Start" )
	
	set_task( 1.0, "rtask_show_hud", _, _, _, "b" )
}

public cmd_score( id )
{
	if( g_user_score[ id ][ DISABLE ] )
	{
		g_user_score[ id ][ DISABLE ] = 0
		client_print( id, print_chat, "HUD Statistics informer is on" )
	}
	else
	{
		g_user_score[ id ][ DISABLE ] = 1
		client_print( id, print_chat, "HUD Statistics informer is off." )
	}
	
	return PLUGIN_HANDLED
}	

public clear_data( id )
{
	if( !id )
	{
		for( new i = 1; i <= g_maxplayers; i ++ )
		{
			for( new data; data <= SCORE_DATA; data ++ )
				g_user_score[ i ][ data ] = 0
		}
	}
	else
	{
		for( new data; data <= SCORE_DATA; data ++ )
			g_user_score[ id ][ data ] = 0
	}
}


public client_connect( id ) 		
{
	clear_data( id )
	UseVault(id,1)
}
public client_disconnected( id ) 		
{
	UseVault(id,0)
	clear_data( id )
}

public logevent_game_commencing()	clear_data( 0 )
public event_textmsg_restart() 		g_reset_data = true
public logevent_round_start()
{
	if( g_reset_data )
	{
		clear_data( 0 )
		g_reset_data = false
	}
}

public event_death()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new weapon[ 12 ]; read_data( 4, weapon, 11 )
	
	if( !is_user_connected( killer ) && !is_user_connected( victim ) )
		return
		
	if( killer == victim )
	{
		g_user_score[ victim ][ DEATHS ] ++
		return
	}
		
	g_user_score[ killer ][ KILLS ] ++
	
	if( headshot )
		g_user_score[ killer ][ HEADSHOTS ] ++
		
	if( equal( weapon, "knife" ) )
		g_user_score[ killer ][ KNIFEKILLS ] ++
	else if( equal( weapon, "grenade" ) )
		g_user_score[ killer ][ GRENADEKILLS ] ++
	
	g_user_score[ victim ][ DEATHS ] ++
}
	

public rtask_show_hud()
{
	for( new id = 1; id <= g_maxplayers; id ++ )
	{
		if( !is_user_alive( id ) || g_user_score[ id ][ DISABLE ] )
			continue
		
		new Float:kd, 
			Float:k = float( g_user_score[ id ][ KILLS ] ), 
			Float:d = float( g_user_score[ id ][ DEATHS ] )
		
		if( k && d )
			kd = k / d
			
		else kd = 0.0
		
		
		set_hudmessage(255, 255, 255, -1.0, 0.89, 0, 6.0, 1.0)
		
		show_hudmessage
		( 
			id, "Kills: %d | Headshots: %d | Knife kills: %d | Grenade kills: %d | Deaths: %d | К/D: %.2f", 
			g_user_score[ id ][ KILLS ], 
			g_user_score[ id ][ HEADSHOTS ], 
			g_user_score[ id ][ KNIFEKILLS ], 
			g_user_score[ id ][ GRENADEKILLS],
			g_user_score[ id ][ DEATHS ],
			kd
		)
	}
}

UseVault(id,iType)
{
	new szName[32]
	get_user_name(id,szName,charsmax(szName))
	
	switch(iType)
	{
		case 0:
		{
			new szFvaultData[56]
			formatex(szFvaultData,charsmax(szFvaultData),"%i#%i#%i#%i#%i",g_user_score[ id ][ KILLS ],g_user_score[ id ][ HEADSHOTS ],g_user_score[ id ][ KNIFEKILLS ],g_user_score[ id ][ GRENADEKILLS],g_user_score[ id ][ DEATHS ]  )
			fvault_set_data(g_szVault,szName,szFvaultData)
		}
		
		case 1:
		{
			new szData[128], szKills[5], szHS[5],szKnKill[5], szGnKills, szDeaths[5]
			
			if(fvault_get_data(g_szVault, szName,szData,charsmax(szData))
			{
				replace_all(szData,charsmax(szData),"#"," ")
				parse(szData, szKills,charsmax(szKills), szHS,charsmax(szHS), szKnKill, charsmax(szKnKill), szGnKills,charsmax(szGnKills), szDeaths, charsmax(szDeaths))
				
				g_user_score[ id ][ KILLS ] = str_to_num(szKills)
				g_user_score[ id ][ HEADSHOTS ] = str_to_num(szHS)
				g_user_score[ id ][ KNIFEKILLS ] = str_to_num(szKnKill)
				g_user_score[ id ][ GRENADEKILLS] = str_to_num(szGnKills)
				g_user_score[ id ][ DEATHS ] = str_to_num(szDeaths)
			}
			
		}
	}
}
Моите плъгини

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

#include <hambeer>

RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1);

public GivePlayerBeer(Pl){
    if(!is_user_alive(Pl)){
        ham_give_beer(Pl, 5)
        client_print(Pl, print_chat, "Go Go Go"){
}  


Аватар
cgozzie
Извън линия
Потребител
Потребител
Мнения: 1319
Регистриран на: 13 Окт 2016, 22:10
Местоположение: Варна
Се отблагодари: 245 пъти
Получена благодарност: 43 пъти

Статистиката да се запазва в Vault

Мнение от cgozzie » 09 Апр 2018, 16:20

Опитвам се локално и онлайн да го компелирам и ма дава и в 2-та вариянта 1 и същта грешка на хакера457

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

AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Modified for www.Freakz.ro / amx.freakz.ro

score_hud.sma(180) : error 001: expected token: ")", but found "{"
score_hud.sma(187) : error 035: argument type mismatch (argument 1)

2 Errors.
Compile failed!
А на фрост дава това

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

AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Modified for www.Freakz.ro / amx.freakz.ro

score_hud.sma(177) : error 001: expected token: ";", but found ")"
score_hud.sma(177) : error 029: invalid expression, assumed zero
score_hud.sma(178) : error 001: expected token: ";", but found ")"
score_hud.sma(178) : error 029: invalid expression, assumed zero
score_hud.sma(179) : error 001: expected token: ";", but found ")"
score_hud.sma(179) : error 029: invalid expression, assumed zero
score_hud.sma(180) : error 001: expected token: ";", but found ")"
score_hud.sma(180) : error 029: invalid expression, assumed zero
score_hud.sma(181) : error 001: expected token: ";", but found ")"
score_hud.sma(181) : error 029: invalid expression, assumed zero

10 Errors.
Compile failed!
Последно промяна от cgozzie на 09 Апр 2018, 16:22, променено общо 1 път.
Изображение

Аватар
hackera457
Извън линия
Потребител
Потребител
Мнения: 768
Регистриран на: 01 Ное 2016, 09:46
Местоположение: София
Се отблагодари: 1 път
Получена благодарност: 124 пъти
Обратна връзка:

Статистиката да се запазва в Vault

Мнение от hackera457 » 09 Апр 2018, 16:21

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

#include <amxmodx>
#include <fvault>


#define PLUGIN		"Score HUD"
#define VERSION		"1.0"
#define AUTHOR 		"AndrewZ"
	
enum _:SCORE_DATA
{
	DISABLE,
	KILLS,
	HEADSHOTS,
	KNIFEKILLS,
	GRENADEKILLS,
	DEATHS
}

new const g_szVault[] = "ScoreHUD"

new g_user_score[ 33 ][ SCORE_DATA + 1 ]
new g_maxplayers
	
new bool:g_reset_data

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	
	g_maxplayers = get_maxplayers()
	
	register_clcmd( "say /score", "cmd_score" )
	
	register_event( "DeathMsg", "event_death", "a" )
	register_event( "TextMsg", "event_textmsg_restart", "a", "2=#Game_will_restart_in" )
	
	register_logevent( "logevent_game_commencing", 2, "1=Game_Commencing" )
	register_logevent( "logevent_round_start", 2, "1=Round_Start" )
	
	set_task( 1.0, "rtask_show_hud", _, _, _, "b" )
}

public cmd_score( id )
{
	if( g_user_score[ id ][ DISABLE ] )
	{
		g_user_score[ id ][ DISABLE ] = 0
		client_print( id, print_chat, "HUD Statistics informer is on" )
	}
	else
	{
		g_user_score[ id ][ DISABLE ] = 1
		client_print( id, print_chat, "HUD Statistics informer is off." )
	}
	
	return PLUGIN_HANDLED
}	

public clear_data( id )
{
	if( !id )
	{
		for( new i = 1; i <= g_maxplayers; i ++ )
		{
			for( new data; data <= SCORE_DATA; data ++ )
				g_user_score[ i ][ data ] = 0
		}
	}
	else
	{
		for( new data; data <= SCORE_DATA; data ++ )
			g_user_score[ id ][ data ] = 0
	}
}


public client_connect( id ) 		
{
	clear_data( id )
	UseVault(id,1)
}
public client_disconnected( id ) 		
{
	UseVault(id,0)
	clear_data( id )
}

public logevent_game_commencing()	clear_data( 0 )
public event_textmsg_restart() 		g_reset_data = true
public logevent_round_start()
{
	if( g_reset_data )
	{
		clear_data( 0 )
		g_reset_data = false
	}
}

public event_death()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new weapon[ 12 ]; read_data( 4, weapon, 11 )
	
	if( !is_user_connected( killer ) && !is_user_connected( victim ) )
		return
		
	if( killer == victim )
	{
		g_user_score[ victim ][ DEATHS ] ++
		return
	}
		
	g_user_score[ killer ][ KILLS ] ++
	
	if( headshot )
		g_user_score[ killer ][ HEADSHOTS ] ++
		
	if( equal( weapon, "knife" ) )
		g_user_score[ killer ][ KNIFEKILLS ] ++
	else if( equal( weapon, "grenade" ) )
		g_user_score[ killer ][ GRENADEKILLS ] ++
	
	g_user_score[ victim ][ DEATHS ] ++
}
	

public rtask_show_hud()
{
	for( new id = 1; id <= g_maxplayers; id ++ )
	{
		if( !is_user_alive( id ) || g_user_score[ id ][ DISABLE ] )
			continue
		
		new Float:kd, 
			Float:k = float( g_user_score[ id ][ KILLS ] ), 
			Float:d = float( g_user_score[ id ][ DEATHS ] )
		
		if( k && d )
			kd = k / d
			
		else kd = 0.0
		
		
		set_hudmessage(255, 255, 255, -1.0, 0.89, 0, 6.0, 1.0)
		
		show_hudmessage
		( 
			id, "Kills: %d | Headshots: %d | Knife kills: %d | Grenade kills: %d | Deaths: %d | К/D: %.2f", 
			g_user_score[ id ][ KILLS ], 
			g_user_score[ id ][ HEADSHOTS ], 
			g_user_score[ id ][ KNIFEKILLS ], 
			g_user_score[ id ][ GRENADEKILLS],
			g_user_score[ id ][ DEATHS ],
			kd
		)
	}
}

UseVault(id,iType)
{
	new szName[32]
	get_user_name(id,szName,charsmax(szName))
	
	switch(iType)
	{
		case 0:
		{
			new szFvaultData[56]
			formatex(szFvaultData,charsmax(szFvaultData),"%i#%i#%i#%i#%i",g_user_score[ id ][ KILLS ],g_user_score[ id ][ HEADSHOTS ],g_user_score[ id ][ KNIFEKILLS ],g_user_score[ id ][ GRENADEKILLS],g_user_score[ id ][ DEATHS ]  )
			fvault_set_data(g_szVault,szName,szFvaultData)
		}
		
		case 1:
		{
			new szData[128], szKills[5], szHS[5],szKnKill[5], szGnKills, szDeaths[5]
			
			if(fvault_get_data(g_szVault, szName,szData,charsmax(szData)))
			{
				replace_all(szData,charsmax(szData),"#"," ")
				parse(szData, szKills,charsmax(szKills), szHS,charsmax(szHS), szKnKill, charsmax(szKnKill), szGnKills,charsmax(szGnKills), szDeaths, charsmax(szDeaths))
				
				g_user_score[ id ][ KILLS ] = str_to_num(szKills)
				g_user_score[ id ][ HEADSHOTS ] = str_to_num(szHS)
				g_user_score[ id ][ KNIFEKILLS ] = str_to_num(szKnKill)
				g_user_score[ id ][ GRENADEKILLS] = str_to_num(szGnKills)
				g_user_score[ id ][ DEATHS ] = str_to_num(szDeaths)
			}
			
		}
	}
}
Моите плъгини
Моите плъгини

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

#include <hambeer>

RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1);

public GivePlayerBeer(Pl){
    if(!is_user_alive(Pl)){
        ham_give_beer(Pl, 5)
        client_print(Pl, print_chat, "Go Go Go"){
}  


Аватар
cgozzie
Извън линия
Потребител
Потребител
Мнения: 1319
Регистриран на: 13 Окт 2016, 22:10
Местоположение: Варна
Се отблагодари: 245 пъти
Получена благодарност: 43 пъти

Статистиката да се запазва в Vault

Мнение от cgozzie » 09 Апр 2018, 16:24

Хакер сега дава това

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

AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Modified for www.Freakz.ro / amx.freakz.ro

score_hud.sma(187) : error 035: argument type mismatch (argument 1)

1 Error.
Compile failed!
Изображение

Аватар
hackera457
Извън линия
Потребител
Потребител
Мнения: 768
Регистриран на: 01 Ное 2016, 09:46
Местоположение: София
Се отблагодари: 1 път
Получена благодарност: 124 пъти
Обратна връзка:

Статистиката да се запазва в Vault

Мнение от hackera457 » 09 Апр 2018, 16:28

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

#include <amxmodx>
#include <fvault>


#define PLUGIN		"Score HUD"
#define VERSION		"1.0"
#define AUTHOR 		"AndrewZ"
	
enum _:SCORE_DATA
{
	DISABLE,
	KILLS,
	HEADSHOTS,
	KNIFEKILLS,
	GRENADEKILLS,
	DEATHS
}

new const g_szVault[] = "ScoreHUD"

new g_user_score[ 33 ][ SCORE_DATA + 1 ]
new g_maxplayers
	
new bool:g_reset_data

public plugin_init()
{
	register_plugin( PLUGIN, VERSION, AUTHOR )
	
	g_maxplayers = get_maxplayers()
	
	register_clcmd( "say /score", "cmd_score" )
	
	register_event( "DeathMsg", "event_death", "a" )
	register_event( "TextMsg", "event_textmsg_restart", "a", "2=#Game_will_restart_in" )
	
	register_logevent( "logevent_game_commencing", 2, "1=Game_Commencing" )
	register_logevent( "logevent_round_start", 2, "1=Round_Start" )
	
	set_task( 1.0, "rtask_show_hud", _, _, _, "b" )
}

public cmd_score( id )
{
	if( g_user_score[ id ][ DISABLE ] )
	{
		g_user_score[ id ][ DISABLE ] = 0
		client_print( id, print_chat, "HUD Statistics informer is on" )
	}
	else
	{
		g_user_score[ id ][ DISABLE ] = 1
		client_print( id, print_chat, "HUD Statistics informer is off." )
	}
	
	return PLUGIN_HANDLED
}	

public clear_data( id )
{
	if( !id )
	{
		for( new i = 1; i <= g_maxplayers; i ++ )
		{
			for( new data; data <= SCORE_DATA; data ++ )
				g_user_score[ i ][ data ] = 0
		}
	}
	else
	{
		for( new data; data <= SCORE_DATA; data ++ )
			g_user_score[ id ][ data ] = 0
	}
}


public client_connect( id ) 		
{
	clear_data( id )
	UseVault(id,1)
}
public client_disconnected( id ) 		
{
	UseVault(id,0)
	clear_data( id )
}

public logevent_game_commencing()	clear_data( 0 )
public event_textmsg_restart() 		g_reset_data = true
public logevent_round_start()
{
	if( g_reset_data )
	{
		clear_data( 0 )
		g_reset_data = false
	}
}

public event_death()
{
	new killer = read_data( 1 )
	new victim = read_data( 2 )
	new headshot = read_data( 3 )
	new weapon[ 12 ]; read_data( 4, weapon, 11 )
	
	if( !is_user_connected( killer ) && !is_user_connected( victim ) )
		return
		
	if( killer == victim )
	{
		g_user_score[ victim ][ DEATHS ] ++
		return
	}
		
	g_user_score[ killer ][ KILLS ] ++
	
	if( headshot )
		g_user_score[ killer ][ HEADSHOTS ] ++
		
	if( equal( weapon, "knife" ) )
		g_user_score[ killer ][ KNIFEKILLS ] ++
	else if( equal( weapon, "grenade" ) )
		g_user_score[ killer ][ GRENADEKILLS ] ++
	
	g_user_score[ victim ][ DEATHS ] ++
}
	

public rtask_show_hud()
{
	for( new id = 1; id <= g_maxplayers; id ++ )
	{
		if( !is_user_alive( id ) || g_user_score[ id ][ DISABLE ] )
			continue
		
		new Float:kd, 
			Float:k = float( g_user_score[ id ][ KILLS ] ), 
			Float:d = float( g_user_score[ id ][ DEATHS ] )
		
		if( k && d )
			kd = k / d
			
		else kd = 0.0
		
		
		set_hudmessage(255, 255, 255, -1.0, 0.89, 0, 6.0, 1.0)
		
		show_hudmessage
		( 
			id, "Kills: %d | Headshots: %d | Knife kills: %d | Grenade kills: %d | Deaths: %d | К/D: %.2f", 
			g_user_score[ id ][ KILLS ], 
			g_user_score[ id ][ HEADSHOTS ], 
			g_user_score[ id ][ KNIFEKILLS ], 
			g_user_score[ id ][ GRENADEKILLS],
			g_user_score[ id ][ DEATHS ],
			kd
		)
	}
}

UseVault(id,iType)
{
	new szName[32]
	get_user_name(id,szName,charsmax(szName))
	
	switch(iType)
	{
		case 0:
		{
			new szFvaultData[56]
			formatex(szFvaultData,charsmax(szFvaultData),"%i#%i#%i#%i#%i",g_user_score[ id ][ KILLS ],g_user_score[ id ][ HEADSHOTS ],g_user_score[ id ][ KNIFEKILLS ],g_user_score[ id ][ GRENADEKILLS],g_user_score[ id ][ DEATHS ]  )
			fvault_set_data(g_szVault,szName,szFvaultData)
		}
		
		case 1:
		{
			new szData[128], szKills[5], szHS[5],szKnKill[5], szGnKills, szDeaths[5]
			
			if(fvault_get_data(g_szVault, szName,szData,charsmax(szData)))
			{
				replace_all(szData,charsmax(szData),"#"," ")
				parse(szData, szKills,charsmax(szKills), szHS,charsmax(szHS), szKnKill, charsmax(szKnKill), szGnKills,charsmax(szGnKills), szDeaths, charsmax(szDeaths))
				
				g_user_score[ id ][ KILLS ] = str_to_num(szKills)
				g_user_score[ id ][ HEADSHOTS ] = str_to_num(szHS)
				g_user_score[ id ][ KNIFEKILLS ] = str_to_num(szKnKill)
				g_user_score[ id ][ GRENADEKILLS] = str_to_num(szGnKills)
				g_user_score[ id ][ DEATHS ] = str_to_num(szDeaths)
			}
			
		}
	}
}
Моите плъгини

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

#include <hambeer>

RegisterHamBeer(HamBeer_Spawn, "player", "GivePlayerBeer", 1);

public GivePlayerBeer(Pl){
    if(!is_user_alive(Pl)){
        ham_give_beer(Pl, 5)
        client_print(Pl, print_chat, "Go Go Go"){
}  


Аватар
cgozzie
Извън линия
Потребител
Потребител
Мнения: 1319
Регистриран на: 13 Окт 2016, 22:10
Местоположение: Варна
Се отблагодари: 245 пъти
Получена благодарност: 43 пъти

Статистиката да се запазва в Vault

Мнение от cgozzie » 09 Апр 2018, 16:30

Пак така

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

AMX Mod X Compiler 1.8.3-manual
Copyright (c) 1997-2006 ITB CompuPhase
Copyright (c) 2004-2013 AMX Mod X Team

Modified for www.Freakz.ro / amx.freakz.ro

score_hud.sma(187) : error 035: argument type mismatch (argument 1)

1 Error.
Compile failed!
Изображение

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

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

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot] и 24 госта