Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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
JailBreak

Problem z zabawą JB

jailbreak

  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 NarVo

    Początkujący

  • Użytkownik

Reputacja: 0
zer0.

  • Postów:16
  • Imię:Mateusz
  • Lokalizacja:Polska
Offline

Napisano 02.02.2016 20:46

Witam ! Mam mały problem z zabawą jail_war. Po zakończeniu zabawy następnego dnia więźniowie ponownie dostają menu wyboru klasy. Kod pluginu zamieszczam poniżej. 

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <engine>
#include <hamsandwich>
#include <fakemeta>
#include <jailbreak>

#define PLUGIN "[JB] MW"
#define VERSION "1.0.6"
#define AUTHOR "kimiz ;p"

#define TASK_HUD 6781252

new jakie_bronie[] = {CSW_USP, CSW_HEGRENADE, CSW_FLASHBANG};
new druzyna[][] = {"Swat", "Kapral's"};

new user_gangi[MAX+1];

new HamHook:hSpawn, HamHook:fHamKill, HamHook:fHamTakeDamage[2];
new fmClientDisconnect;

new id_zabawa;
native cs_set_player_model(id, newmodel[]);

new bool:medyk[33]
new bool:sniper[33]
new bool:czolganie[33]
new sprite_white;
new ilosc_apteczek_gracza[33];


new explosion, smoke, white, rocketsmoke
new bool:CanShoot[32]
new Munni[32]
new mode[32]
new bool:allow_shooting
new user_controll[32]
new bool:hasBazooka[32]





public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	
	id_zabawa = jail_register_game("Modern WarFare");
	//register_clcmd("say /klasa", "wybierz_klase");
	register_clcmd("say /status", "sprawdz_status");
	register_clcmd("say /apt", "jebnij_apteczke");
	register_think("medkit","MedkitThink");
	
	register_logevent("Koniec_Rundy", 2, "1=Round_End")
	
	register_event("DeathMsg", "player_die", "a")
	register_event("CurWeapon", "check_model", "be")
	register_event("TextMsg", "bomb_msg", "b", "2=#C4_Plant_At_Bomb_Spot")
	register_logevent("round_end", 2, "1=Round_End")
	register_logevent("round_start", 2, "1=Round_Start")
	
	register_clcmd("drop", "handle_drop")
	
	register_forward(FM_PlayerPreThink, "forward_playerprethink")
	register_forward(FM_SetModel, "forward_setmodel")
	
}

public plugin_precache()
{
	precache_model("models/w_medkit.mdl");
	sprite_white = precache_model("sprites/white.spr");
	
	
	precache_model("models/rpgrocket.mdl")
	precache_model("models/v_rpg.mdl")
	precache_model("models/p_rpg.mdl")
	
	precache_sound("weapons/rocketfire1.wav")
	precache_sound("weapons/nuke_fly.wav")
	precache_sound("weapons/mortarhit.wav")
	precache_sound("weapons/dryfire_rifle.wav")
	
	explosion = precache_model("sprites/fexplo.spr")
	smoke  = precache_model("sprites/steam1.spr")
	white = precache_model("sprites/white.spr")
	rocketsmoke = precache_model("sprites/smoke.spr")
	
	
}
public OnLastPrisonerShowWish(id)
{
	OnRemoveData(id_zabawa);
}

public OnRemoveData(day)
{
	if(day == id_zabawa)
	{		
		for(new i=1; i<=MAX; i++)
		{
			medyk[i] = false;
			sniper[i] = false;
			hasBazooka[i] = false;
		}
		client_cmd(0, "mp3 stop");
		client_cmd(0, "drawradar");
		
		if(hSpawn)
			DisableHamForward(hSpawn);
		
		if(fHamKill)
			DisableHamForward(fHamKill);
		
		if(fHamTakeDamage[0])
			DisableHamForward(fHamTakeDamage[0]);
		
		if(fHamTakeDamage[1])
			DisableHamForward(fHamTakeDamage[1]);
		
		if(fmClientDisconnect)
		{
			unregister_forward(FM_ClientDisconnect, fmClientDisconnect);
			fmClientDisconnect = 0;
		}
		
		if(task_exists(TASK_HUD))
			remove_task(TASK_HUD);
	}
}

public OnDayStartPre(day, szInfo[256], szInfo2[512], setting[10], gTimeRound)
{	
	if(day == id_zabawa)
	{
		
		szInfo = "Gramy w: Modern WarFare";
		
		jail_set_prisoners_micro(true, true);
		jail_set_ct_hit_tt(true);
		jail_set_god_ct(true);
		setting[0] = 1;
		setting[1] = 1;
		setting[2] = 1;
		setting[4] = 1;
		setting[6] = 1;
		setting[7] = 1;
	}
}

