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

[ROZWIĄZANE] zm_shop


  • Zamknięty Temat jest zamknięty
4 odpowiedzi w tym temacie

#1 janofer

    Zaawansowany

  • Użytkownik

Reputacja: 7
Nowy

  • Postów:78
  • Lokalizacja:Trojmiasto
Offline

Napisano 22.10.2011 14:06

Znalazłem w internecie ten sktypt:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <fakemeta_util>
#include <biohazard>
#include <colorchat>
#include <hamsandwich>

#define PLUGIN "Menu bio"
#define VERSION "1.0"
#define AUTHOR "BeNq!"

new gravity_time[33];
new godmode_time[33];
new name[33];
new speed_time[33];
new gSyncMessage;
new punkty_czlowieka[33];
new punkty_zombie[33];
new SpeedsCvars;

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /shop", "menu")
register_clcmd("say /shop", "menu1")
register_clcmd("chooseteam", "pokaz_menu")
register_clcmd("chooseteam", "pokaz_menu1")
RegisterHam(Ham_TraceAttack, "player", "event_dmg");
gSyncMessage = CreateHudSyncObj();
set_task(60.0,"info",_,_,_,"b");
SpeedsCvars = register_cvar ( "biohazard_speed", "400.0");
}
public pokaz_menu(id)
{
menu(id);
return PLUGIN_HANDLED;
}
public pokaz_menu1(id)
{
menu1(id);
return PLUGIN_HANDLED;
}
public info(id)
{
ColorChat(0,GREEN,"^x01[^x03ZM^x01] Nacisnij^x04 M^x01, aby skorzystac ze^x03 sklepu")
}
public menu(id)
{
if(!game_started())
{
ColorChat(id, GREEN, "^x01[^x04ZM^x01] Poczekaj na jakiegos^x03 zombie")
return PLUGIN_CONTINUE;
}
{
if(!is_user_zombie(id))
{
new menu = menu_create("\rSklep czlowiek: %d", "wybieranie",punkty_czlowieka[id])
menu_additem(menu, "Napalm Nade -\y 1000 $", "1", 0)
menu_additem(menu, "Frost Nade -\y 1000 $", "2", 0)
menu_additem(menu, "Grawitacja -\y 3000 $", "3", 0)
menu_additem(menu, "Pistolet P228 \y2x \rwieksze obrazenia -\y 1500$", "4", 0)
menu_additem(menu, "Bron M249 \y3x \rwieksze obrazenia -\y 2500$", "5", 0)
menu_additem(menu, "AutoKampa \y4x \rwieksze obrazenia -\y 3500$", "6", 0)
menu_additem(menu, "SuperSpeed -\y 3500$", "7", 0)

menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)

menu_display(id, menu, 0)
// pierwszy parametr "id" odpowiada za wyswietlenie menu graczowi, ktory wpisal komende na menu
// drugi parametr pokazuje menu
// trzeci parametr - kto może otworzyć menu, jeżeli 0 to wszyscy.
}
}
return PLUGIN_HANDLED;
}
public wybieranie(id, menu, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu)
// destroy "rozwala menu" czyli wylacza
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu, item, acces, data,5, iName, 63, callback)

// dodaje wybor pod klawisze
new key = str_to_num(data)
switch(key)
{
case 1:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 1000;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie NapalmNades")
give_item(id, "weapon_hegrenade");
cs_set_user_money(id, kasa_gracza-koszt);
menu_destroy(menu)
return PLUGIN_HANDLED
}

case 2:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 1000;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomslnie FrostNades")
give_item(id, "weapon_flashbang");
cs_set_user_money(id, kasa_gracza-koszt);
// teraz menu nie zamykamy
return PLUGIN_CONTINUE
}

