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

Przeróbka 1 klasy


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

#1 michal95nh

    Pomocny

  • Użytkownik

Reputacja: 0
Nowy

  • Postów:55
  • Lokalizacja:KRK
Offline

Napisano 19.02.2012 13:24

Witam czy mógłby mi ktoś przerobić klase stolec żeby stolec znikał co rundę,klasa była premium.
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>
#include <ColorChat>

new const g_szNazwaKlasy[] = "Stolec" ;
new const g_szOpisKlasy[] = "Masz 3 kupy" ;

new const g_iBronie = 1<<CSW_MP5NAVY;
new const g_iZdrowie = 0;
new const g_iKondycja = 5;
new const g_iInteligencja = 0;
new const g_iWytrzymalosc = 30;

new const Float:g_fHeapDamage = 30.0;
new const Float:g_fHeapRange = 300.0;

new bool:g_bMaKlase[33];
new g_iHeapNum[33];
new Float:g_fNextStink[33];

new iSpriteWhite;


public plugin_init() {
	register_plugin(g_szNazwaKlasy, "0.1", "MarWit")
	cod_register_class(g_szNazwaKlasy, g_szOpisKlasy, g_iBronie, g_iZdrowie, g_iKondycja, g_iInteligencja, g_iWytrzymalosc)
	
	register_forward(FM_Think, "fwd_HeapThink")
	RegisterHam(Ham_Killed, "info_target", "fwd_HeapDestroyed")
}

public plugin_precache()
{
	precache_model("models/QTM_CodMod/heap.mdl")
	iSpriteWhite = precache_model("sprites/white.spr");
	
	engfunc(EngFunc_PrecacheSound, "QTM_CodMod/fart.wav");
	engfunc(EngFunc_PrecacheSound, "QTM_CodMod/fart_long.wav");
}

public fwd_HeapThink(iEnt)
{
	new szClassName[64]
	pev(iEnt, pev_classname, szClassName, 63)
	
	if(!(equal(szClassName, "player_heap")))
		return;
	
	new i = -1
	new Float:fOrigin[3];
	pev(iEnt, pev_origin, fOrigin)
	
	while((i = engfunc(EngFunc_FindEntityInSphere, i, fOrigin, g_fHeapRange)) != 0)
	{
		if(!pev_valid(i) || !(pev(i, pev_flags) & ( FL_CLIENT | FL_FAKECLIENT )))
			continue;
		
		if(g_fNextStink[i] >= get_gametime())
			continue;
			
			
		ExecuteHamB(Ham_TakeDamage, i, iEnt, pev(iEnt, pev_owner), g_fHeapDamage, DMG_ACID)
		g_fNextStink[i] = get_gametime()+1.0
		
		continue;
	}
	
	set_pev(iEnt, pev_nextthink, get_gametime()+0.2)
	dllfunc(DLLFunc_Think, iEnt);
}

public fwd_HeapDestroyed(this, idattacker, shouldgibs)
{
	new szClassName[64];
	pev(this, pev_classname, szClassName, 63)
	
	if(!(equal(szClassName, "player_heap")))
		return HAM_IGNORED
		
	new Float:fOrigin[3];
	pev(this, pev_origin, fOrigin)
		
	engfunc(EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, fOrigin, 0)
	write_byte(TE_BEAMCYLINDER);
	engfunc(EngFunc_WriteCoord, fOrigin[0])
	engfunc(EngFunc_WriteCoord, fOrigin[1])
	engfunc(EngFunc_WriteCoord, fOrigin[2])
	engfunc(EngFunc_WriteCoord, fOrigin[0])
	engfunc(EngFunc_WriteCoord, fOrigin[1] + g_fHeapRange*1.8)
	engfunc(EngFunc_WriteCoord, fOrigin[2] + g_fHeapRange*1.8)	
	write_short(iSpriteWhite);
	write_byte(0);
	write_byte(0);
	write_byte(10);
	write_byte(120);
	write_byte(255);
	write_byte(123);
	write_byte(53);
	write_byte(36);
	write_byte(128);
	write_byte(0);
	message_end();
	
	new i = -1
	while((i = engfunc(EngFunc_FindEntityInSphere, i, fOrigin, g_fHeapRange*1.8)) != 0)
	{
		if(!pev_valid(i) || !(pev(i, pev_flags) & ( FL_CLIENT | FL_FAKECLIENT )))
			continue;
			
		ExecuteHamB(Ham_TakeDamage, i, this, pev(this, pev_owner), g_fHeapDamage*2.0, DMG_ACID)
		client_cmd(i, "spk QTM_CodMod/fart_long.wav")
		
		continue;
	}
	
	return HAM_IGNORED
}