public OnDayStartPost(day)
{
	if(day == id_zabawa)
	{
		jail_open_cele();
		jail_set_game_hud(20, "Rozpoczecie zabawy za");
		//client_cmd(0, "mp3 play sound/JailBreak[k]/wojna.mp3");
		allow_shooting = true
		
		for(new i=1; i<=MAX; i++)
		{
			UstawPrzydzial(i);
		}
		
		if(!hSpawn)
			hSpawn = RegisterHam(Ham_Spawn, "player", "fwSpawn", 1);
		else
			EnableHamForward(hSpawn);
		
		if(!fHamKill)
			fHamKill = RegisterHam(Ham_Killed, "player", "SmiercGraczaPost", 1);
		else
			EnableHamForward(fHamKill);
		
		if(!fHamTakeDamage[0])
			fHamTakeDamage[0] = RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
		else
			EnableHamForward(fHamTakeDamage[0]);
		
		if(!fHamTakeDamage[1])
			fHamTakeDamage[1] = RegisterHam(Ham_TraceAttack, "player", "TraceAttack");
		else
			EnableHamForward(fHamTakeDamage[1]);
		
		if(!fmClientDisconnect)
			fmClientDisconnect = register_forward(FM_ClientDisconnect, "fwClientDisconnect");
		
		set_task(1.0, "PokazWiadomoscHud", TASK_HUD, .flags="b");
	}
}

public fwSpawn(id)
{
	UstawPrzydzial(id);
}

public UstawPrzydzial(id)
{
	if(!is_user_alive(id) || !is_user_connected(id))
		return;
	
	if(cs_get_user_team(id) != CS_TEAM_T)
		return;
	
	static przydzial = 0;
	for(new j=0; j<sizeof(jakie_bronie); j++)
	{
		new weaponname[24];
		get_weaponname(jakie_bronie[j], weaponname, 23);
		give_item(id, weaponname);
		wybierz_klase(id)
	}
	
	user_gangi[id] = przydzial;
	
	if(user_gangi[id] == 0)
		set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 16)
	else if(przydzial == 1)
		set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 16)
	if(++przydzial >= 2)
		przydzial = 0;
}

public OnGameHudEnd(day)
{
	if(day == id_zabawa)
	{
		set_hudmessage(111, 111, 111, -1.0, -1.0, 0, 6.0, 5.0);
		show_hudmessage(0, "== Fight ==");
		jail_set_prisoners_fight(true, false, false);
	}
}

public TakeDamage(id, ent, attacker, Float:damage, damagebits)
	return vTakeDamage(id, attacker);

public TraceAttack(id, attacker, Float:damage, Float:direction[3], tracehandle, damagebits)
	return vTakeDamage(id, attacker);

vTakeDamage(id, attacker)
{
if(!is_user_connected(id) || !is_user_connected(attacker) || cs_get_user_team(id) != CS_TEAM_T || cs_get_user_team(attacker) != CS_TEAM_T)
	return HAM_IGNORED;
	
	if(user_gangi[attacker] == user_gangi[id])
		return HAM_SUPERCEDE;
	
	return HAM_IGNORED;
}

public fwClientDisconnect(id)
{
	SprawdzGangi();
}

public SmiercGraczaPost(id, attacker, shouldgib)
{	
	if(!is_user_connected(id) || cs_get_user_team(id) != CS_TEAM_T)
		return;
	
	SprawdzGangi();
}

public SprawdzGangi()
{
	new gang[2];
	for(new i=1; i<=MAX; i++)
	{
		if(!is_user_alive(i) || !is_user_connected(i))
			continue;
		
		if(cs_get_user_team(i) != CS_TEAM_T)
			continue;
		
		gang[user_gangi[i]]++;
	}
	
	if(!gang[0] || !gang[1])
		
{
	if(fHamTakeDamage[0])
		DisableHamForward(fHamTakeDamage[0]);
		
		if(fHamTakeDamage[1])
			DisableHamForward(fHamTakeDamage[1]);
	}
}

public PokazWiadomoscHud(taskid)
{
	utilAllHudColor();
}

stock utilAllHudColor()
{
	static SyncHudObj;
	if(!SyncHudObj)
		SyncHudObj = CreateHudSyncObj();
	
	set_hudmessage(127, 255, 255, 0.28, 0.03, .holdtime=1.0);
	for(new i=1; i<=32; i++)
	{
		if(!is_user_connected(i) || !is_user_alive(i))
			continue;
		
		if(cs_get_user_team(i) != CS_TEAM_T)
			continue;
		
		ShowSyncHudMsg(i, SyncHudObj, "Druzyna: %s", druzyna[user_gangi[i]]);
	}
}
/************************************************
*************************************************
*************************************************
*************** K L A S Y ***********************
*************************************************
***********************************************/

