Czyli chyba tak:
public add_bonus_blind(id,attacker_id,weapon,damage)
{
if (player_b_blind[attacker_id] > 0 && weapon != 4)
{
if (random_num(1,player_b_blind[attacker_id]) == 1) Display_Fade(id,1<<14,1<<14 ,1<<16,255,155,50,230)
}
if (c_blind[attacker_id] > 0 && weapon != 4)
{
if (random_num(1,c_blind[attacker_id]) == 1) Display_Fade(id,1<<14,1<<14 ,1<<16,255,155,50,230)
}
}
Ok, kompiluje się. Czy na każdą moc z public add_bonus moge tak zrobic?
A jak zrobić, aby Nekromanta za wskrzeszenie dostawał więcej hp+jakąś broń?
12 marzec 2010 - 18:46:Chciałem zrobić, aby klasa miała 20% szans na kradzież i zrobiłem tak:
/* ==================================================================================================== */
public add_theif_bonus(id,attacker_id)
{
if (player_b_theif[attacker_id] > 0)
{
new roll1 = random_num(1,5)
if (roll1 == 1)
{
if (cs_get_user_money(id) > player_b_theif[attacker_id])
{
cs_set_user_money(id,cs_get_user_money(id)-player_b_theif[attacker_id])
if (cs_get_user_money(attacker_id) + player_b_theif[attacker_id] <= 16000)
{
cs_set_user_money(attacker_id,cs_get_user_money(attacker_id)+player_b_theif[attacker_id])
}
}
else
{
new allthatsleft = cs_get_user_money(id)
cs_set_user_money(id,0)
if (cs_get_user_money(attacker_id) + allthatsleft <= 16000)
{
cs_set_user_money(attacker_id,cs_get_user_money(attacker_id) + allthatsleft)
}
}
}
}
if (c_theif[attacker_id] > 0)
{
new roll1 = random_num(1,5)
if (roll1 == 1)
{
if (cs_get_user_money(id) > c_theif[attacker_id])
{
cs_set_user_money(id,cs_get_user_money(id)-c_theif[attacker_id])
if (cs_get_user_money(attacker_id) + c_theif[attacker_id] <= 16000)
{
cs_set_user_money(attacker_id,cs_get_user_money(attacker_id)+c_theif[attacker_id])
}
}
else
{
new allthatsleft = cs_get_user_money(id)
cs_set_user_money(id,0)
if (cs_get_user_money(attacker_id) + allthatsleft <= 16000)
{
cs_set_user_money(attacker_id,cs_get_user_money(attacker_id) + allthatsleft)
}
}
}
}
}
/* ==================================================================================================== */
Na górze dodałem:
new c_theif[33]
Nad Switch()
c_theif[id] = 0
I w menu wyboru klas:
c_theif[id] = 850
Będzie dobrze?
Użytkownik Screeaam... edytował ten post 12.03.2010 15:59