case 3:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 3000;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie Grawitacje");
set_user_gravity(id, 0.25);
gravity_time[id] = 15;
set_task(1.0, "disable_gravity", 56465+id, "", 0, "b");
menu_destroy(menu);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
case 4:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 1500;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie P228 z 2x wiekszymi obrazeniami");
give_item(id, "weapon_p228");
menu_destroy(menu);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
case 5:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 2500;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie M249 z 3x wiekszymi obrazeniami");
give_item(id, "weapon_m249");
menu_destroy(menu);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
case 6:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 3500;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie AutoKampe z 4x wiekszymi obrazeniami");
give_item(id, "weapon_g3sg1")
menu_destroy(menu);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
case 7:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 3500;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie SuperSpeed");
fm_set_user_maxspeed(id, fm_get_user_maxspeed(id) + 150);
speed_time[id] = 20;
set_task(1.0, "disable_speed", 56465+id, "", 0, "b");
menu_destroy(menu);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
}
menu_destroy(menu)
return PLUGIN_HANDLED;
}
public menu1(id)
{
if(is_user_zombie(id))
{
new menu1 = menu_create("\rSklep zombie: %d", "wybieraniee",punkty_zombie[id])
menu_additem(menu1, "Szalenstwo -\y 1500$", "7", 0)
menu_additem(menu1, "Extra HP -\y 2500$", "8", 0)
menu_additem(menu1, "SuperSpeed -\y 3500$", "9", 0)

menu_setprop(menu1, MPROP_EXIT, MEXIT_ALL)

menu_display(id, menu1, 0)
// pierwszy parametr "id" odpowiada za wyswietlenie menu graczowi, ktory wpisal komende na menu
// drugi parametr pokazuje menu
// trzeci parametr - kto może otworzyć menu, jeżeli 0 to wszyscy.else
}
return PLUGIN_HANDLED;
}
public wybieraniee(id, menu1, item)
{
if (item == MENU_EXIT)
{
menu_destroy(menu1)
// destroy "rozwala menu" czyli wylacza
return PLUGIN_HANDLED
}
new data[6], iName[64]
new acces, callback
menu_item_getinfo(menu1, item, acces, data,5, iName, 63, callback)

// dodaje wybor pod klawisze
new key = str_to_num(data)

switch(key)
{
case 7:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 1500;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles Szalenstwo");
fm_set_user_godmode(id,1)
godmode_time[id] = 20;
set_task(1.0, "disable_godmode", 56465+id, "", 0, "b");
menu_destroy(menu1);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
case 8:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 2500;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie Health");
new zycie = get_user_health(id)
set_user_health(id, zycie +2000)
menu_destroy(menu1);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
case 9:{
new kasa_gracza = cs_get_user_money(id);
new koszt = 3500;
if (kasa_gracza<koszt)
{
client_print(id, print_chat, "[ZM] Nie masz wystarczajacej ilosci pieniedzy.");
return PLUGIN_CONTINUE;
}
client_print(id, print_chat, "[ZM] Kupiles pomyslnie Super Speed");
fm_set_user_maxspeed( id, get_pcvar_float( SpeedsCvars ) );
speed_time[id] = 30;
set_task(1.0, "disable_speed", 56465+id, "", 0, "b");
menu_destroy(menu1);
cs_set_user_money(id, kasa_gracza-koszt);
return PLUGIN_HANDLED;
}
}
menu_destroy(menu1)
return PLUGIN_HANDLED;
}
public disable_gravity(taskid)
{
new id = taskid-56465;
if(gravity_time[id] > 0)
{
set_hudmessage(0, 170, 255, 0.44, 0.75, 0, 6.0, 1.0);
ShowSyncHudMsg(id, gSyncMessage,"Pozostalo Ci %d Grawitacji", gravity_time[id]);
gravity_time[id]--;
}
else
{
get_user_name(id, name, 32)
set_hudmessage(0, 255, 0, 0.05, 0.63, 2, 6.0, 10.0)
show_hudmessage(id,"Straciles Grawitacje..",name);
fm_set_user_gravity(id, 1.0);
remove_task(taskid);
}
}
public disable_godmode(taskid)
{
new id = taskid-56465;
if(godmode_time[id] > 0)
{
set_hudmessage(0, 170, 255, 0.44, 0.75, 0, 6.0, 1.0);
ShowSyncHudMsg(id, gSyncMessage,"Pozostalo Ci %d godmode", godmode_time[id]);
godmode_time[id]--;
}
else
{
set_user_health(id, 99)
fm_set_user_godmode(id);
remove_task(taskid);
}
}
public disable_speed(taskid)
{
new id = taskid-56465;
if(speed_time[id] > 0)
{
set_hudmessage(0, 170, 255, 0.44, 0.75, 0, 6.0, 1.0);
ShowSyncHudMsg(id,gSyncMessage,"Pozostalo Ci %d Super Speedu", speed_time[id]);
speed_time[id]--;
}
else
{
fm_set_user_maxspeed(id, 1.0);
remove_task(taskid);
}
}
public event_dmg(kto, kogo, Float:dmg)
{
if(is_user_connected(kto) && is_user_connected(kogo) && is_user_zombie(kogo))
{
punkty_czlowieka[kto] += floatround(dmg) *2;
}
}
public event_infect(kto, kogo)
{
if(is_user_connected(kto) && is_user_connected(kogo) && !is_user_zombie(kogo))
{
punkty_zombie[kto] += 1;
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/
Nie da się z nigeo zrobić amxx, ponieważ (chyba) jest błąd w 8 linice

Proszę o pomoc i w naprawieniu błedu
  • +
  • -
  • 0

#2 Hiroshima

    Godlike

  • Przyjaciel

Reputacja: 1 327
Godlike

  • Postów:4 984
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Málaga
Offline

Napisano 22.10.2011 14:18

Automatyczna wiadomość


Ten temat został przeniesiony z forum:
AMX Mod XProblemy z pluginami
do
Scripting AMXXProśby o kompilacje pluginów / Problemy z kompilacją


  • +
  • -
  • 0

#3 byCZUS

    Listonosz

  • Support Team

Reputacja: 752
Guru

  • Postów:459
  • GG:
  • Steam:steam
  • Lokalizacja:GW
Offline

Napisano 22.10.2011 14:21

Wszystko Ok, najwyraźniej brakowało Ci biohazard.inc ^^

Załączone pliki


  • +
  • -
  • 0

Dziękuje, dobranoc.


#4 janofer

    Zaawansowany

  • Autor tematu
  • Użytkownik

Reputacja: 7
Nowy

  • Postów:78
  • Lokalizacja:Trojmiasto
Offline

Napisano 22.10.2011 17:20

dzięki za pomoc ;)

A mógłbyś jeszcze to skomplikować bo jestem w tym zielony

http://www.przeklej....ar-0033in8ps03p


Tu są 3 pliki ;]


