public CmdStart, odrodzenie, poczatekrundy, nowarunda:
Spoiler
public CmdStart(id, uc_handle)
{
if(!is_user_alive(id))
return FMRES_IGNORED;
if(zatrzymaj_czas && zatrzymaj_czas != id)
{
entity_set_vector(id, EV_VEC_velocity, Float:{0.0, 0.0, 0.0});
entity_set_vector(id, EV_VEC_v_angle, Float:{0.0, 0.0, 0.0});
entity_set_vector(id, EV_VEC_angles, Float:{0.0, 0.0, 0.0});
entity_set_int(id, EV_INT_fixangle, 1);
set_pdata_float(id, 83, 0.1, 5);
set_uc(uc_handle, UC_Buttons, 0);
new name[55];
get_user_name(zatrzymaj_czas, name, 54);
client_print(id, print_center, "%s zatrzymal czas swym itemem na 3sec.", name);
}
new button = get_uc(uc_handle, UC_Buttons);
new oldbutton = get_user_oldbutton(id);
new flags = get_entity_flags(id);
if(informacje_przedmiotu_gracza[id][0] == 11 || klasa_gracza[id] == Rambo)
{
if((button & IN_JUMP) && !(flags & FL_ONGROUND) && !(oldbutton & IN_JUMP) && ilosc_skokow_gracza[id] > 0)
{
ilosc_skokow_gracza[id]--;
new Float:velocity[3];
entity_get_vector(id,EV_VEC_velocity,velocity);
velocity[2] = random_float(265.0,285.0);
entity_set_vector(id,EV_VEC_velocity,velocity);
}
else if(flags & FL_ONGROUND)
{
ilosc_skokow_gracza[id] = 0;
if(informacje_przedmiotu_gracza[id][0] == 11)
ilosc_skokow_gracza[id]++;
if(klasa_gracza[id] == Rambo)
ilosc_skokow_gracza[id]++;
}
}
if(informacje_przedmiotu_gracza[id][0] == 48)
{
if(button & IN_DUCK)
set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 1);
else
set_rendering(id,kRenderFxGlowShell,0,0,0 ,kRenderTransAlpha, 255);
}
if(button & IN_ATTACK2 && !(pev(id, pev_oldbuttons) & IN_ATTACK2) && informacje_przedmiotu_gracza[id][0] == 63)
{
new szClip, szAmmo
new WeapID = get_user_weapon( id, szClip, szAmmo )
if(WeapID != CSW_KNIFE && WeapID != CSW_C4 && WeapID != CSW_AWP && WeapID != CSW_SCOUT && WeapID != CSW_SG550 && WeapID != CSW_G3SG1 && !hasZoom[id])
{
hasZoom[id] = true;
cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 1);
emit_sound(id, CHAN_ITEM, "weapons/zoom.wav", 0.20, 2.40, 0, 100);
}
else if (hasZoom[id])
{
hasZoom[id] = false;
cs_set_user_zoom(id, CS_RESET_ZOOM, 0);
}
}
if(button & IN_ATTACK)
{
new Float:punchangle[3];
if(informacje_przedmiotu_gracza[id][0] == 20)
entity_set_vector(id, EV_VEC_punchangle, punchangle);
if(informacje_przedmiotu_gracza[id][0] == 23)
{
entity_get_vector(id, EV_VEC_punchangle, punchangle);
for(new i=0; i<3;i++)
punchangle[i]*=0.9;
entity_set_vector(id, EV_VEC_punchangle, punchangle);
}
if(informacje_przedmiotu_gracza[id][0] == 70)
{
entity_get_vector(id, EV_VEC_punchangle, punchangle);
for(new i=0; i<3;i++)
punchangle[i]*=1.1;
entity_set_vector(id, EV_VEC_punchangle, punchangle);
}
}
if(informacje_przedmiotu_gracza[id][0] == 28 && button & IN_JUMP && button & IN_DUCK && flags & FL_ONGROUND && get_gametime() > informacje_przedmiotu_gracza[id][1]+4.0)
{
informacje_przedmiotu_gracza[id][1] = floatround(get_gametime());
new Float:velocity[3];
VelocityByAim(id, 700, velocity);
velocity[2] = random_float(265.0,285.0);
entity_set_vector(id, EV_VEC_velocity, velocity);
}
{
new Float: velocity[3];
entity_get_vector(id, EV_VEC_velocity, velocity);
new Float: speed = floatsqroot(velocity[0]*velocity[0]+velocity[1]*velocity[1]+velocity[2]*velocity[2]);
if(szybkosc_gracza[id] > speed*1.8)
entity_set_int(id, EV_INT_flTimeStepSound, 300);
}
new clip, ammo, weapon = get_user_weapon(id, clip, ammo);
if(maxClip[weapon] == -1 || !ammo)
return FMRES_IGNORED;
if(informacje_przedmiotu_gracza[id][0] == 77 && ((button & IN_RELOAD && !(oldbutton & IN_RELOAD) && !(button & IN_ATTACK)) || !clip))
{
cs_set_user_bpammo(id, weapon, ammo-(maxClip[weapon]-clip));
new new_ammo = min(clip+ammo, maxClip[weapon]);
set_user_clip(id, new_ammo);
}
return FMRES_IGNORED;
}
public Odrodzenie(id)
{
if(!is_user_alive(id) || !is_user_connected(id))
return PLUGIN_CONTINUE;
if(nowa_klasa_gracza[id])
{
klasa_gracza[id] = nowa_klasa_gracza[id];
nowa_klasa_gracza[id] = 0;
cod_add_wskrzes(id, 0)
fm_strip_user_weapons(id);
fm_give_item(id, "weapon_knife");
switch(get_user_team(id))
{
case 1: fm_give_item(id, "weapon_glock18");
case 2:
{
fm_give_item(id, "weapon_usp");
fm_give_item(id, "item_thighpack") ;
}
}
WczytajDane(id, klasa_gracza[id]);
}
if(!klasa_gracza[id])
{
WybierzKlase(id);
return PLUGIN_CONTINUE;
}
switch(klasa_gracza[id])
{
case Snajper:
{
fm_give_item(id, "weapon_awp");
fm_give_item(id, "weapon_deagle");
fm_give_item(id, "weapon_scout");
}
case Komandos:
fm_give_item(id, "weapon_deagle");
case Strzelec:
{
fm_give_item(id, "weapon_m4a1");
fm_give_item(id, "weapon_ak47");
}
case Obronca:
fm_give_item(id, "weapon_m249");
case Policjant:
{
fm_give_item(id, "weapon_mp5navy");
fm_give_item(id, "weapon_hegrenade");
fm_give_item(id, "weapon_flashbang");
fm_give_item(id, "weapon_smokegrenade");
}
case Wsparcie:
{
fm_give_item(id, "weapon_mp5navy");
ilosc_rakiet_gracza[id] = 2;
}
case Saper:
{
fm_give_item(id, "weapon_p90");
ilosc_min_gracza[id] += 3;
fm_give_item(id, "item_thighpack")
}
case Demolitions:
{
fm_give_item(id, "weapon_aug");
fm_give_item(id, "weapon_hegrenade");
fm_give_item(id, "weapon_flashbang");
fm_give_item(id, "weapon_smokegrenade");
}
case Rusher:
fm_give_item(id, "weapon_m3");
case Rambo:
{
fm_give_item(id, "weapon_m4a1");
fm_give_item(id, "weapon_hegrenade");
ilosc_rakiet_gracza[id] = 2;
}
case Partyzant:
{
fm_give_item(id, "weapon_p90");
fm_give_item(id, "weapon_flashbang");
fm_set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 70);
}
case Szpieg:
{
fm_give_item(id, "weapon_deagle");
ZmienUbranie(id, 0);
}
case Szturmowiec:
{
fm_give_item(id, "weapon_m4a1");
fm_give_item(id, "weapon_deagle");
fm_give_item(id, "weapon_hegrenade");
}
case StrzelecWsparcia:
fm_give_item(id, "weapon_m4a1");
case LekkiZolnierz:
{
fm_give_item(id, "weapon_galil");
fm_give_item(id, "weapon_p228");
}
case Rebeliant:
{
fm_give_item(id, "weapon_sg552");
fm_give_item(id, "weapon_hegrenade");
}
case Ninja:
fm_give_item(id, "weapon_ak47");
case Terminator:
{
fm_give_item(id, "weapon_deagle");
fm_give_item(id, "weapon_ak47");
fm_give_item(id, "weapon_hegrenade");
}
case Wojak:
{
fm_give_item(id, "weapon_ak47");
fm_give_item(id, "weapon_deagle");
fm_give_item(id, "weapon_hegrenade");
fm_give_item(id, "weapon_flashbang");
fm_give_item(id, "weapon_smokegrenade");
}
case Samuraj:
fm_give_item(id, "weapon_galil");
case WolnyStrzelec:
{
fm_give_item(id, "weapon_m4a1");
fm_give_item(id, "weapon_ak47");
ZmienUbranie(id, 0);
}
case Kapitan:
{
fm_give_item(id, "weapon_m4a1");
fm_give_item(id, "weapon_awp");
fm_give_item(id, "weapon_hegrenade");
}
case Proflekarz:
{
fm_give_item(id, "weapon_mp5navy");
fm_give_item(id, "weapon_deagle");
ilosc_apteczek_gracza[id] = 4;
cod_add_wskrzes(id,1)
}
}
if(!informacje_przedmiotu_gracza[id][0] && klasa_gracza[id] != Partyzant)
fm_set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransColor, 255);
if(punkty_gracza[id]>0)
set_task(10.0, "PrzydzielPunkty", id);
if(informacje_przedmiotu_gracza[id][0] == 61)
ilosc_min_gracza[id] += 5;
if(informacje_przedmiotu_gracza[id][0] == 78)
fm_set_user_gravity(id, 0.5);
if(informacje_przedmiotu_gracza[id][0] == 62)
fm_give_item(id, "weapon_galil");
if(informacje_przedmiotu_gracza[id][0] == 10 || informacje_przedmiotu_gracza[id][0] == 9 || informacje_przedmiotu_gracza[id][0] == 59 || informacje_przedmiotu_gracza[id][0] == 31)
fm_give_item(id, "weapon_hegrenade");
if(informacje_przedmiotu_gracza[id][0] == 56)
fm_give_item(id, "weapon_m4a1");
if(informacje_przedmiotu_gracza[id][0] == 57)
fm_give_item(id, "weapon_ak47");
if(informacje_przedmiotu_gracza[id][0] == 89)
{
itemo[id]++
if(itemo[id] > 1)
UsunPrzedmiot(id);
}
if(informacje_przedmiotu_gracza[id][0] == 9 || informacje_przedmiotu_gracza[id][0] == 31 || informacje_przedmiotu_gracza[id][0] == 55 || informacje_przedmiotu_gracza[id][0] == 67)
ZmienUbranie(id, 0);
if(informacje_przedmiotu_gracza[id][0] == 67)
{
fm_give_item(id, "weapon_usp");
fm_give_item(id, "weapon_mp5navy");
}
if(informacje_przedmiotu_gracza[id][0] == 1 || informacje_przedmiotu_gracza[id][0] == 32 || informacje_przedmiotu_gracza[id][0] == 42 || informacje_przedmiotu_gracza[id][0] == 50 || informacje_przedmiotu_gracza[id][0] == 54 || informacje_przedmiotu_gracza[id][0] == 58 || informacje_przedmiotu_gracza[id][0] == 59)
fm_set_user_footsteps(id, 1);
else
fm_set_user_footsteps(id, 0);
if(informacje_przedmiotu_gracza[id][0] == 13)
fm_give_item(id, "weapon_awp");
if(informacje_przedmiotu_gracza[id][0] == 33)
fm_give_item(id, "weapon_m4a1");
if(informacje_przedmiotu_gracza[id][0] == 32)
{
fm_give_item(id, "weapon_ak47");
fm_give_item(id, "weapon_awp");
}
if(informacje_przedmiotu_gracza[id][0] == 53)
{
fm_give_item(id, "weapon_deagle");
fm_give_item(id, "weapon_awp");
}
if(informacje_przedmiotu_gracza[id][0] == 33)
fm_give_item(id, "weapon_m4a1");
if(informacje_przedmiotu_gracza[id][0] == 34)
fm_give_item(id, "weapon_deagle");
if(informacje_przedmiotu_gracza[id][0] == 35)
fm_give_item(id, "weapon_m3");
if(informacje_przedmiotu_gracza[id][0] == 55)
fm_give_item(id, "weapon_scout");
if(informacje_przedmiotu_gracza[id][0] == 60)
fm_give_item(id, "weapon_m4a1");
if(informacje_przedmiotu_gracza[id][0] == 19)
informacje_przedmiotu_gracza[id][1] = 1;
if(informacje_przedmiotu_gracza[id][0] == 84 || informacje_przedmiotu_gracza[id][0] == 75 || informacje_przedmiotu_gracza[id][0] == 76 || informacje_przedmiotu_gracza[id][0] == 45 || informacje_przedmiotu_gracza[id][0] == 87)
informacje_przedmiotu_gracza[id][1] = 1;
if(informacje_przedmiotu_gracza[id][0] == 27)
informacje_przedmiotu_gracza[id][1] = 3;
if(informacje_przedmiotu_gracza[id][0] == 38)
ilosc_apteczek_gracza[id] = 5;
if(informacje_przedmiotu_gracza[id][0] == 54)
fm_set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 1);
if(informacje_przedmiotu_gracza[id][0] == 36)
fm_set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderGlow, 30);
new weapons[32];
new weaponsnum;
get_user_weapons(id, weapons, weaponsnum);
for(new i=0; i<weaponsnum; i++)
if(is_user_alive(id))
if(maxAmmo[weapons[i]] > 0)
cs_set_user_bpammo(id, weapons[i], maxAmmo[weapons[i]]);
redukcja_obrazen_gracza[id] = (47.3057*(1.0-floatpower( 2.7182, -0.06798*float(wytrzymalosc_gracza[id])))/100);
maksymalne_zdrowie_gracza[id] = zdrowie_klasy[klasa_gracza[id]]+zdrowie_gracza[id]*2;
szybkosc_gracza[id] = (STANDARDOWA_SZYBKOSC*szybkosc_klasy[klasa_gracza[id]])+(float(kondycja_gracza[id])*1.3);
if(informacje_przedmiotu_gracza[id][0] == 82)
{
maksymalne_zdrowie_gracza[id] = 25;
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 1)
}
if(informacje_przedmiotu_gracza[id][0] == 83)
{
maksymalne_zdrowie_gracza[id] = 90;
fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 15)
}
if(informacje_przedmiotu_gracza[id][0] == 80)
{
maksymalne_zdrowie_gracza[id] += informacje_przedmiotu_gracza[id][1];
fm_give_item(id, "weapon_m3");
}
if(informacje_przedmiotu_gracza[id][0] == 70 || informacje_przedmiotu_gracza[id][0] == 50 || informacje_przedmiotu_gracza[id][0] == 71 || informacje_przedmiotu_gracza[id][0] == 37 || informacje_przedmiotu_gracza[id][0] == 42 || informacje_przedmiotu_gracza[id][0] == 18 || informacje_przedmiotu_gracza[id][0] == 30)
maksymalne_zdrowie_gracza[id] += 100;
if(informacje_przedmiotu_gracza[id][0] == 18)
szybkosc_gracza[id] -= 0.4;
if(informacje_przedmiotu_gracza[id][0] == 29)
{
maksymalne_zdrowie_gracza[id] += 50;
szybkosc_gracza[id] += 0.2;
}
if(informacje_przedmiotu_gracza[id][0] == 36)
maksymalne_zdrowie_gracza[id] = 10;
if(informacje_przedmiotu_gracza[id][0] == 39)
fm_set_user_gravity(id, 0.5);
if(informacje_przedmiotu_gracza[id][0] == 54)
fm_set_user_gravity(id, 0.8);
if(informacje_przedmiotu_gracza[id][0] == 30)
szybkosc_gracza[id] -= 20;
if(informacje_przedmiotu_gracza[id][0] == 25)
{
maksymalne_zdrowie_gracza[id] += 50;
szybkosc_gracza[id] -= 0.3;
}
if(informacje_przedmiotu_gracza[id][0] == 54)
maksymalne_zdrowie_gracza[id] = 1;
if(informacje_przedmiotu_gracza[id][0] == 50)
szybkosc_gracza[id] += 10;
if(informacje_przedmiotu_gracza[id][0] == 43)
szybkosc_gracza[id] += 20;
if(informacje_przedmiotu_gracza[id][0] == 44)
maksymalne_zdrowie_gracza[id] += 70;
if(informacje_przedmiotu_gracza[id][0] == 49)
informacje_przedmiotu_gracza[id][1] = 1;
if(informacje_przedmiotu_gracza[id][0] == 52)
informacje_przedmiotu_gracza[id][1] = 1;
if(informacje_przedmiotu_gracza[id][0] == 79)
ilosc_min_gracza[id] += 3;
if(informacje_przedmiotu_gracza[id][0] == 88)
maksymalne_zdrowie_gracza[id] *= 2;
fm_set_user_armor(id, pancerz_klasy[klasa_gracza[id]]);
fm_set_user_health(id, maksymalne_zdrowie_gracza[id]);
if(informacje_przedmiotu_gracza[id][0] == 17)
fm_set_user_armor(id, 500);
if(informacje_przedmiotu_gracza[id][0] == 46)
fm_set_user_armor(id, 500);
if(informacje_przedmiotu_gracza[id][0] == 64)
cs_set_user_money(id,16000);
return PLUGIN_CONTINUE;
}
public PoczatekRundy()
{
freezetime = false;
for(new id=0;id<=32;id++)
{
if(!is_user_alive(id))
continue;
set_task(0.1, "UstawSzybkosc", id+ZADANIE_USTAW_SZYBKOSC);
switch(get_user_team(id))
{
case 1: client_cmd(id, "spk QTM_CodMod/start");
case 2: client_cmd(id, "spk QTM_CodMod/start2");
}
}
round++;
new players[32], player, pnum;
get_players(players, pnum, "a");
for(new i = 0; i < pnum; i++)
{
player = players[i];
if(is_user_connected(player) && get_user_flags(player) & ADMIN_LEVEL_H)
{
if(!get_pcvar_num(g_menu_active))
return PLUGIN_CONTINUE
if(!is_user_hltv(player) && !is_user_bot(player))
{
fm_give_item(player, "weapon_hegrenade");
fm_give_item(player, "weapon_flashbang");
fm_give_item(player, "weapon_flashbang");
fm_give_item(player, "weapon_smokegrenade");
fm_give_item(player, "item_assaultsuit");
fm_give_item(player, "item_thighpack");
}
if(round > 3) Showrod(player)
}
}
return PLUGIN_HANDLED;
}
public NowaRunda()
{
freezetime = true;
new iEnt = find_ent_by_class(-1, "Mine");
while(iEnt > 0)
{
remove_entity(iEnt);
iEnt = find_ent_by_class(iEnt, "Mine");
}
new iEnts = find_ent_by_class(-1, "Rocket");
while(iEnts > 0)
{
remove_entity(iEnts);
iEnts = find_ent_by_class(iEnts, "Rocket");
}
}
public wybierzklase,wybierzfrakcje, WybierzKlase_Handle, Wybierzfrakcje_Handle
Spoiler
public WybierzKlase(id)
{
new menu = menu_create("Wybierz frakcje:", "Wybierzfrakcje_Handle");
for(new i = 1;i<sizeof(frakcje);i++){
menu_additem(menu, frakcje[i]);
}
menu_display(id, menu);
}
public Wybierzfrakcje_Handle(id, menu2, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu2);
return PLUGIN_CONTINUE;
}
item++;
frakcja_gracza[id] = item;
new menu = menu_create("Wybierz klase:", "WybierzKlase_Handle");
new klasa[50];
for(new i=1; i<sizeof nazwy_klas; i++)
{
if(nalezy_do[i] == item){
WczytajDane(id, i);
format(klasa, 49, "%s \yPoziom: %i", nazwy_klas[i], poziom_gracza[id]);
menu_additem(menu, klasa);
}
}
WczytajDane(id, klasa_gracza[id]);
menu_setprop(menu, MPROP_EXITNAME, "Wyjdz");
menu_setprop(menu, MPROP_BACKNAME, "Poprzednia strona");
menu_setprop(menu, MPROP_NEXTNAME, "Nastepna strona");
menu_display(id, menu);
client_cmd(id, "spk QTM_CodMod/select");
#if defined BOTY
if(is_user_bot2(id))
WybierzKlase_Handle(id, menu, random(sizeof nazwy_klas-1));
#endif
return PLUGIN_CONTINUE;
}
public WybierzKlase_Handle(id, menu, item)
{
client_cmd(id, "spk QTM_CodMod/select");
if(item == MENU_EXIT)
{
menu_destroy(menu);
return PLUGIN_CONTINUE;
}
item++;
new ile = 0;
for(new i=1; i<sizeof nazwy_klas; i++)
{
if(nalezy_do[i] == frakcja_gracza[id]){
ile++;
}
if(ile == item){
item = i;
break;
}
}
if(item == klasa_gracza[id])
return PLUGIN_CONTINUE;
if((item == Rambo )&& !(get_user_flags(id) & ADMIN_LEVEL_G))
{
ColorChat(id, RED, "[Call of Duty] ^x04 Nie masz uprawnien aby kozystac z klasy premium.");
WybierzKlase(id);
return PLUGIN_CONTINUE;
}
if((item == Terminator )&& !(get_user_flags(id) & ADMIN_LEVEL_F))
{
ColorChat(id, RED, "[Call of Duty] ^x04 Nie masz uprawnien aby kozystac z klasy premium.");
WybierzKlase(id);
return PLUGIN_CONTINUE;
}
if((item == WolnyStrzelec )&& !(get_user_flags(id) & ADMIN_LEVEL_E))
{
ColorChat(id, RED, "[Call of Duty] ^x04 Nie masz uprawnien aby kozystac z klasy premium.");
WybierzKlase(id);
return PLUGIN_CONTINUE;
}
if((item == Kapitan)&& !(get_user_flags(id) & ADMIN_LEVEL_D))
{
ColorChat(id, RED, "[Call of Duty] ^x04 Nie masz uprawnien aby kozystac z klasy premium.");
WybierzKlase(id);
return PLUGIN_CONTINUE;
}
if(klasa_gracza[id] == Komandos)
{
nowa_klasa_gracza[id] = item;
ColorChat(id, RED, "[Call of Duty] ^x04 Klasa zostanie zmieniona w nastepnej rundzie.");
}
else
{
klasa_gracza[id] = item;
WczytajDane(id, klasa_gracza[id]);
if(is_user_alive(id)) Odrodzenie(id);
}
return PLUGIN_CONTINUE;
}