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

error 017: undefined symbol "stats"


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
1 odpowiedź w tym temacie

#1 Que95

    Pomocny

  • Użytkownik

Reputacja: 3
Nowy

  • Postów:67
Offline

Napisano 28.11.2017 12:37

Witam mam jeden problem ze skompilowaniem pliku czy jest ktoś w stanie mi pomoc i to naprawić problem jest w 40-41 linijce dodatkowo mam pytanie co trzeba ustawić,aby moc zobaczyć statystyki przeciwnika?

#include <amxmodx>
#include <csx>

#define FLAGA ADMIN_LEVEL_G
#define TASK 10283


public plugin_init()
	register_plugin("Info Hud I Rangi CsGo", "1.0", "ProToTyp")


public client_connect(id)
{
	if(is_user_bot(id))
		return
	
	new param[1]
	param[0] = id
	
	set_task(1.0, "pokaz_hud", id,_,_,"b");
}

public client_disconnect(id)
{
	if(task_exists(TASK+id))
		remove_task(TASK+id)
}

public pokaz_hud(id)
{
	if(!is_user_connected(id)) return;
	
	static name[33], szData[10], ranga[30], pos;
	get_user_name(id, name, charsmax(name));
	get_time( "%X", szData, charsmax(szData));
	
	pos = rank(id, ranga);
	
	set_hudmessage(255, 255, 255, 0.1, 0.23, 0, 6.0, 12.0)
	show_hudmessage(id, "Nick: %s^nZabójstwa: %i^nRanga: %s^nRanking: %i^nVIP : %s",
	name, (get_user_flags(id) & FLAGA) ? "TAK" : "NIE", get_user_frags(id), pos, ranga, stats (get_timeleft()/60), szData)
}


public rank(id, ranga[])
{
	static stats[8], body[8], pos;
	pos = get_user_stats(id, stats, body)
	
	if ( stats[0] >= 0 && stats[0] <= 29)
		formatex(ranga,29,"Silver I")
	else if ( stats[0] >= 30 && stats[0] <= 59)
		formatex(ranga,29,"Silver II")
	else if ( stats[0] >= 60 && stats[0] <= 119)
		formatex(ranga,29,"Silver III")
	else if ( stats[0] >= 120 && stats[0] <= 209)
		formatex(ranga,29,"Silver IV")
	else if ( stats[0] >= 210 && stats[0] <= 324)
		formatex(ranga,29,"Silver Elite")
	else if ( stats[0] >= 325 && stats[0] <= 499)
		formatex(ranga,29,"Silver Elite Master")
	else if ( stats[0] >= 500 && stats[0] <= 729)
		formatex(ranga,29,"Gold Nova I")
	else if ( stats[0] >= 730 && stats[0] <= 999)
		formatex(ranga,29,"Gold Nova II")
	else if ( stats[0] >= 100 && stats[0] <= 1399)
		formatex(ranga,29,"Gold Nova III")
	else if ( stats[0] >= 1400 && stats[0] <= 1849)
		formatex(ranga,29,"Gold Nova IV")
	else if ( stats[0] >= 1850 && stats[0] <= 2299)
		formatex(ranga,29,"Gold Nova Master")
	else if ( stats[0] >= 2300 && stats[0] <= 2899)
		formatex(ranga,29,"Master Guardian I")
	else if ( stats[0] >= 2900 && stats[0] <= 3549)
		formatex(ranga,29,"Master Guardian II")
	else if ( stats[0] >= 4200 && stats[0] <= 4999)
		formatex(ranga,29,"Master Guardian Elite")
	else if ( stats[0] >= 5000 && stats[0] <= 5899)
		formatex(ranga,29,"Distinguished Master Guardian")
	else if ( stats[0] >= 5900 && stats[0] <= 6899)
		formatex(ranga,29,"Legendary Eagle")
	else if ( stats[0] >= 6900 && stats[0] <= 7999)
		formatex(ranga,29,"Legendary Eagle Master")
	else if ( stats[0] >= 8000 && stats[0] <= 9299)
		formatex(ranga,29,"Supreme Master First Class")
	else if ( stats[0] >= 9300 && stats[0] <= 12000)
		formatex(ranga,29,"The Global Elite")
	
	return pos;
}
public Prefix(msgId,msgDest,msgEnt)
{
	
	new id = get_msg_arg_int(1);
	
	
	if(!is_user_connected(id))
		return PLUGIN_CONTINUE;
	
	new szTmp[256],szTmp2[256];
	static ranga[30];
	
	get_msg_arg_string(2,szTmp, charsmax( szTmp ) )
	
	new szPrefix[64];
	
	formatex(szPrefix,charsmax( szPrefix ),"^x03[%s]",ranga);
	
	
	if(!equal(szTmp,"#Cstrike_Chat_All"))
	{
		add(szTmp2,charsmax(szTmp2),szPrefix);
		add(szTmp2,charsmax(szTmp2)," ");
		add(szTmp2,charsmax(szTmp2),szTmp);
	}
	else
	{
		add(szTmp2,charsmax(szTmp2),szPrefix);
		add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 : %s2");
	}
	
	set_msg_arg_string(2,szTmp2);
	
	return PLUGIN_CONTINUE;
}

  • +
  • -
  • 0

#2 ChrisN

    Wszechpomocny

  • Użytkownik

Reputacja: 31
Życzliwy

  • Postów:303
  • Imię:Christopher
Offline

Napisano 28.11.2017 17:12

    show_hudmessage(id, "Nick: %s^nZabójstwa: %i^nRanga: %s^nRanking: %i^nVIP : %s",
    name, (get_user_flags(id) & FLAGA) ? "TAK" : "NIE", get_user_frags(id), pos, ranga, stats (get_timeleft()/60), szData)

 

Po co ci tutaj "stats" skoro go nigdzie nie używasz w hud? Co do drugiego to musisz po prostu zrobić to samo tylko wcześniej sprawdasz czy gracz jest martwy, i musisz pobrać staty "targetu" czyli osoby, którą oglądasz. Najlepiej wzoruj się na np. hudzie z coda :)


  • +
  • -
  • 0




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

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