public cod_class_enabled(id)
{
	g_bMaKlase[id] = true
	g_iHeapNum[id] = 3
}

public cod_class_disabled(id)
{
	g_bMaKlase[id] = false
	g_iHeapNum[id] = 0	
}

public cod_class_skill_used(id)
{
	if(!g_bMaKlase[id])
		return PLUGIN_CONTINUE
		
	if(g_iHeapNum[id] <= 0)
	{
		ColorChat(id, RED, "[%s]^x01 Nie masz wiecej kup!", g_szNazwaKlasy)
		return PLUGIN_CONTINUE
	}
	
	g_iHeapNum[id]--;
	
	new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
	set_pev(iEnt, pev_classname, "player_heap")
	
	engfunc(EngFunc_SetModel, iEnt, "models/QTM_CodMod/heap.mdl")
	engfunc(EngFunc_SetSize, iEnt, { -16.0, -16.0, 0.0 }, { 16.0, 16.0, 2.0 })
	
	set_pev(iEnt, pev_movetype, MOVETYPE_TOSS)
	set_pev(iEnt, pev_solid, SOLID_BBOX)
	set_pev(iEnt, pev_owner, id)
	set_pev(iEnt, pev_takedamage, 1.0)
	set_pev(iEnt, pev_health, 50.0)
	
	new Float:fOrigin[3];
	pev(id, pev_origin, fOrigin)
	engfunc(EngFunc_SetOrigin, iEnt, fOrigin)
	engfunc(EngFunc_DropToFloor, iEnt)
	
	g_fNextStink[id] = get_gametime()+3.0
	
	set_pev(iEnt, pev_nextthink, get_gametime()+0.2)
	dllfunc(DLLFunc_Think, iEnt);
	
	emit_sound(id, CHAN_AUTO, "QTM_CodMod/fart.wav", VOL_NORM, ATTN_NORM, ( 1<<5 ), PITCH_NORM)
	
	return PLUGIN_CONTINUE
}


  • +
  • -
  • 0

#2 fbang

    Wszechwidzący

  • Użytkownik

Reputacja: 82
Zaawansowany

  • Postów:237
  • GG:
  • Lokalizacja:Polska
Offline

Napisano 19.02.2012 22:12

Try
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <fakemeta>
#include <hamsandwich>
#include <ColorChat>
#include <engine>
new const g_szNazwaKlasy[] = "Stolec" ;
new const g_szOpisKlasy[] = "Masz 3 kupy" ;

new const g_iBronie = 1<<CSW_MP5NAVY;
new const g_iZdrowie = 0;
new const g_iKondycja = 5;
new const g_iInteligencja = 0;
new const g_iWytrzymalosc = 30;

new const Float:g_fHeapDamage = 30.0;
new const Float:g_fHeapRange = 300.0;

new bool:g_bMaKlase[33];
new g_iHeapNum[33];
new Float:g_fNextStink[33];

new iSpriteWhite;


public plugin_init() {
register_plugin(g_szNazwaKlasy, "0.1", "MarWit")
cod_register_class(g_szNazwaKlasy, g_szOpisKlasy, g_iBronie, g_iZdrowie, g_iKondycja, g_iInteligencja, g_iWytrzymalosc)
register_event("HLTV", "NowaRunda", "a", "1=0", "2=0");
register_forward(FM_Think, "fwd_HeapThink")
RegisterHam(Ham_Killed, "info_target", "fwd_HeapDestroyed")
}

public plugin_precache()
{
precache_model("models/QTM_CodMod/heap.mdl")
iSpriteWhite = precache_model("sprites/white.spr");

engfunc(EngFunc_PrecacheSound, "QTM_CodMod/fart.wav");
engfunc(EngFunc_PrecacheSound, "QTM_CodMod/fart_long.wav");
}

public fwd_HeapThink(iEnt)
{
new szClassName[64]
pev(iEnt, pev_classname, szClassName, 63)

if(!(equal(szClassName, "player_heap")))
return;

new i = -1
new Float:fOrigin[3];
pev(iEnt, pev_origin, fOrigin)

while((i = engfunc(EngFunc_FindEntityInSphere, i, fOrigin, g_fHeapRange)) != 0)
{
if(!pev_valid(i) || !(pev(i, pev_flags) & ( FL_CLIENT | FL_FAKECLIENT )))
continue;

if(g_fNextStink[i] >= get_gametime())
continue;


ExecuteHamB(Ham_TakeDamage, i, iEnt, pev(iEnt, pev_owner), g_fHeapDamage, DMG_ACID)
g_fNextStink[i] = get_gametime()+1.0

continue;
}

set_pev(iEnt, pev_nextthink, get_gametime()+0.2)
dllfunc(DLLFunc_Think, iEnt);
}

