Problem with read Cvar

Въпроси и проблеми свързани с AMXModX.
Заключена
Потребителски аватар

Автор на темата
lantimilan
Foreigner
Foreigner
Мнения: 162
Регистриран: 29 ное 2017, 22:49
Контакти:

Problem with read Cvar

Мнение от lantimilan » 11 апр 2018, 01:07

Hello i have one plugin when i add other some cvar know server not read all this cvar who can help me how to fix to working all cvar :

Plugin :

Код: Избери всички

#include <amxmodx>
#include <amxmisc>

#if AMXX_VERSION_NUM < 183
	#include <dhudmessage>
#endif

new g_MaxPlayers;
new szIP[32]
		
public plugin_init()
{
	register_plugin("Pershendetjet","1.0","LinDi/c0d3")
	
	register_clcmd("say hello", "greeting")                        // English
	register_clcmd("say hi", "greeting")                           // English
	register_clcmd("say bye", "ohno")                              // English
	
	register_clcmd("say ckemi", "Pershendetja1")                   // Albania
	register_clcmd("say pershendetje", "Pershendetja")             // Albania
	register_clcmd("say mirupafshim", "plsno")                     // Albania
	register_clcmd("say tung", "DontGo")                           // Albania
	register_clcmd("say klm", "pff")                               // Albania
	register_clcmd("say naten", "naten")                           // Albania
	
	register_clcmd("say salut", "Rumanisht")                       // Rumanisht
	register_clcmd("say la revedere", "Rumanisht2")                // Rumanisht
	
	register_clcmd("say hola", "Spanjollisht")                     // Spanjoll
	register_clcmd("say adios", "Spanjollisht2")                   // Spanjoll
	
	register_clcmd("say zdravo", "Serbisht")                       // Serbisht
	register_clcmd("say zbogom", "Serbisht2")                      // Serbisht
	
	register_clcmd("say hallo", "Gjermanisht")                     // Germanish
	register_clcmd("say Auf Wiedersehen", "Gjermanisht2")          // Germanish
	
	register_clcmd("say bonjour", "Frengjisht")                    // Frengjisht
	register_clcmd("say aurevoir", "Frengjisht2")                  // Frengjisht
	
	register_clcmd("say zdrasti", "Bullgarisht")                   // Bullgarisht
	register_clcmd("say sbogom", "Bullgarisht2")                   // Bullgarisht

	register_clcmd("say ciao", "Italisht")                         // Italisht
	register_clcmd("say arrivederci", "Italisht2")                 // Italisht
	
	register_clcmd("say hailo", "Indisht")                         // Indisht
	register_clcmd("say alavida", "Indisht2")                      // Indisht
	
}
public greeting(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tHello %s, You are Welcome^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public ohno(id)
{
	new szName[32]
	get_user_name(id, szName, 31)
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.04, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "t^t^t^t^t^t^t^tBye %s, it was a pleasure you played with us^n^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t^t->[ You are Welcome ]<-", szName)
}

public naten(id)
{
	new szName[32]
	get_user_name(id, szName, 31)
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.04, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "Naten e mire %s, shpresojm te ju shofim perseri neser, gjum te mire", szName)
}

public Pershendetja(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tPershendetje %s, Miresevjen ^n^t^t%s^n^t^t^t^t^t^t[ IP ] %s", szName, hostname, szIP, get_playersall())
}

public Pershendetja1(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tCkemi %s, Po luan ne^n^t^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public plsno(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tMirupafshim %s, ja kalofsh bukur^n^t^t%s^n^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}

public DontGo(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tTung %s, ja kalofsh bukur^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}

public pff(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tkalofsh mire %s, je i mirepritur^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}

public Rumanisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tSalut %s, bucurati-va de joc^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Rumanisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tLa revedere %s, va mai asteptam^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}

public Spanjollisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tHola %s, diviertete^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Spanjollisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tLa revedere %s, va mai asteptam^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}

public Serbisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tPozdrav %s, uživaj^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Serbisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tZbogom %s, nadamo se da cemo vas opet vidjeti^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}
public Gjermanisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tHallo %s, Hoffe habt Spass bei^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Gjermanisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tAufwiedersehen %s, Sehen wir und nächstes mal^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}
public Frengjisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tBonjour %s, amusez-vous^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Frengjisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tAu revoir %s, nous espérons vous revoir^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}
public Bullgarisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tZdrasti %s, igraite silni^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Bullgarisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tSbogom %s, nadyavame se da vi vidim otnovo^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}

public Italisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tCiao %s, gioca e divertiti^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Italisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tArrivederci %s, ti diamo il benvenuto di nuovo^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}
public Indisht(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300),  0.26, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^tHailo %s, khelate hain aur apane aap ka aanand len^n^t%s^n^t^t^t[IP]: %s^t^t( %d / %d )", szName, hostname, szIP, get_playersall(), g_MaxPlayers)
}

public Indisht2(id)
{
	new hostname[128] 
	get_cvar_string("hostname",hostname,charsmax(hostname))
	g_MaxPlayers = get_maxplayers();
	new szName[32]
	get_user_name(id, szName, 31)
	get_user_ip(0, szIP, charsmax(szIP))
	set_dhudmessage(random_num(0,170), random_num(0,255), random_num(0,300), 0.13, 0.0, 0, 6.0, 12.0)
	show_dhudmessage(id, "^t^t^tAlavida %s, ham aapako phir se svaagat karate hain^n^t^t%s^n^t^t^t^t^t^t^t[IP]: %s", szName, hostname, szIP, get_playersall())
}
stock get_playersall()
{
	new iPlayers[32], iPnum;
	get_players(iPlayers, iPnum);
	return iPnum;
}

Потребителски аватар

hackera457 Охрана
Модератор
Модератор
Мнения: 358
Регистриран: 01 ное 2016, 09:46
Местоположение: София
Години: 23
Контакти:

Problem with read Cvar

Мнение от hackera457 Охрана » 11 апр 2018, 13:19

Replace

Код: Избери всички

  get_cvar_string("hostname",hostname,charsmax(hostname)) 
With

Код: Избери всички

get_user_name(0,hostname, charsmax(hostname)) 
Моите плъгини

Код: Избери всички

#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"){
}  


Потребителски аватар

Автор на темата
lantimilan
Foreigner
Foreigner
Мнения: 162
Регистриран: 29 ное 2017, 22:49
Контакти:

Problem with read Cvar

Мнение от lantimilan » 11 апр 2018, 20:18

Thanks hackera working very good :D

Заключена

Върни се в “Поддръжка / Помощ”

Кой е на линия

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