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

[ROZWIĄZANE] Za długa linia


Najlepsza odpowiedź vaulT , 25.12.2013 13:17

Jezeli nadal bedzie za dluga to sobie ja skroc tak samo jak na moim przykladzie

	
	new pc = player_class[id];
	
	if(get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)) || (pc == Mag && player_b_fireball[id]==0 || player_a_fireball[id]==0)) && is_user_alive(id) && !bow[id] && (on_knife[id] || (pc == Mag && player_b_fireball[id] || player_a_fireball[id])) && pc!=NONE && pc!=Nekromanta && invisible_cast[id]==0 || pc== NONE && pc!=NONE && pc!= Killer && invisible_cast[id]==0)


Przejdź do postu


  • Zamknięty Temat jest zamknięty
1 odpowiedź w tym temacie

#1 GoldenKill

    Guru

  • Power User

Reputacja: 506
Wszechwiedzący

  • Postów:792
  • GG:
  • Steam:steam
  • Imię:Damian
  • Lokalizacja:Trzebnica
Offline

Napisano 25.12.2013 13:13

Witam

 

Więc tak jak w tytule wywala mi błąd że mam za długą linię tu

	if(get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)) || (player_class[id] == Mag && player_b_fireball[id]==0 || player_a_fireball[id]==0)) && is_user_alive(id) && !bow[id] && (on_knife[id] || (player_class[id] == Mag && player_b_fireball[id] || player_a_fireball[id])) && player_class[id]!=NONE && player_class[id]!=Nekromanta && invisible_cast[id]==0 || player_class[id] == NONE && player_class[id]!=NONE && player_class[id] != Killer && invisible_cast[id]==0)

o to cała funkcja