Masz tu w code jeśli nie chcesz pobierać

1 Plugin
/* Plugin generated by Emilioneri */

#include 
#include 
#include 
#include 
#include 

#define PLUGIN "Anti Infection Armor"
#define VERSION "1.0"
#define AUTHOR "Emilioneri"

new g_Cost
new g_maxplayers


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	// Add your code here...
	g_Cost = register_cvar("amx_infectarmor", "10500")
	register_logevent("Event_Round_Start", 2, "1=Round_Start")
	register_clcmd("say /antiinfect", "cmd_buyarmor")
	register_dictionary("anti_infect_armor.txt")
	
	g_maxplayers = get_maxplayers()
}

public Event_Round_Start()
{
	for (new id = 1; id <= g_maxplayers; id++)
	{
			set_user_armor(id, 0)
	}
		server_cmd("bh_obeyarmor 1")
		client_print(0, print_chat, "[AMXX] %L", LANG_PLAYER, "TO_BUY")
}

public cmd_buyarmor(id)
{
	if (!is_user_alive(id) || is_user_zombie(id))
	{
		client_print(id, print_chat, "[AMXX] %L", LANG_PLAYER, "ZOMBIE_OR_DEAD")
		return PLUGIN_HANDLED
	}
	
	new iMoney = cs_get_user_money(id)
	new iCost = get_pcvar_num(g_Cost)
	
	if (iMoney >= iCost)
	{
		set_user_armor(id, 100)
		cs_set_user_money(id, iMoney - iCost)
		client_print(id, print_chat, "[AMXX] %L", LANG_PLAYER, "BOUGHT")
		return PLUGIN_HANDLED
	}
	else
	{
		client_print(id, print_chat, "[MAXX] %L", LANG_PLAYER, "NOT_ENOUGH", iCost)
		return PLUGIN_HANDLED
	}
	return PLUGIN_HANDLED
}

