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
 

Archner - zdjęcie

Archner

Rejestracja: 03.11.2011
Aktualnie: Nieaktywny
Poza forum Ostatnio: 05.11.2012 13:30
-----

Moje posty

W temacie: [ROZWIĄZANE] Prośba o 2 klasy

31.08.2012 15:30

Proszę 0 błędów powinno śmigać :)
#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <fakemeta>
#include <fun>

new const nazwa[] = "Rambo (Premium)";
new const opis[] = "Ma podwojny skok, 20 hp oraz pelen magazynak za kazde zabojstwo";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_FAMAS)|(1<<CSW_FLASHBANG)|(1<<CSW_DEAGLE);
new const zdrowie = 40;
new const kondycja = 20;
new const inteligencja = 10;
new const wytrzymalosc = 10;
new const maxClip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };

new skoki[33];

new ma_klase[33];

public plugin_init()

{
register_plugin(nazwa, "1.0", "amxx");

register_event("DeathMsg", "DeathMsg", "ade");

cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

register_forward(FM_CmdStart, "fwCmdStart_MultiJump");



}

public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_H))
{
client_print(id, print_chat, "[Rambo (Premium)] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}

set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 77);
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
ma_klase[id] = true;

return COD_CONTINUE;
}

public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);

}

public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;

new flags = pev(id, pev_flags);

if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id])
{
skoki[id]--;
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity,velocity);
}
else if(flags & FL_ONGROUND)
skoki[id] = 1;

return FMRES_IGNORED;
}

public DeathMsg()

{
new killer = read_data(1);
new victim = read_data(2);

if(!is_user_connected(killer))
return PLUGIN_CONTINUE;

if(ma_klase[victim] && !ma_klase[killer])
cod_set_user_xp(killer, cod_get_user_xp(killer)+10);

if(ma_klase[killer])
{
new cur_health = pev(killer, pev_health);
new Float:max_health = 100.0+cod_get_user_health(killer);
new Float:new_health = cur_health+20.0<max_health? cur_health+20.0: max_health;
set_pev(killer, pev_health, new_health);

new weapon = get_user_weapon(killer);
if(maxClip[weapon] != -1)
set_user_clip(killer, maxClip[weapon]);
}


return PLUGIN_CONTINUE;
}

stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id) {
set_pdata_int(weaponid, 51, ammo, 4);
return weaponid;
}
return 0;
}

Już jest gotowe tylko skompilować i wrzucić na serwer.

W temacie: [ROZWIĄZANE] Prośba o 2 klasy

31.08.2012 11:27

Może użyj kompilatora online
Http://www.amxx.pl/kompilator/
mi się kompiluje a jak nie działa to dam ci plik amxx.

W temacie: [ROZWIĄZANE] Prośba o 2 klasy

30.08.2012 14:12

Proszę bardzo kod sma klasy 'Rambo (Premium)"
na fladze "F" bo flagi "T" niema :D

#include <amxmodx>
#include <amxmisc>
#include <codmod>
#include <engine>
#include <fakemeta>
#include <fun>

new const nazwa[] = "Rambo (Premium)";
new const opis[] = "Brak";
new const bronie = (1<<CSW_HEGRENADE)|(1<<CSW_SMOKEGRENADE)|(1<<CSW_GALIL)|(1<<CSW_FLASHBANG)|(1<<CSW_DEAGLE);
new const zdrowie = 40;
new const kondycja = 20;
new const inteligencja = 10;
new const wytrzymalosc = 10;
new const maxClip[31] = { -1, 13, -1, 10, 1, 7, 1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20,
10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };

new skoki[33];

new ma_klase[33];

public plugin_init()
{
register_plugin(nazwa, "1.0", "archner");

cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);

register_forward(FM_CmdStart, "fwCmdStart_MultiJump");

register_event("DeathMsg", "DeathMsg", "ade");
}

public cod_class_enabled(id)
{
if(!(get_user_flags(id) & ADMIN_LEVEL_F))
{
client_print(id, print_chat, "[Rambo (Premium)] Nie masz uprawnien, aby uzywac tej klasy.")
return COD_STOP;
}

set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 55);
give_item(id, "weapon_hegrenade");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_flashbang");
give_item(id, "weapon_smokegrenade");
ma_klase[id] = true;

return COD_CONTINUE;
}

public cod_class_disabled(id)
{
set_rendering(id,kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
ma_klase[id] = false;

}

public fwCmdStart_MultiJump(id, uc_handle)
{
if(!is_user_alive(id) || !ma_klase[id])
return FMRES_IGNORED;

new flags = pev(id, pev_flags);

if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id])
{
skoki[id]--;
new Float:velocity[3];
pev(id, pev_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
set_pev(id, pev_velocity,velocity);
}
else if(flags & FL_ONGROUND)
skoki[id] = 1;

return FMRES_IGNORED;
}

public DeathMsg()
{
new killer = read_data(1);
new victim = read_data(2);

if(!is_user_connected(killer))
return PLUGIN_CONTINUE;

if(ma_klase[victim] && !ma_klase[killer])
cod_set_user_xp(killer, cod_get_user_xp(killer)+10);

if(ma_klase[killer])
{
new cur_health = pev(killer, pev_health);
new Float:max_health = 100.0+cod_get_user_health(killer);
new Float:new_health = cur_health+20.0<max_health? cur_health+20.0: max_health;
set_pev(killer, pev_health, new_health);

new weapon = get_user_weapon(killer);
if(maxClip[weapon] != -1)
set_user_clip(killer, maxClip[weapon]);
}


return PLUGIN_CONTINUE;
}

stock set_user_clip(id, ammo)
{
new weaponname[32], weaponid = -1, weapon = get_user_weapon(id, _, _);
get_weaponname(weapon, weaponname, 31);
while ((weaponid = engfunc(EngFunc_FindEntityByString, weaponid, "classname", weaponname)) != 0)
if (pev(weaponid, pev_owner) == id) {
set_pdata_int(weaponid, 51, ammo, 4);
return weaponid;
}
return 0;
}

W temacie: Paczka PaintBall by szelbi [Aktualizacja 01.11.13]

14.08.2012 07:17

Bardzo fajna paczka użyje ją na serwerze. Wielki +.