Nie mogę ustawić granatów tylko dla jednej...
MiroX
13.01.2015
Witam.
Chce przerobić trochę plugin od PB, żeby za zabicie kogoś w CT dawało 1 he i defuser, a w TT dawało 1 he i 1 flash. Nie wiem czemu, ale mi cały czas daje w TT dobrze, a w CT wszystko czyli 1 he, 1 flash i defuser, a chce bez flasha. Proszę o pomoc.
Attached Files
grankee
13.01.2015
public player_weapons(id) if (is_user_alive(id)) { set_pdata_int(id, 386, 120, 5); fm_give_item(id, "weapon_knife"); if (get_user_team(id) == 1 && get_pcvar_num(pbglock)) fm_give_item(id, "weapon_glock18"); else if (get_pcvar_num(pbusp)) { set_pdata_int(id, 382, 48, 5); fm_give_item(id, "weapon_usp"); } if (get_pcvar_num(pbgun)) fm_give_item(id, "weapon_mp5navy"); if (get_pcvar_num(pbnade)) {//w tym miejscu g_has_kill = 1, gracz jest w CT, oto co się dzieje: if ((get_user_team(id) == 1) && get_pcvar_num(gnade) == 1 || g_has_kill[id] == 1)//jest w CT, cvar jest 1, g_has_kill =1, wchodzi do środka, bo wystarczy, ze g_has_kill jest 1 (uzyles || ) daje he oraz fb { fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "weapon_flashbang"); } } if (get_pcvar_num(pbdef)) { if ((get_user_team(id) == 2) && get_pcvar_num(pbdef1) == 1 || g_has_kill[id] == 1)//tutaj nadal g_has_kill = 1 więc znowu cała reszta warunku jest nieistotna { fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "item_thighpack"); g_has_kill[id] = 0; } } remove_task(id); }
Chociaż nie wnikałem do czego ta zmienna g_has_kill to na moje ta część powinna wyglądać tak:
if (get_pcvar_num(pbnade)) { if ((get_user_team(id) == 1) && get_pcvar_num(gnade) == 1 && g_has_kill[id] == 1) { fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "weapon_flashbang"); //tu zapomniałeś g_has_kill ustawić na 0 tak jak niżej g_has_kill[id] = 0; } } if (get_pcvar_num(pbdef)) { if ((get_user_team(id) == 2) && get_pcvar_num(pbdef1) == 1 && g_has_kill[id] == 1) { fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "item_thighpack"); g_has_kill[id] = 0; } }
MiroX
13.01.2015
Jeżeli dobrze pamiętam i jak wpisywałem tak jak ty to wtedy mi defa nie dawało. Na 99% jestem pewny, że tak było. Byłbym wdzięczny jak by ktoś mógł sprawdzić samemu czy mówię dobrze czy plugin dobrze działa i żeby napisał, ponieważ nie jestem w stanie w tej chwili tego sprawdzić.
grankee
13.01.2015
Też nie jestem w stanie, jestem na urlopie, mam tylko notatnik, brak komplitora i gry. Ja z kolei jestem na 99% pewny, że jak zrobić tak jak opisałem to zadziała jak należy.
MiroX
17.01.2015
public player_weapons(id) if (is_user_alive(id)) { set_pdata_int(id, 386, 120, 5); fm_give_item(id, "weapon_knife"); if (get_user_team(id) == 1 && get_pcvar_num(pbglock)) fm_give_item(id, "weapon_glock18"); else if (get_pcvar_num(pbusp)) { set_pdata_int(id, 382, 48, 5); fm_give_item(id, "weapon_usp"); } if (get_pcvar_num(pbgun)) fm_give_item(id, "weapon_mp5navy"); if (get_pcvar_num(pbnade)) { if (get_user_team(id) == 1 && get_pcvar_num(gnade) == 1 || g_has_kill[id] == 1) { fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "weapon_flashbang"); g_has_kill[id] = 0; } } if (get_pcvar_num(pbdef)) { if (get_user_team(id) == 2 && get_pcvar_num(pbdef1) == 1 || g_has_kill[id] == 1) { fm_give_item(id, "weapon_hegrenade"); fm_give_item(id, "item_thighpack"); g_has_kill[id] = 0; } } remove_task(id); }
Jak jest tak to daje w TT jak powinno ale w CT jak kogoś zabije to daje flash, he i def.
Ale zauważyłem, że jak w CT nikogo nie zabije to wtedy mam tylko defa i he.