2 Plugin
/* Plugin generated by ds811888 */

#include 
#include 
#include 
#include 
#include 
#include 

#if !defined _biohazard_included
		#assert Biohazard functions file required!
#endif

#define OFFSET_NVGOGGLES	129
#define HAS_NVGS (1<<0)
#define USES_NVGS (1<<8)
#define PA_LOW  25.0
#define PA_HIGH 50.0

new antidote_enabled, antidote_cost, antidote_hudmessage, antidotegun_enabled,
antidotegun_cost

new gmsgNVGToggle, g_msgMoney
new g_hasadgun[33]

public plugin_init()
{
	/* Plugin */
	register_plugin("Biohazard Zombie Antidote & Antidote Gun", "1.5", "ds811888")

	g_msgMoney = get_user_msgid("Money")
	gmsgNVGToggle = get_user_msgid("NVGToggle")
	
	/* Commands */
	register_clcmd("say /buy_antidote", "infect_antidote")
	register_clcmd("say buy_antidote", "infect_antidote")
	register_clcmd("say /buy_antidotegun", "infect_antidotegun")
	register_clcmd("say buy_antidotegun", "infect_antidotegun")

	/* Admin Commands */
	register_concmd("amx_antidote", "cmd_give_antidote", ADMIN_BAN, "")
	register_concmd("amx_antidotegun", "cmd_give_antidotegun", ADMIN_BAN, "")

	/* Events */
	register_event("Damage", "event_damage", "b", "2>0")
	register_event("HLTV","event_newround", "a","1=0", "2=0")

	/* Pcvars */
	antidote_enabled		 = register_cvar("bio_antidote_enabled",		 "1" )
	antidote_cost			 = register_cvar("bio_antidote_cost",		 "10000")
	antidote_hudmessage		= register_cvar("bio_antidote_hudmessage",	"1")
	antidotegun_enabled	 = register_cvar("bio_antidotegun_enabled",	"1")
	antidotegun_cost	 = register_cvar("bio_antidotegun_cost",		"16000")

	/* Language */
	register_dictionary("bio_antidote.txt")
}

public event_damage(id)
{
	if(get_pcvar_num(antidotegun_enabled) <= 0 || !is_user_alive(id) || is_user_bot(id))
		return PLUGIN_CONTINUE;

	new iWeapID, attacker = get_user_attacker(id, iWeapID);

	if(!is_user_connected(attacker))
		return PLUGIN_CONTINUE;

	if(!is_user_connected(id))
		return PLUGIN_CONTINUE;

	/* if user have antidote.. */
	if(iWeapID == CSW_AWP)
	{
		if (g_hasadgun[id])
		{
			set_user_human(id)
		}
	}
	return PLUGIN_CONTINUE;
}

public event_newround()
{
	/* Remove user Antidote Gun*/
	for(new i = 0; i < 32; i++)
	{
		g_hasadgun[i] = false
	}
}

public client_connect(id)
{
	g_hasadgun[id] = false
}

/* Admin Commands: amx_antidote */
public cmd_give_antidote(id,level,cid)
{
	/* Check user admin */
	if (!cmd_access(id,level,cid,2))
		return PLUGIN_HANDLED;

		/* Check user alive */
		if(!is_user_alive(id))
   	 return PLUGIN_HANDLED

		/* Check user zombie */
		if(!is_user_zombie(id))
			return PLUGIN_HANDLED;

	new arg[32];
	read_argv(1,arg,31);
	
	new player = cmd_target(id,arg,7);
	if (!player)
		return PLUGIN_HANDLED;
	
	new name[32];
	get_user_name(player,name,31);

	/* Give a Antidote */
	set_user_human(player)
	
	return PLUGIN_HANDLED
}

