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
 

Jenot - zdjęcie

Jenot

Rejestracja: 26.04.2013
Aktualnie: Nieaktywny
Poza forum Ostatnio: 22.03.2014 00:32
*****

#612384 [ROZWIĄZANE] Blokowanie komendy

Napisane przez Droso w 02.02.2014 21:55

O.o

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <StripWeapons>

#define Plugin "Sell Weapons"
#define Version "1.5"
#define Author "Doombringer"

#define MAX_WEAPONS 33

new const g_prices[MAX_WEAPONS][] = {
	"0",
	"600",
	"0",
	"2750",
	"0",
	"3000",
	"0",
	"1400",
	"3500",
	"0",
	"800",
	"750",
	"1700",
	"4200",
	"2000",
	"2250",
	"500",
	"400",
	"4750",
	"1500",
	"5750",
	"1700",
	"3100",
	"1250",
	"5000",
	"0",
	"650",
	"3500",
	"2500",
	"0",
	"2350",
	"0",
	"0"
}

new cvar, buyzone, annonce, divide //Pcvar stuff, makes life easier
public plugin_init() // Plugin_init(): Does all the "one-time" stuff. Called after plugin_precache().
{
	register_plugin(Plugin, Version, Author) //Register's the plugin so it can be seen in amx_help
	register_clcmd("say /sprzedaj", "cmd_sell") //Registers the command itself. So if someone say /sell the function will be executed
	register_clcmd("say_team /sprzedaj", "cmd_sell") //Save as above but for team chat
	register_clcmd("drop", "przerwij");
	cvar = register_cvar("SW_enabled", "1") //Registers the cvar SW_enabled, Default 1 (If nothing else is in server.cfg or any other .cfg file)
	buyzone = register_cvar("SW_buyzone", "0") //Registers the cvar SW_buyzone, Default 0 (If nothing else is in server.cfg or any other .cfg file)
	annonce = register_cvar("SW_annonce", "150") //Registers the cvar SW_annonce, Default 120 (If nothing else is in server.cfg or any other .cfg file)
	divide = register_cvar("SW_divide", "2") //Registers the cvar SW_divide, Default 2 (If nothing else is in server.cfg or any other .cfg file)
	if(get_pcvar_num(annonce) > 1) //If the pcvar annonce is higher then 1
		set_task(get_pcvar_float(annonce), "print_annonce",_,_,_,"b") //Set a task to run the annonce function every get_pcvar_float(annonce) time
}

public print_annonce() //The function that shows the annonce
{
	if(get_pcvar_num(annonce) < 1) //If it's lower then 1
		return PLUGIN_CONTINUE //Make the plugin continue (Yes i know i should do remove_task() but this is better)
	client_print(0, print_chat, "Chcesz sprzedac bron? Wpisz /sprzedaj") //Prints the message to everyones chat area
	return PLUGIN_CONTINUE //Continue...
}

public cmd_sell(id) //The whole main function
{
	set_task(0.5, "trolo", id);
	
} //EOF

public przerwij(id)
	remove_task(id);

public trolo(id){
	if(get_pcvar_num(cvar) < 1) //If the pcvar cvar is lower then one
		return PLUGIN_CONTINUE //Continue...
	
	if(get_pcvar_num(buyzone) == 1 && cs_get_user_buyzone(id) == 0) //If pcvar buyzone is equal to one and user is not in a buyzone
	{
		client_print(id, print_chat, "Musisz byc na respie by sprzedac bron!") //Prints a angry little message :)
		return PLUGIN_HANDLED //And ends the function
	}
	if(!is_user_alive(id)) //Isn't he alive?!
	{
		client_print(id, print_chat, "Musisz byc zywy, by sprzedac bron!") //Prints a angry little message :)
		return PLUGIN_HANDLED //And ends the function
	}
	
	
	new temp, weapon = get_user_weapon(id, temp, temp) //Fills weapon with the current hold weapon (temp is a so called dummy)
	new price = str_to_num(g_prices[weapon]) //Gets the price for the current weapon
	if(price == 0) //If it's equal to zero
	{
		client_print(id, print_chat, "Nie mozesz tego sprzedac!") //Prints a angry little message :)
		return PLUGIN_HANDLED //And ends the function
	}
	new oldmoney = cs_get_user_money(id) //Gets the players money
	new cash = clamp(oldmoney + (price / get_pcvar_num(divide)), 0, 16000) //clamps the total amount of cash, so it doesn't extend the 16000 limit
	
	if(weapon != 1 && weapon != 10 && weapon != 11 && weapon != 16 && weapon != 17 && weapon != 26)
		StripWeapons(id, Primary);
	else
		StripWeapons(id, Secondary);
	
	cs_set_user_money(id, cash) //Sets the money from cash
	client_print(id, print_chat, "Otrzymales %d$", cs_get_user_money(id) - oldmoney) //Prints some info about what you got
	return PLUGIN_HANDLED //Done
}