public client_PreThink ( id ) 
{	
	new clip,ammo
	new weapon = get_user_weapon(id,clip,ammo)
	new button2 = get_user_button(id);
	if(player_class[id]==Paladyn && weapon == CSW_KNIFE && freeze_ended) 
	{ 
		if((button2 & IN_DUCK) && (button2 & IN_JUMP)) 
		{ 
			if(JumpsLeft[id]>0) 
			{ 
				new flags = pev(id,pev_flags) 
				if(flags & FL_ONGROUND) 
				{ 
					set_pev ( id, pev_flags, flags-FL_ONGROUND ) 
					
					JumpsLeft[id]-- 
					
					new Float:va[3],Float:v[3] 
					entity_get_vector(id,EV_VEC_v_angle,va) 
					v[0]=floatcos(va[1]/180.0*M_PI)*560.0 
					v[1]=floatsin(va[1]/180.0*M_PI)*560.0 
					v[2]=300.0+player_b_buty[id]*20+player_strength[id]*2 
					entity_set_vector(id,EV_VEC_velocity,v) 
					write_hud(id)
				} 
			} 
		} 
	}
	if( get_user_button(id) & IN_USE && !(get_user_oldbutton(id) & IN_USE) && is_user_alive(id)) 
	{			
		if (on_knife[id])
		{
			if((g_PreThinkDelay[id] + 0.28) < get_gametime())
			{
				switch(player_class[id])
				{
					case Merial:piorun(id)
						case Bard:kula1(id)
					}
			}
		}
	}
	if( get_user_button(id) & IN_ATTACK2 && player_item_id[id] != 100 || player_item_id[id] != 101 && player_class[id]==Master &&  !(get_user_oldbutton(id) & IN_ATTACK2) && is_user_alive(id)) 
	{			
		if (on_knife[id])
		{
			if (halflife_time()- czas[id] <= 25) return PLUGIN_HANDLED		
			czas[id] = floatround(halflife_time())+ player_intelligence[id]/5
			UTIL_Teleport(id,450+10*player_intelligence[id])
			client_cmd(id, "spk diablosound/teleport.wav")
		}
	}
	if(flashlight[id] && flashbattery[id] && (get_cvar_num("flashlight_custom")) && (player_class[id] == Mag)) {
		new num1, num2, num3
		num1=random_num(0,2)
		num2=random_num(-1,1)
		num3=random_num(-1,1)
		flashlight_r+=1+num1
		if (flashlight_r>250) flashlight_r-=245
		flashlight_g+=1+num2
		if (flashlight_g>250) flashlight_g-=245
		flashlight_b+=-1+num3
		if (flashlight_b<5) flashlight_b+=240		
		new origin[3];
		get_user_origin(id,origin,3);
		message_begin(MSG_BROADCAST,SVC_TEMPENTITY);
		write_byte(27); // TE_DLIGHT
		write_coord(origin[0]); // X
		write_coord(origin[1]); // Y
		write_coord(origin[2]); // Z
		write_byte(get_cvar_num("flashlight_radius")); // radius
		write_byte(flashlight_r); // R
		write_byte(flashlight_g); // G
		write_byte(flashlight_b); // B
		write_byte(1); // life
		write_byte(get_cvar_num("flashlight_decay")); // decay rate
		message_end();
		
		new index1, bodypart1
		get_user_aiming(id,index1,bodypart1) 
		if ((get_user_team(id)!=get_user_team(index1)) && (index1!=0))
		{
			if ((index1!=54) && (is_user_connected(index1))) set_user_rendering(index1,kRenderFxGlowShell,flashlight_r,flashlight_g,flashlight_b,kRenderNormal,4)	
			remove_task(TASK_FLASH_LIGHT+index1);
			set_task(7.5, "un_rander",TASK_FLASH_LIGHT+index1)
			//set_task(15.0,"un_rander",TASK_NAME,index1)
		}
	}
	if (entity_get_int(id, EV_INT_button) & 2 && (player_b_autobh[id] > 0))
        {
                new flags = entity_get_int(id, EV_INT_flags)
                
                
                if (flags & FL_WATERJUMP)
                        return PLUGIN_CONTINUE
                if ( entity_get_int(id, EV_INT_waterlevel) >= 2 )
                        return PLUGIN_CONTINUE
                if ( !(flags & FL_ONGROUND) )
                        return PLUGIN_CONTINUE
                
                new Float:velocity[3]
                entity_get_vector(id, EV_VEC_velocity, velocity)
                velocity[2] += 250.0
                entity_set_vector(id, EV_VEC_velocity, velocity)
                
                entity_set_int(id, EV_INT_gaitsequence, 6)
        }
	
	//Before freeze_ended check
	if ((player_b_silent[id] > 0 || player_b_4move[id] > 0 || (c_silent[id] > 0) || (a_silent[id] > 0) || (player_class[id] == Zabojca)) && is_user_alive(id)) 
		entity_set_int(id, EV_INT_flTimeStepSound, 300)
	
	new Float:vect[3]
	entity_get_vector(id,EV_VEC_velocity,vect)
	new Float: sped= floatsqroot(vect[0]*vect[0]+vect[1]*vect[1]+vect[2]*vect[2])
	if((get_user_maxspeed(id)*5)>(sped*9))
		entity_set_int(id, EV_INT_flTimeStepSound, 300)
	
	if(button2 & IN_RELOAD && on_knife[id] && button[id]==0 && (player_class[id]==Hunter||player_class[id]==Legionista)){
		bow[id]++
		button[id] = 1;
		command_bow(id)	
	}
	if(button2 & IN_RELOAD && on_knife[id] && button[id]==0 && (player_class[id]==Elf))
        {
		bow[id]++
		button[id] = 1;
		command_bow1(id)	
	}
	if (button2 & IN_RELOAD && on_knife[id] && button[id]==0 && (player_class[id]==Killer)){
		czolg[id]++
		button[id] = 1;
		command_czolg(id)	
	}
	if (button2 & IN_RELOAD && on_knife[id] && button[id]==0 && (player_class[id]==Zombie)){
		makul[id]++
		button[id] = 1;
		command_kula(id)	
	}
	
	if (button2 & IN_ATTACK2 && player_class[id]==Diablo &&  !(get_user_oldbutton(id) & IN_ATTACK2)){
		if (weapon !=CSW_KNIFE && weapon != CSW_AWP && weapon != CSW_SCOUT){
			if (cs_get_user_zoom(id)==CS_SET_NO_ZOOM) cs_set_user_zoom ( id, CS_SET_AUGSG552_ZOOM, 1 ) 
			else cs_set_user_zoom(id,CS_SET_NO_ZOOM,1)
		}
	}
	
	if ((!(button2 & IN_RELOAD)) && on_knife[id] && button[id]==1) button[id]=0
	//
	
	if (!freeze_ended)
		return PLUGIN_CONTINUE
	
	if (earthstomp[id] != 0 && is_user_alive(id))
	{
		static Float:fallVelocity;
		pev(id,pev_flFallVelocity,fallVelocity);
		
		if(fallVelocity) falling[id] = true
		else falling[id] = false;
	}
	
	
	if (player_b_jumpx[id] > 0 || c_jump[id] > 0 || a_jump[id] > 0) Prethink_Doublejump(id)
	if (player_b_blink[id] > 0 || used_noz[id] > 0) Prethink_Blink(id)	
	if (player_b_usingwind[id] == 1) Prethink_usingwind(id)
	if (player_b_oldsen[id] > 0) Prethink_confuseme(id)
	if (player_b_froglegs[id] > 0) Prethink_froglegs(id)
	if (c_redirect[id] > 0 || a_redirect[id] > 0) add_bonus_redirect(id)
	
	
	//USE Button actives USEMAGIC	
	if(get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)) || (player_class[id] == Mag && player_b_fireball[id]==0 || player_a_fireball[id]==0)) && is_user_alive(id) && !bow[id] && (on_knife[id] || (player_class[id] == Mag && player_b_fireball[id] || player_a_fireball[id])) && player_class[id]!=NONE && player_class[id]!=Nekromanta && invisible_cast[id]==0 || player_class[id] == NONE && player_class[id]!=NONE && player_class[id] != Killer && invisible_cast[id]==0)
	{
		if(casting[id]==1 && halflife_time()>cast_end[id])
		{
			message_begin( MSG_ONE, gmsgBartimer, {0,0,0}, id ) 
			write_byte( 0 ) 
			write_byte( 0 ) 
			message_end() 
			casting[id]=0
			call_cast(id)
		}
		else if(casting[id]==0)
		{
			new Float: time_delay = 5.0-(player_intelligence[id]/1250.0)
			
			if(player_class[id] == Ninja) time_delay*=2.0
			else if(player_class[id] == Mag)
			{            
                                time_delay=time_delay = 4.0-(player_intelligence[id]/2500.0)
                                if(player_b_fireball[id]>0) time_delay=random_float(0.5,4.0-(player_intelligence[id]/1250.0))
                                if(player_a_fireball[id]>0) time_delay=random_float(0.5,4.0-(player_intelligence[id]/1250.0))
			}
			else if(player_class[id] == Zabojca) time_delay*=2.0
				else if(player_class[id] == Paladyn) time_delay*=1.4
				
			cast_end[id]=halflife_time()+time_delay
			
			new bar_delay = floatround(time_delay,floatround_ceil)
			
			casting[id]=1
			
			message_begin( MSG_ONE, gmsgBartimer, {0,0,0}, id ) 
			if(player_class[id] == Zombie || player_class[id] == Master || loaded[id])
				write_byte( 0 ) 
			else
				write_byte( bar_delay ) 
			write_byte( 0 ) 
			message_end() 
		}
	}
	else 
	{	
		if(casting[id]==1)
		{
			message_begin( MSG_ONE, gmsgBartimer, {0,0,0}, id ) 
			write_byte( 0 ) 
			write_byte( 0 ) 
			message_end() 	
		}
		casting[id]=0			
	}
	
	
	if (pev(id,pev_button) & IN_USE && !casting[id])	Use_Spell(id)
	
	if(player_class[id]== Ninja && (pev(id,pev_button) & IN_RELOAD)) command_knife(id) 
	else if (pev(id,pev_button) & IN_RELOAD && on_knife[id] && max_knife[id]>0) command_knife(id)

	if(player_class[id] == Duriel && (pev(id,pev_button) & IN_RELOAD)) command_knife(id) 
	else if (pev(id,pev_button) & IN_RELOAD && on_knife[id] && max_knife[id]>0) command_knife(id)		
	
	///////////////////// BOW /////////////////////////
	if(player_class[id]==Hunter || player_class[id]==Legionista)
	{
		
		
		if(bow[id] == 1)
		{
			if((bowdelay[id] + 4.75 - float(player_intelligence[id]/75))< get_gametime() && button2 & IN_ATTACK)
			{
				bowdelay[id] = get_gametime()
				command_arrow(id) 
			}
			entity_set_int(id, EV_INT_button, (button2 & ~IN_ATTACK) & ~IN_ATTACK2)
		}
		
		
	}
	if(player_class[id]==Elf)
	{
		
		
		if(bow[id] == 1)
		{
			if((bowdelay[id] + 4.75 - float(player_intelligence[id]/75))< get_gametime() && button2 & IN_ATTACK)
			{
				bowdelay[id] = get_gametime()
				command_arrow1(id) 
			}
			entity_set_int(id, EV_INT_button, (button2 & ~IN_ATTACK) & ~IN_ATTACK2)
		}
		
		
	}
	if(player_class[id]==Killer)
	{
		if(czolg[id] == 1)
		{
			if((czolgdelay[id] + 8.0 - float(player_intelligence[id]/20))< get_gametime() && button2 & IN_ATTACK)
			{
				new rd2 = floatround(8.0 - float(player_intelligence[id]/20), floatround_ceil) 
				message_begin( MSG_ONE, gmsgBartimer, {0,0,0}, id ) 
				write_byte( rd2 ) 
				write_byte( 0 ) 
				message_end() 
				czolgdelay[id] = get_gametime()
				command_czolg1(id) 
				wybuch(id)
				
			}
			entity_set_int(id, EV_INT_button, (button2 & ~IN_ATTACK) & ~IN_ATTACK2)
			
		}
	}
	if(player_class[id]==Zombie)
	{
		if((bowdelay[id] + 3.70)< get_gametime() && makul[id])
		{
			if(button2 & IN_ATTACK)
			{
				if(!ent[id]) {
					command_kula1(id)
					bowdelay[id] = get_gametime()-3.4
				}
				else {
					wybuch(id)
					bowdelay[id] = get_gametime()
					message_begin( MSG_ONE, gmsgBartimer, {0,0,0}, id ) 
					write_byte( 3 ) 
					write_byte( 0 ) 
					message_end() 
				}
				
			}
			else if(button2 & IN_ATTACK2 && !ent[id])
			{
				bowdelay[id] = get_gametime()-3.25
				if(mod_k[id] == 0)mod_k[id] = 1
				else if(mod_k[id] == 1)mod_k[id] = 0
					
				
				client_print(id,print_center,"Tryb %s",mod_k[id]?"Rakiety":"Odbijania")
			}
		}
		
		
	}
	// nade
	
	if(g_GrenadeTrap[id] && button2 & IN_ATTACK2)
	{
		switch(weapon)
		{
			case CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE:
			{
				if((g_PreThinkDelay[id] + 0.28) < get_gametime())
				{
					switch(g_TrapMode[id])
					{
						case 0: g_TrapMode[id] = 1
							case 1: g_TrapMode[id] = 0
						}
					client_print(id, print_center, "Grenade Trap %s", g_TrapMode[id] ? "[ON]" : "[OFF]")
					g_PreThinkDelay[id] = get_gametime()
				}
			}
			default: g_TrapMode[id] = 0
		}
	}
	return PLUGIN_CONTINUE	
}