/* Admin Commands: amx_antidotegun */
public cmd_give_antidotegun(id,level,cid)
{
	/* Check user admin */
	if (!cmd_access(id,level,cid,2))
		return PLUGIN_HANDLED;

		/* Check user alive */
		if(!is_user_alive(id))
		return PLUGIN_HANDLED

	new arg[32];
	read_argv(1,arg,31);
	
	new player = cmd_target(id,arg,7);
	if (!player)
		return PLUGIN_HANDLED;
	
	new name[32];
	get_user_name(player,name,31);

	/* Give a Antidote Gun */
	g_hasadgun[player] = true
	give_item(player, "weapon_awp")
	
	return PLUGIN_HANDLED
}

/* Commands: say /buy_antidote */
public infect_antidote(id)
{	
	if(get_pcvar_num(antidote_enabled))
	{
		new money = cs_get_user_money(id)
		new price_antidote = get_pcvar_num(antidote_cost)

		new ts[32], tsnum
		new maxplayers = get_maxplayers()
		new CsTeams:team
		
		for (new i=1; i<=maxplayers; i++)
		{
			if (!is_user_connected(i) || !is_user_alive(i))
			{
				continue
			}
			team = cs_get_user_team(i)
			
			if (team == CS_TEAM_T)
			{
				ts[tsnum++] = i
			}
		}

		/* Check user last zombie */
		if (tsnum == 1)
		{
			client_print(id, print_chat, "[BIO] %L", LANG_PLAYER, "LAST_ZOMBIE")
			return PLUGIN_HANDLED
		}

		/* Check user alive */
		if(!is_user_alive(id))
			return PLUGIN_HANDLED

		/* Check user zombie */
		if(!is_user_zombie(id))
			return PLUGIN_HANDLED
	
		/* Check user money */
		if(money <= price_antidote)
		{
			client_print(id, print_center, "[BIO] %L", LANG_PLAYER, "NOT_ENOUGH_MONEY" , price_antidote)
		}
		else
		{
			/* -user money to buy a zombie antidote */
			message_begin(MSG_ONE, g_msgMoney, _, id)
			write_long(money-price_antidote) // amount
			write_byte(1) // flash
			message_end()
			
			cs_set_user_money(id, money - price_antidote)

			/* Client Print */
			client_print(id, print_center, "[BIO] %L", LANG_PLAYER, "USED_ANTIDOTE")

			/* Set user to survivor */
			set_user_human(id)

			/* HudMessage */
			if(get_pcvar_num(antidote_hudmessage))
			{
				set_hudmessage(0, 0, 255, -1.0, 0.53)
				show_hudmessage(id, "%L", LANG_PLAYER, "AGAIN_SURVIVOR")
			}
		}
	}
	return PLUGIN_HANDLED
}

/* Commands: say /buy_antidotegun */
public infect_antidotegun(id)
{	
	if(get_pcvar_num(antidotegun_enabled))
	{
		new money = cs_get_user_money(id)
		new price_antidotegun = get_pcvar_num(antidotegun_cost)

		/* Check user alive */
		if(!is_user_alive(id))
			return PLUGIN_HANDLED

		/* Check user money */
		if(money <= price_antidotegun)
		{
			client_print(id, print_center, "[BIO] %L", LANG_PLAYER, "NOT_ENOUGH_MONEY_GUN" , price_antidotegun)
		}
		else
		{
			/* -user money to buy a zombie antidote gun */
			cs_set_user_money(id, money - price_antidotegun)

			/* Client Print */
			client_print(id, print_center, "[BIO] %L", LANG_PLAYER, "BOUGHT_ANTIDOTEGUN")

   	 /* Give user antidote gun */
   	 g_hasadgun[id] = true
   	 give_item(id, "weapon_awp")
		}
	}
	return PLUGIN_HANDLED
}