Czek diz


  • +
  • -
  • 1


#612263 [ROZWIĄZANE] Blokowanie komendy

Napisane przez Droso w 02.02.2014 17:15

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <cstrike>
#include <StripWeapons>

#define Plugin "Sell Weapons"
#define Version "1.5"
#define Author "Doombringer"

#define MAX_WEAPONS 33

new const g_prices[MAX_WEAPONS][] = {
	"0",
	"600",
	"0",
	"2750",
	"0",
	"3000",
	"0",
	"1400",
	"3500",
	"0",
	"800",
	"750",
	"1700",
	"4200",
	"2000",
	"2250",
	"500",
	"400",
	"4750",
	"1500",
	"5750",
	"1700",
	"3100",
	"1250",
	"5000",
	"0",
	"650",
	"3500",
	"2500",
	"0",
	"2350",
	"0",
	"0"
}

new cvar, buyzone, annonce, divide //Pcvar stuff, makes life easier
public plugin_init() // Plugin_init(): Does all the "one-time" stuff. Called after plugin_precache().
{
	register_plugin(Plugin, Version, Author) //Register's the plugin so it can be seen in amx_help
	register_clcmd("say /sprzedaj", "cmd_sell") //Registers the command itself. So if someone say /sell the function will be executed
	register_clcmd("say_team /sprzedaj", "cmd_sell") //Save as above but for team chat
	cvar = register_cvar("SW_enabled", "1") //Registers the cvar SW_enabled, Default 1 (If nothing else is in server.cfg or any other .cfg file)
	buyzone = register_cvar("SW_buyzone", "0") //Registers the cvar SW_buyzone, Default 0 (If nothing else is in server.cfg or any other .cfg file)
	annonce = register_cvar("SW_annonce", "150") //Registers the cvar SW_annonce, Default 120 (If nothing else is in server.cfg or any other .cfg file)
	divide = register_cvar("SW_divide", "2") //Registers the cvar SW_divide, Default 2 (If nothing else is in server.cfg or any other .cfg file)
	if(get_pcvar_num(annonce) > 1) //If the pcvar annonce is higher then 1
		set_task(get_pcvar_float(annonce), "print_annonce",_,_,_,"b") //Set a task to run the annonce function every get_pcvar_float(annonce) time
}

public print_annonce() //The function that shows the annonce
{
	if(get_pcvar_num(annonce) < 1) //If it's lower then 1
		return PLUGIN_CONTINUE //Make the plugin continue (Yes i know i should do remove_task() but this is better)
	client_print(0, print_chat, "Chcesz sprzedac bron? Wpisz /sprzedaj") //Prints the message to everyones chat area
	return PLUGIN_CONTINUE //Continue...
}