public wybierz_klase(id)
{
	new menu = menu_create("Wybierz klase:", "handler_klasy");
	
	menu_additem(menu, "Assault", "", 0); // case 0
	menu_additem(menu, "Sniper", "", 0); // case 1
	menu_additem(menu, "Heavy", "", 0); // case 2
	menu_additem(menu, "Medyk", "", 0); // case 3
	menu_additem(menu, "Shooter", "", 0); // case 4
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_NEVER);
	menu_setprop(menu, MPROP_BACKNAME, "Wstecz");
	menu_setprop(menu, MPROP_NEXTNAME, "Dalej");
	menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");
	menu_setprop(menu, MPROP_NOCOLORS, 1);
	
	menu_display(id, menu, 0);
	
	return PLUGIN_HANDLED;
}

public handler_klasy(id, menu, item)
{
	new command[6], name[64], access, callback;
	
	menu_item_getinfo(menu, item, access, command, sizeof command - 1, name, sizeof name - 1, callback);
	
	switch(item)
	{
		case 0: {
			client_print(id, print_chat, "[Modern WarFare] wybrales klase Assault, posiadasz celownik w P90");
			client_cmd(id, "say Wybralem klase Assault")
			strip_user_weapons(id)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_p90")
			give_item(id, "weapon_hegrenade")
			give_item(id, "item_assaultsuit")
		}
		case 1: {
			client_print(id, print_chat, "[Modern WarFare] wybrales klase Sniper, mozesz sie czolgac na E");
			client_cmd(id, "say Wybralem klase Sniper")
			sniper[id] = true;
			strip_user_weapons(id)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_awp")
			give_item(id, "weapon_smokegrenade")
		}
		case 2: {
			client_print(id, print_chat, "[Modern WarFare] wybrales klase Heavy, dostales RGP");
			client_cmd(id, "say Wybralem klase Heavy")
			hasBazooka[id] = true
			Munni[id] = 1
			strip_user_weapons(id)
			give_item(id, "weapon_c4")
			give_item(id, "weapon_knife")
			give_item(id, "weapon_m249") 
			
		}
		case 3: {
			client_print(id, print_chat, "[Modern WarFare] wybrales klase Medyk, posiadasz 2 apteczki wpisz /apt");
			client_cmd(id, "say Wybralem klase Medyk")
			medyk[id] = true;
			ilosc_apteczek_gracza[id] = 2;
			strip_user_weapons(id)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_mp5navy")
			give_item(id, "weapon_flashbang")
			
		}
		case 4: {
			client_print(id, print_chat, "[Modern WarFare] wybrales klase Shooter, mozesz szybko biegac");
			client_cmd(id, "say Wybralem klase Shooter")
			strip_user_weapons(id)
			give_item(id, "weapon_knife")
			give_item(id, "weapon_m3")
			give_item(id, "weapon_flashbang")
			set_user_maxspeed(id,450.0);
			
		}			
	}
	
	menu_destroy(menu);
	
	return PLUGIN_HANDLED;
}

///////////////////////////////////////////////////////////////////////
//*****************************  MEDYK ******************************
///////////////////////////////////////////////////////////////////////
public jebnij_apteczke(id, day)
{
	
	
	if (!ilosc_apteczek_gracza[id])
	{
		client_print(id, print_center, "Masz tylko 2 apteczki na runde!");
		return PLUGIN_CONTINUE;
	}
	
	ilosc_apteczek_gracza[id]--;
	
	new Float:origin[3];
	entity_get_vector(id, EV_VEC_origin, origin);
	
	new ent = create_entity("info_target");
	entity_set_string(ent, EV_SZ_classname, "medkit");
	entity_set_edict(ent, EV_ENT_owner, id);
	entity_set_int(ent, EV_INT_solid, SOLID_NOT);
	entity_set_vector(ent, EV_VEC_origin, origin);
	entity_set_float(ent, EV_FL_ltime, halflife_time() + 7 + 0.1);
	
	
	entity_set_model(ent, "models/w_medkit.mdl");
	set_rendering ( ent, kRenderFxGlowShell, 255,0,0, kRenderFxNone, 255 ) 	;
	drop_to_floor(ent);
	
	entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.1);
	
	return PLUGIN_CONTINUE;
}