/* Set user to survivor */
stock set_user_human(id)
{
	cure_user(id)

	/* Remove user Nvgs */
	Remove_User_Nvgs(id)

	/* Set user health to 100 */
	set_user_health(id, 100)
	
	/* Set user to CT TEAM */
	cs_set_user_team(id, CS_TEAM_CT)

	/* reset user model */
	cs_reset_user_model(id)

	/* give user weapon */
	give_item(id, "weapon_m4a1")
	give_item(id, "weapon_deagle")

	/* set user ammo */
	cs_set_user_bpammo(id, CSW_M4A1, 90)
	cs_set_user_bpammo(id, CSW_DEAGLE, 35)
}

/* ConnorMcLeod by BeasT */
Remove_User_Nvgs(id)
{
	new iNvgs = get_pdata_int(id, OFFSET_NVGOGGLES, 5)
	if( !iNvgs )
	{
		return
	}
	if( iNvgs & USES_NVGS )
	{
		emit_sound(id, CHAN_ITEM, "items/nvg_off.wav", VOL_NORM, ATTN_NORM, 0, PITCH_NORM)

		emessage_begin(MSG_ONE, gmsgNVGToggle, _, id)
		ewrite_byte(0)
		emessage_end()
	}
	set_pdata_int(id, OFFSET_NVGOGGLES, 0, 5)
}
3 Plugin
#include 
#include 

new HIGHPING_MAX = 140 // set maximal acceptable ping
new HIGHPING_TIME = 6  // set in seconds frequency of ping checking
new HIGHPING_TESTS = 3  // minimal number of checks before doing anything

new iNumTests[33]

public plugin_init() {
	register_plugin("High Ping Kicker","1.2.0","DynAstY")
	if (HIGHPING_TIME < 10) HIGHPING_TIME = 6
	if (HIGHPING_TESTS < 4) HIGHPING_TESTS = 3
	return PLUGIN_CONTINUE
}

public client_disconnect(id) {
	remove_task(id)
	return PLUGIN_CONTINUE
}
	
public client_putinserver(id) {
	iNumTests[id] = 0
	if (!is_user_bot(id)) {
		new param[1]
		param[0] = id
		set_task(30.0, "showWarn", id, param, 1)
	}
	return PLUGIN_CONTINUE
}

kickPlayer(id) {
	new name[32]
	get_user_name(id, name, 31)
	new uID = get_user_userid(id)
	server_cmd("banid 1 #%d", uID)
	client_cmd(id, "echo ^"[HPK] Twoj ping jest za duzy!^"; disconnect")
	ColorChat(0, GREEN, "[HPK]^x01 Gracz^x04 %s^x01 zostal rozlaczony z powodu duzego ping'u!", name)
	return PLUGIN_CONTINUE
}

public checkPing(param[]) {
	new id = param[0]
	if ((get_user_flags(id) & ADMIN_IMMUNITY)) {
		remove_task(id)
		ColorChat(0, GREEN, "[HPK]^x01 Ping nie obowiazuje graczy z immunitetem...")
		return PLUGIN_CONTINUE
	}
	new p, l
	get_user_ping(id, p, l)
	if (p > HIGHPING_MAX)
		++iNumTests[id]
	else
		if (iNumTests[id] > 0) --iNumTests[id]
	if (iNumTests[id] > HIGHPING_TESTS)
		kickPlayer(id)
	return PLUGIN_CONTINUE
}

public showWarn(param[]) {
	ColorChat(param[0], GREEN, "[HPK]^x01 Gracze z pingiem wiekszym niz^x04 %d^x01 beda wyrzucani!", HIGHPING_MAX)
	set_task(float(HIGHPING_TIME), "checkPing", param[0], param, 1, "b")
	return PLUGIN_CONTINUE
}


Już se poradziłem można zamknąć

Użytkownik janofer edytował ten post 22.10.2011 15:24

  • +
  • -
  • 0

#5 Hiroshima

    Godlike

  • Przyjaciel

Reputacja: 1 327
Godlike

  • Postów:4 984
  • Steam:steam
  • Imię:Michał
  • Lokalizacja:Málaga
Offline

Napisano 22.10.2011 17:30

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: Pomoc udzielona

Jeśli się z tym nie zgadzasz, Dołączona grafika raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL
  • +
  • -
  • 0




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

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