public cmd_sell(id) //The whole main function
{
	if(get_pcvar_num(cvar) < 1) //If the pcvar cvar is lower then one
		return PLUGIN_CONTINUE //Continue...
	if(get_pcvar_num(buyzone) == 1 && cs_get_user_buyzone(id) == 0) //If pcvar buyzone is equal to one and user is not in a buyzone
	{
		client_print(id, print_chat, "Musisz byc na respie by sprzedac bron!") //Prints a angry little message :)
		return PLUGIN_HANDLED //And ends the function
	}
	if(!is_user_alive(id)) //Isn't he alive?!
	{
		client_print(id, print_chat, "Musisz byc zywy, by sprzedac bron!") //Prints a angry little message :)
		return PLUGIN_HANDLED //And ends the function
	}
	new temp, weapon = get_user_weapon(id, temp, temp) //Fills weapon with the current hold weapon (temp is a so called dummy)
	new price = str_to_num(g_prices[weapon]) //Gets the price for the current weapon
	if(price == 0) //If it's equal to zero
	{
		client_print(id, print_chat, "Nie mozesz tego sprzedac!") //Prints a angry little message :)
		return PLUGIN_HANDLED //And ends the function
	}
	new oldmoney = cs_get_user_money(id) //Gets the players money
	new cash = clamp(oldmoney + (price / get_pcvar_num(divide)), 0, 16000) //clamps the total amount of cash, so it doesn't extend the 16000 limit
	
	if(weapon != 1 && weapon != 10 && weapon != 11 && weapon != 16 && weapon != 17 && weapon != 26)
	StripWeapons(id, Primary);
	else
	StripWeapons(id, Secondary);
	
	cs_set_user_money(id, cash) //Sets the money from cash
	client_print(id, print_chat, "Otrzymales %d$", cs_get_user_money(id) - oldmoney) //Prints some info about what you got
	return PLUGIN_HANDLED //Done
} //EOF



?


  • +
  • -
  • 1


#611115 Pierwsza runda po rr

Napisane przez dasiek w 30.01.2014 17:34

na pierwszy rzut oka już widzę że nie gdyż New_Round() nie ma parametru ID do którego chcesz się odwołać. 

 

Reszta wydaje się być "ok" choć zamiast tworzyć tablicę dla każdego lepiej zrobić coś takiego. 

Pseudo kod :

zmienne : 

new bool:daj_hajs = false;
new najlepszy_gracz = 0; 

gdy rozgrzewka się skończy sprawdzaj kto ma najwięcej fragów (tak jak to zrobiłeś powinno styknąć) id gracza zapisuj w najlepszy_gracz i ustaw daj_hajs na true. 

 

w evencie nowej rundy sprawdzaj czy daj_hajs jest true , jak tak , 

cs_set_user_money(najlepszy_gracz,cs_get_user_money(najlepszy_gracz)+200);
daj_hajs = false;

powinno styknąć. wiele nie pomogę gdyż dawno nie bawiłęm się w tym + nie mam kodu Twojej rozgrzewki.

 

Powodzenia! ;)


  • +
  • -
  • 1


#611064 Pierwsza runda po rr

Napisane przez dasiek w 30.01.2014 15:11


I tutaj pojawia się problem, jakiego eventu

 

event nowej rundy. pod koniec rozgrzewki daj boolean'a z tym żeby dać i zapisz do zmiennej id gracza który wygrał. w funkcji odpowiadającej za nowa rundę sprawdz czy bolean jest na TAK , i dodaj graczowi hajs jednocześnie ustawiając takiego booleana na false;


  • +
  • -
  • 1


#540256 Klasa "Pirotechnik"

Napisane przez Hleb w 04.05.2013 17:12

testyq.png

 

Klasa: Pirotechnika

Opis: Moze natychmiastowo rozbroić oraz podłozyć C4 (pakę)

Bronie: M4A1, AK47, HE

Zdrowie: 20

Kondycja: -35

Inteligencja: 0

Wytrzymalosc: 20

 

Perk: Narzedzia Pirotechnika

Opis: Mozesz natychmiastowo rozbroić oraz podłożyć C4 (pakę)

 

Filmik

 

testyi.png

 

Klasa: 

Załączony plik  codclass_pirotechnik.sma   3,8 KB  461 Ilość pobrań
  codclass_pirotechnik.amxx

 

Perk:

Załączony plik  codperk_narzedziapirotechnika.sma   3,58 KB  482 Ilość pobrań
  codperk_narzedziapirotechnika.amxx

 


  • +
  • -
  • 22


#539956 Natychmiastowe podłożenie/rozbrojenie paki :D

Napisane przez Hleb w 03.05.2013 21:03

xD

 

Może się przyda np. jako umiejętność do Cod Moda xD


  • +
  • -
  • 6