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
Zombie Plague Advance

zp_vip_extra_buy_assassin_sniper

zombie plague advance

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

#1 Erka

    Wszechpomocny

  • Użytkownik

Reputacja: 34
Życzliwy

  • Postów:321
Offline

Napisano 10.12.2013 22:32

Witam Panowie.

 

Czy ktoś mi pomoże z tym aby zamienić obecny kod, na taki aby można było kupić nie surva i nemka a assassina i snipera i zeby to bylo ustawiane cvarami jak dotychczas + item dostepny tylko dla VIPa.

 

KOD:

/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <zombieplague>
#include <zmvip>
 
#define PLUGIN "[ZP] S/N Buy"
#define VERSION "1.1"
#define AUTHOR "aaarnas"
 
new g_msgSayText
new nemesis, survivor
new g_bought[33], bought
new cvar_n_price, cvar_s_price, cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times
 
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_everytime = register_cvar("zp_allow_buy", "2")
cvar_allow_times = register_cvar("zp_allow_times", "4")
cvar_limit_all = register_cvar("zp_limit_for_all", "1")
cvar_n_price = register_cvar("zp_nemesis_price", "35")
cvar_s_price = register_cvar("zp_survivor_price", "35")
cvar_show_bought = register_cvar("zp_show_who_bought", "1")
 
g_msgSayText = get_user_msgid("SayText")
 
// Extra items
nemesis = zv_register_extra_item("Buy Nemesis", "For one round", get_pcvar_num(cvar_n_price), 0)
survivor = zv_register_extra_item("Buy Survivor","For one round", get_pcvar_num(cvar_s_price), 0)
}
 
public zp_round_ended()
bought = false
 
public zv_extra_item_selected(id, itemid) {
 
new value = get_pcvar_num(cvar_everytime)
 
if(itemid == nemesis) {
 
if(get_pcvar_num(cvar_limit_all) && bought) {
client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
return ZV_PLUGIN_HANDLED
}
if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
return ZV_PLUGIN_HANDLED
}
if(value == 2) {
zp_make_user_nemesis(id)
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
g_bought[id]++
}
else if(zp_has_round_started() == value) {
zp_make_user_nemesis(id)
if(get_pcvar_num(cvar_show_bought)) {
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
g_bought[id]++
bought = true
}
}
else {
client_printcolor(id, "/g[ZP] /yYou can buy Nemesis only when %s.", value ? "round started":"round not started")
return ZV_PLUGIN_HANDLED
}
}
else if(itemid == survivor) {
 
if(get_pcvar_num(cvar_limit_all) && bought) {
client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
return ZV_PLUGIN_HANDLED
}
if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
return ZV_PLUGIN_HANDLED
}
if(value == 2) {
zp_make_user_survivor(id)
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
g_bought[id]++
}
else if(zp_has_round_started() == value) {
zp_make_user_survivor(id)
if(get_pcvar_num(cvar_show_bought)) {
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought survivor", name)
g_bought[id]++
bought = true
}
}
else {
client_printcolor(id, "/g[ZP] /yYou can buy Survivor only when %s.", value ? "round started":"round not started")
return ZV_PLUGIN_HANDLED
}
}
return 1
}
 
stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]
 
static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)
 
replace_all(szMsg, 190, "/g", "^4") // green txt
replace_all(szMsg, 190, "/y", "^1") // orange txt
replace_all(szMsg, 190, "/ctr", "^3") // team txt
replace_all(szMsg, 190, "/w", "^0") // team txt
 
if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")
 
for (new i = 0; i < iCount; i++)
{
if (is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}
 

Użytkownik erka edytował ten post 10.12.2013 22:33

  • +
  • -
  • 0

#2 FORMOZA

    KDE User

  • Power User

Reputacja: 416
Wszechobecny

  • Postów:758
  • Imię:Kamil
  • Lokalizacja:Łowicz
Offline

Napisano 10.12.2013 23:14

Hym hym hym :D cieżko zrozumieć było co chcesz ale chyba zrobiłem to co chciałeś ;) 

sprawdz tylko czy działa i czy poprawnie działa :D

 

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zombieplague>
#include <zmvip>

#define PLUGIN "[ZP] S/N Buy"
#define VERSION "1.1"
#define AUTHOR "aaarnas edit FORMOZA"

new g_msgSayText
new assassin, sniper
new g_bought[33], bought
new cvar_n_price, cvar_s_price, cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	cvar_everytime = register_cvar("zp_allow_buy", "2")
	cvar_allow_times = register_cvar("zp_allow_times", "4")
	cvar_limit_all = register_cvar("zp_limit_for_all", "1")
	cvar_n_price = register_cvar("zp_assassin_price", "35")
	cvar_s_price = register_cvar("zp_sniper_price", "35")
	cvar_show_bought = register_cvar("zp_show_who_bought", "1")
	
	g_msgSayText = get_user_msgid("SayText")
	
	// Extra items
	assassin = zv_register_extra_item("Buy Assassin", "For one round", get_pcvar_num(cvar_n_price), 0)
	sniper = zv_register_extra_item("Buy Sniper","For one round", get_pcvar_num(cvar_s_price), 0)
}

public zp_round_ended()
	bought = false