public MedkitThink(ent, day)
{
	
	
	new id = entity_get_edict(ent, EV_ENT_owner);
	new dist = 300;
	new heal = 5;
	
	if (entity_get_edict(ent, EV_ENT_euser2) == 1)
	{		
		new Float:forigin[3];
		entity_get_vector(ent, EV_VEC_origin, forigin);
		
		new entlist[33];
		new numfound = find_sphere_class(0,"player", float(dist),entlist, 32,forigin);
		
		for (new i=0; i < numfound; i++)
		{		
			new pid = entlist[i];
			
			if (get_user_team(pid) != get_user_team(id))
				continue;
			
			new maksymalne_zdrowie = 125;
			new zdrowie = get_user_health(pid);
			new Float:nowe_zdrowie = (zdrowie+heal<maksymalne_zdrowie)?zdrowie+heal+0.0:maksymalne_zdrowie+0.0;
			if (is_user_alive(pid)) entity_set_float(pid, EV_FL_health, nowe_zdrowie);	
		}
		
		entity_set_edict(ent, EV_ENT_euser2, 0);
		entity_set_float(ent, EV_FL_nextthink, halflife_time() + 1.5);
		
		return PLUGIN_CONTINUE;
	}
	
	if (entity_get_float(ent, EV_FL_ltime) < halflife_time() || !is_user_alive(id))
	{
		remove_entity(ent);
		return PLUGIN_CONTINUE;
	}
	
	if (entity_get_float(ent, EV_FL_ltime)-2.0 < halflife_time())
		set_rendering ( ent, kRenderFxNone, 255,255,255, kRenderTransAlpha, 100 );
	
	new Float:forigin[3];
	entity_get_vector(ent, EV_VEC_origin, forigin);
	
	new iOrigin[3];
	for(new i=0;i<3;i++)
		iOrigin[i] = floatround(forigin[i]);
	
	message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
	write_byte( TE_BEAMCYLINDER );
	write_coord( iOrigin[0] );
	write_coord( iOrigin[1] );
	write_coord( iOrigin[2] );
	write_coord( iOrigin[0] );
	write_coord( iOrigin[1] + dist );
	write_coord( iOrigin[2] + dist );
	write_short( sprite_white );
	write_byte( 0 ); // startframe
	write_byte( 0 ); // framerate
	write_byte( 10 ); // life
	write_byte( 10 ); // width
	write_byte( 255 ); // noise
	write_byte( 255 ); // r, g, b
	write_byte( 100 );// r, g, b
	write_byte( 100 ); // r, g, b
	write_byte( 128 ); // brightness
	write_byte( 0 ); // speed
	message_end();
	
	entity_set_edict(ent, EV_ENT_euser2 ,1);
	entity_set_float(ent, EV_FL_nextthink, halflife_time() + 0.5);
	
	
	return PLUGIN_CONTINUE;
	
}

public screen_fade(id){
	
	//////   migniecie ekranu ////
	new testt = get_user_msgid("ScreenFade");
	
	message_begin(MSG_ONE_UNRELIABLE,testt, {0,0,0}, id);
	write_short(1<<10);
	write_short(1<<10);
	write_short(0x0000);
	write_byte(255);
	write_byte(7);
	write_byte(7);
	write_byte(75);
	message_end();
}

///////////////////////////////////////////////////////////////////////
//***************************** SNAJPER ******************************
///////////////////////////////////////////////////////////////////////

public client_PostThink(id)
{	
	new button = pev(id,pev_button)
	new oldbuttons = pev(id,pev_oldbuttons)
	
	if(button & IN_USE && oldbuttons & IN_USE && pev(id,pev_watertype) == -1&&sniper[id]==true)
	{
		new flags = pev(id,pev_flags)
		
		if(flags & FL_ONGROUND)
		{		
			engfunc(EngFunc_DropToFloor,id)
			
			client_cmd(id,"+duck")
			set_pev(id,pev_waterlevel,5)
			set_pev(id,pev_punchangle,{0.0,0.0,0.0})
			czolganie[id] = true			
		}
		
		if(button & IN_JUMP &&czolganie[id])
		{				
			new Float:vVelocity[3] 				
			pev(id,pev_velocity,vVelocity)
			vVelocity[2] = float(-abs(floatround(vVelocity[2]))) 			
			set_pev(id,pev_velocity,vVelocity)						
			set_pev(id,pev_button,pev(id,pev_button) & ~IN_JUMP)
		}		
	}
	else
	{
		if(czolganie[id])
		{
			client_cmd(id,"-duck")
			set_pev(id,pev_waterlevel,0)
			czolganie[id] = false
		}		
	}	
}

  • +
  • -
  • 0





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

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

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