←  Pytania

AMXX.pl: Support AMX Mod X i SourceMod

»

Odpornosc na HE

Zablokowany

  • +
  • -
Monsulito - zdjęcie Monsulito 23.12.2010

Witam zrobiłem taki kod, odpornosc na HE.
Ale mam błedy
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 1352
Warning: Loose indentation on line 1390
Warning: Loose indentation on line 2345
Warning: Loose indentation on line 2396
Warning: Loose indentation on line 3087
Warning: Loose indentation on line 3093
Error: Array must be indexed (variable "player_item_name") on line 3813
Error: Empty statement on line 3813
Error: Array must be indexed (variable "player_item_name") on line 3920
Error: Invalid string (possibly non-terminated string) on line 4047
Warning: Loose indentation on line 4885
Warning: Loose indentation on line 4892
Warning: Loose indentation on line 4894
Warning: Loose indentation on line 5074
Warning: Loose indentation on line 5091
Warning: Loose indentation on line 5344
Warning: Loose indentation on line 5345
Warning: Loose indentation on line 5933
Warning: Loose indentation on line 7998
Warning: Loose indentation on line 8004
Warning: Loose indentation on line 8109
Warning: Loose indentation on line 8597

4 Errors.
Could not locate output file C:\Documents and Settings\user\Pulpit\dbmod_1.0.amx (compile failed).

KOD ::
public add_grenade_bonus(id,attacker_id,weapon)
{
if (player_b_grenade[attacker_id] > 0 && weapon == CSW_HEGRENADE && player_b_fireshield[id] == 0 && player_item_name[id] != "M'avina's Battle Hymn" && player_item_name[id] != "Cow King's Leathers" && player_item_name[id] != "Sługa inferno"); //Fireshield check
{
new roll = random_num(1,player_b_grenade[attacker_id])
if (roll == 1)
{
set_user_health(id, 0)
message_begin( MSG_ALL, gmsgDeathMsg,{0,0,0},0)
write_byte(attacker_id)
write_byte(id)
write_byte(0)
write_string("grenade")
message_end()
set_user_frags(attacker_id, get_user_frags(attacker_id)+1)
set_user_frags(id, get_user_frags(id)+1)
cs_set_user_money(attacker_id, cs_get_user_money(attacker_id)+150)
}
}
}
Odpowiedz

FreZZy - zdjęcie FreZZy 23.12.2010

bez sensu...

zrób zmienną odpornosche na przyklad, dodaj jej opis, dodaj jej tracenie przy wpisaniu /drop i w tym kodzie co podales jak jest więkza niż 0 to ochrania przed HE 1/x
Odpowiedz

  • +
  • -
Monsulito - zdjęcie Monsulito 24.12.2010

tzn moglbys pomoc bardziej?? Kodzik czy naprowadzic bardziej

Dodano 24 grudzień 2010 - 02:26:
Mam naprzyklad tak samo z explode
public add_bonus_explode(id)
{
if (player_b_explode[id] > 0)
{

new origin[3]
get_user_origin(id,origin)
explode(origin,id,0)


for(new a = 0; a < MAX; a++)
{
if (!is_user_connected(a) || !is_user_alive(a) || player_b_fireshield[a] != 0 || get_user_team(a) == get_user_team(id) || player_item_name[a] == "M'avina's Battle Hymn" || player_item_name[a] == "Cow King's Leathers" || player_item_name[a] == "Sługa inferno")
continue

new origin1[3]
get_user_origin(a,origin1)

if(get_distance(origin,origin1) < player_b_explode[id] + player_intelligence[id]*2)
{
new dam = 100
if(dam<1) dam=1
change_health(a,-dam,id,"grenade")
Display_Fade(id,2600,2600,0,255,0,0,15)
}
}
}
}
Odpowiedz

  • +
  • -
DarkGL - zdjęcie DarkGL 24.12.2010

player_item_name[id] != "M'avina's Battle Hymn"
na
!equal(player_item_name[id],"M'avina's Battle Hymn")
podobnie z tymi dwoma pozostałymi
Odpowiedz

FreZZy - zdjęcie FreZZy 24.12.2010

jeżeli już to: player_item_id[id]==XX

Ale lepiej zrobić tak:

deklaracja nowej zmiennej
new player_b_anttyhe[33]


w public reset_item_skills(id)
player_b_antyhe[id] = 0


potem
public add_grenade_bonus(id,attacker_id,weapon)
{
if (player_b_grenade[attacker_id] > 0 && weapon == CSW_HEGRENADE && player_b_fireshield[id] == 0 && player_b_antyhe[id] == 0); //Fireshield check
{
new roll = random_num(1,player_b_grenade[attacker_id])
if (roll == 1)
{
set_user_health(id, 0)
message_begin( MSG_ALL, gmsgDeathMsg,{0,0,0},0)
write_byte(attacker_id)
write_byte(id)
write_byte(0)
write_string("grenade")
message_end()
set_user_frags(attacker_id, get_user_frags(attacker_id)+1)
set_user_frags(id, get_user_frags(id)+1)
cs_set_user_money(attacker_id, cs_get_user_money(attacker_id)+150)
}
}
}


W public iteminfo(id) na samym dole

if (player_b_antyhe[id] > 0)
{
add(itemEffect, 199, "Nie działa na Ciebie natychmiastowe zabicie z granatu HE")
}


a teraz kolejny case:

case XX:
{
player_item_name[id] = "YYY"
player_item_id[id] = rannum
player_b_antyhe[id] = 1
show_hudmessage(id, "Znalazles przedmiot: %s : Jesteś odporny na HE 1/x", player_item_name[id])
}

Użytkownik FreZZy edytował ten post 24.12.2010 09:40
Odpowiedz

  • +
  • -
Monsulito - zdjęcie Monsulito 24.12.2010

dzięki obydwoje +
Odpowiedz
Zablokowany