public zv_extra_item_selected(id, itemid) {
	
	new value = get_pcvar_num(cvar_everytime)
	
	if(!(get_user_flags(id) & ADMIN_LEVEL_H))
	{
		client_print(id, print_center, "Only Premium Players has this Extra item")
		return PLUGIN_CONTINUE;
	}
	
	if(itemid == assassin) {
		
		if(get_pcvar_num(cvar_limit_all) && bought) {
			client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
			return ZV_PLUGIN_HANDLED
		}
		if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
			client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
			return ZV_PLUGIN_HANDLED
		}
		if(value == 2) {
			zp_make_user_nemesis(id)
			new name[64]
			get_user_name(id, name, 63)
			client_printcolor(0, "/g[ZP] %s /ybought assassin", name)
			g_bought[id]++
		}
		else if(zp_has_round_started() == value) {
			zp_make_user_nemesis(id)
			if(get_pcvar_num(cvar_show_bought)) {
				new name[64]
				get_user_name(id, name, 63)
				client_printcolor(0, "/g[ZP] %s /ybought assassin", name)
				g_bought[id]++
				bought = true
			}
		}
		else {
			client_printcolor(id, "/g[ZP] /yYou can buy Assassin only when %s.", value ? "round started":"round not started")
			return ZV_PLUGIN_HANDLED
		}
	}
	else if(itemid == sniper) {
		
		if(get_pcvar_num(cvar_limit_all) && bought) {
			client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
			return ZV_PLUGIN_HANDLED
		}
		if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
			client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
			return ZV_PLUGIN_HANDLED
		}
		if(value == 2) {
			zp_make_user_survivor(id)
			new name[64]
			get_user_name(id, name, 63)
			client_printcolor(0, "/g[ZP] %s /ybought assassin", name)
			g_bought[id]++
		}
		else if(zp_has_round_started() == value) {
			zp_make_user_survivor(id)
			if(get_pcvar_num(cvar_show_bought)) {
				new name[64]
				get_user_name(id, name, 63)
				client_printcolor(0, "/g[ZP] %s /ybought sniper", name)
				g_bought[id]++
				bought = true
			}
		}
		else {
			client_printcolor(id, "/g[ZP] /yYou can buy Sniper only when %s.", value ? "round started":"round not started")
			return ZV_PLUGIN_HANDLED
		}
	}
	return 1
}

stock client_printcolor(const id, const input[], any:...)
{
	new iCount = 1, iPlayers[32]
	
	static szMsg[191]
	vformat(szMsg, charsmax(szMsg), input, 3)
	
	replace_all(szMsg, 190, "/g", "^4") // green txt
	replace_all(szMsg, 190, "/y", "^1") // orange txt
	replace_all(szMsg, 190, "/ctr", "^3") // team txt
	replace_all(szMsg, 190, "/w", "^0") // team txt
	
	if(id) iPlayers[0] = id
	else get_players(iPlayers, iCount, "ch")
		
	for (new i = 0; i < iCount; i++)
	{
		if (is_user_connected(iPlayers[i]))
		{
			message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
			write_byte(iPlayers[i])
			write_string(szMsg)
			message_end()
		}
	}
}


  • +
  • -
  • 0

Diablo Mod V9 Demonic by FORMOZA *Updated 21-12-2013*

Perki by Pas (FORMOZA) cz1 %5BPaczka%5D

Perki by J River (FORMOZA) cz2 %5BPaczka%5D

Dołączona grafika

=================================

Załączony plik  Diablo Install_9.zip   1,2 MB  1172 Ilość pobrań

Załączony plik  Perki by Pas DOWNLOAD.zip   127,12 KB  1702 Ilość pobrań


Załączony plik  Perks_by_J_River.zip   178,98 KB  2343 Ilość pobrań

=================================


http://kdemaker.blogspot.com/


#3 Erka

    Wszechpomocny

  • Autor tematu
  • Użytkownik

Reputacja: 34
Życzliwy

  • Postów:321
Offline

Napisano 10.12.2013 23:24

Nie zadziałało tak jak trzeba. 

 

Wybieram z menu kup Assassin zamienia w nemka 

Wybieram z menu kup Sniper zamienia w surva :)


  • +
  • -
  • 0

#4 FORMOZA

    KDE User

  • Power User

Reputacja: 416
Wszechobecny

  • Postów:758
  • Imię:Kamil
  • Lokalizacja:Łowicz
Offline

Napisano 10.12.2013 23:25

No nie podałeś skilli snipera i assassina to myslalem ze tak ma zostać ;) podaj to zamienie albo coś 


  • +
  • -
  • 0

Diablo Mod V9 Demonic by FORMOZA *Updated 21-12-2013*

Perki by Pas (FORMOZA) cz1 %5BPaczka%5D

Perki by J River (FORMOZA) cz2 %5BPaczka%5D

Dołączona grafika

=================================

Załączony plik  Diablo Install_9.zip   1,2 MB  1172 Ilość pobrań

Załączony plik  Perki by Pas DOWNLOAD.zip   127,12 KB  1702 Ilość pobrań


Załączony plik  Perks_by_J_River.zip   178,98 KB  2343 Ilość pobrań

=================================


http://kdemaker.blogspot.com/


#5 Erka

    Wszechpomocny

  • Autor tematu
  • Użytkownik

Reputacja: 34
Życzliwy

  • Postów:321
Offline

Napisano 11.12.2013 02:47

Dobra sam to zrobiłem i mi się udało. :)

Ehh :D

 

Do zamknięcia. 


  • +
  • -
  • 0





Również z jednym lub większą ilością słów kluczowych: zombie plague advance

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

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