public fwd_HeapDestroyed(this, idattacker, shouldgibs)
{
new szClassName[64];
pev(this, pev_classname, szClassName, 63)

if(!(equal(szClassName, "player_heap")))
return HAM_IGNORED

new Float:fOrigin[3];
pev(this, pev_origin, fOrigin)

engfunc(EngFunc_MessageBegin, MSG_BROADCAST, SVC_TEMPENTITY, fOrigin, 0)
write_byte(TE_BEAMCYLINDER);
engfunc(EngFunc_WriteCoord, fOrigin[0])
engfunc(EngFunc_WriteCoord, fOrigin[1])
engfunc(EngFunc_WriteCoord, fOrigin[2])
engfunc(EngFunc_WriteCoord, fOrigin[0])
engfunc(EngFunc_WriteCoord, fOrigin[1] + g_fHeapRange*1.8)
engfunc(EngFunc_WriteCoord, fOrigin[2] + g_fHeapRange*1.8)
write_short(iSpriteWhite);
write_byte(0);
write_byte(0);
write_byte(10);
write_byte(120);
write_byte(255);
write_byte(123);
write_byte(53);
write_byte(36);
write_byte(128);
write_byte(0);
message_end();

new i = -1
while((i = engfunc(EngFunc_FindEntityInSphere, i, fOrigin, g_fHeapRange*1.8)) != 0)
{
if(!pev_valid(i) || !(pev(i, pev_flags) & ( FL_CLIENT | FL_FAKECLIENT )))
continue;

ExecuteHamB(Ham_TakeDamage, i, this, pev(this, pev_owner), g_fHeapDamage*2.0, DMG_ACID)
client_cmd(i, "spk QTM_CodMod/fart_long.wav")

continue;
}

return HAM_IGNORED
}

public cod_class_enabled(id)
{
ColorChat(id, RED, "^x04Klasa^x03 %s^x04 By^x01 amxx.pl", g_szNazwaKlasy); //Gdy gracz nie ma flagi wyświetli mu komunikat
if(!(get_user_flags(id) & ADMIN_LEVEL_H)) //FLAGA
{
ColorChat(id, RED, "^x03[%s]^x04 Jest^x03 klasa premium", g_szNazwaKlasy) //Znowu info ze przykładowa klasa jest PREMIUM
return COD_STOP;
}

g_bMaKlase[id] = true
g_iHeapNum[id] = 3
return COD_CONTINUE;

}

public cod_class_disabled(id)
{
g_bMaKlase[id] = false
g_iHeapNum[id] = 0
}

public cod_class_skill_used(id)
{
if(!g_bMaKlase[id])
return PLUGIN_CONTINUE

if(g_iHeapNum[id] <= 0)
{
ColorChat(id, RED, "[%s]^x01 Nie masz wiecej kup!", g_szNazwaKlasy)
return PLUGIN_CONTINUE
}

g_iHeapNum[id]--;

new iEnt = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target"))
set_pev(iEnt, pev_classname, "player_heap")

engfunc(EngFunc_SetModel, iEnt, "models/QTM_CodMod/heap.mdl")
engfunc(EngFunc_SetSize, iEnt, { -16.0, -16.0, 0.0 }, { 16.0, 16.0, 2.0 })

set_pev(iEnt, pev_movetype, MOVETYPE_TOSS)
set_pev(iEnt, pev_solid, SOLID_BBOX)
set_pev(iEnt, pev_owner, id)
set_pev(iEnt, pev_takedamage, 1.0)
set_pev(iEnt, pev_health, 50.0)

new Float:fOrigin[3];
pev(id, pev_origin, fOrigin)
engfunc(EngFunc_SetOrigin, iEnt, fOrigin)
engfunc(EngFunc_DropToFloor, iEnt)

g_fNextStink[id] = get_gametime()+3.0

set_pev(iEnt, pev_nextthink, get_gametime()+0.2)
dllfunc(DLLFunc_Think, iEnt);

emit_sound(id, CHAN_AUTO, "QTM_CodMod/fart.wav", VOL_NORM, ATTN_NORM, ( 1<<5 ), PITCH_NORM)

return PLUGIN_CONTINUE
}
public NowaRunda()
{
new ent = find_ent_by_class(-1, "player_heap");
while(ent > 0)
{
remove_entity(ent);
ent = find_ent_by_class(ent, "player_heap");
}
}

public client_disconnect(id)
{
new ent = find_ent_by_class(0, "player_heap");
while(ent > 0)
{
if(entity_get_edict(id, EV_ENT_owner) == id)
remove_entity(ent);
ent = find_ent_by_class(ent, "player_heap");
}
}

  • +
  • -
  • 0




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

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