Za pomoc daje ++++ 


  • +
  • -
  • 0

"Wojownik nie umiera lekko. Śmierć, by go dopaść, musi stoczyć z nim walkę. A wojownik łatwo śmierci nie ulega."

 

Carlos Castaneda, The Wheel of Time

 

 

Mam na sprzedaż unikatowy system questów, nową walutę oraz rangi na cod moda. Zainteresowanych zapraszam na pw, GG lub Steam.


#2 vaulT

    Profesjonalista

  • Zbanowany

Reputacja: 57
Pomocny

  • Postów:164
  • Lokalizacja:-*-
Offline

Napisano 25.12.2013 13:17   Najlepsza odpowiedź

Jezeli nadal bedzie za dluga to sobie ja skroc tak samo jak na moim przykladzie

	
	new pc = player_class[id];
	
	if(get_entity_flags(id) & FL_ONGROUND && (!(button2 & (IN_FORWARD+IN_BACK+IN_MOVELEFT+IN_MOVERIGHT)) || (pc == Mag && player_b_fireball[id]==0 || player_a_fireball[id]==0)) && is_user_alive(id) && !bow[id] && (on_knife[id] || (pc == Mag && player_b_fireball[id] || player_a_fireball[id])) && pc!=NONE && pc!=Nekromanta && invisible_cast[id]==0 || pc== NONE && pc!=NONE && pc!= Killer && invisible_cast[id]==0)







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

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