←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

Klasa nie chce się skompilować

  • +
  • -
CokiA1 - zdjęcie CokiA1 24.07.2013

Witam mam mały problem ponieważ nie mogę skompilować tej klasy 

/* Plugin generated by AMXX-Studio */
 
#include <amxmodx>
#include <codmod>
#include <hamsandwich>
 
#define DMG_BULLET (1<<1)
#define DMG_HEGRENADE (1<<24)
 
new const nazwa[] = "CyC[od 420lvl]";
 
new const opis[] = "Ma 1/1 z SCOUT'a 1/2 HE, +20dmg";
 
new const bronie    = (1<<CSW_SCOUT)|(1<<CSW_HEGRENADE)|(1<<CSW_AK47);
 
new const zdrowie = 10;
 
new const kondycja = 0;
 
new const inteligencja = 10;
 
new const wytrzymalosc = 0;
 
new g_msgHostageAdd, g_msgHostageDel;
 
new bool:ma_klase[33];
 
public plugin_init() {
 
register_plugin(nazwa, "1.0", "QTM_Peyote");
 
g_msgHostageAdd = get_user_msgid("HostagePos");
 
g_msgHostageDel = get_user_msgid("HostageK");
 
cod_register_class(nazwa, opis, bronie, zdrowie, kondycja, inteligencja, wytrzymalosc);
 
set_task (2.0,"radar_scan",_,_,_,"b");
RegisterHam(Ham_TakeDamage, "player", "TakeDamage");
 
}
 
public cod_class_enabled(id)
 
new dostepna = 420;
new level = cod_get_user_level(id);
if(level <= 420)
{
client_print(id, print_chat, "[%s]Klasa dostepna od %i poziomu.", nazwa, dostepna)
return COD_STOP;
}
 
ma_klase[id] = true;
 
public cod_class_disabled(id)
 
ma_klase[id] = false;
 
public radar_scan(id)
 
{
 
new PlayerCoords[3];
 
 
 
for (new id=1; id<=32; id++)
 
{
 
  if((!is_user_alive(id))||(!ma_klase[id])) continue;
 
 
 
  for (new i=1;i<=32;i++)
 
  { 
 
   if(!is_user_alive(i) || get_user_team(i) == get_user_team(id)) continue;
 
 
 
   get_user_origin(i, PlayerCoords)
 
 
 
   message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)
 
   write_byte(id)
 
   write_byte(i) 
 
   write_coord(PlayerCoords[0])
 
   write_coord(PlayerCoords[1])
 
   write_coord(PlayerCoords[2])
 
   message_end()
 
 
 
   message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)
 
   write_byte(i)
 
   message_end()
 
  }
 
}
 
}
public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)
 
{
 
if(!is_user_connected(idattacker))
 
return HAM_IGNORED;
 
 
 
if(!ma_klase[idattacker])
 
return HAM_IGNORED;
 
 
 
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_SCOUT && damagebits & DMG_BULLET
 
cod_inflict_damage(idattacker, this, float(get_user_health(this)-damage+1.0, 0.0, idinflictor, damagebits);
 
if(damagebits & DMG_HEGRENADE && get_user_team(this) != get_user_team(idattacker) && random_num(1,2) == 1)
 
cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);
 
if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET)
cod_inflict_damage(idattacker, this, 20.0, 0.0, idinflictor, damagebits);
 
 
 
return HAM_IGNORED;

Jak ktoś by mógł naprawić błąd i mi to skompilować to był bym bardzo wdzięczny


Użytkownik CokiA1 edytował ten post 24.07.2013 17:25
Odpowiedz

  • +
  • -
Engi - zdjęcie Engi 24.07.2013

Kompilować się kompiluje ale czy to działa to nie mam pojęcia:

 

#include <amxmodx>

#include <codmod>

#include <hamsandwich>

 

#define DMG_BULLET (1<<1)

#define DMG_HEGRENADE (1<<24)

 

new const nazwa[] = "CyC[od 420lvl]";

 

new const opis[] = "Ma 1/1 z SCOUT'a 1/2 HE, +20dmg";

 

new const bronie    = (1<<CSW_SCOUT)|(1<<CSW_HEGRENADE)|(1<<CSW_AK47);

 

new const zdrowie = 10;

 

new const kondycja = 0;

 

new const inteligencja = 10;

 

new const wytrzymalosc = 0;

 

new g_msgHostageAdd, g_msgHostageDel;

 

new bool:ma_klase[33];

 

public plugin_init() {

 

register_plugin(nazwa, "1.0", "QTM_Peyote");

 

g_msgHostageAdd = get_user_msgid("HostagePos");

 

g_msgHostageDel = get_user_msgid("HostageK");

 

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

 

set_task (2.0,"radar_scan",_,_,_,"b");

RegisterHam(Ham_TakeDamage, "player", "TakeDamage");

 

}

 

public cod_class_enabled(id)

{

new dostepna = 420;

new level = cod_get_user_level(id);

 

if(level < dostepna)

{

client_print(id, print_chat, "[%s]Klasa dostepna od %i poziomu.", nazwa, dostepna)

return COD_STOP;

}

 

ma_klase[id] = true;

 

return COD_CONTINUE;

}

 

public cod_class_disabled(id)

ma_klase[id] = false;

 

public radar_scan(id)

{

 

new PlayerCoords[3];

 

 

 

for (new id=1; id<=32; id++)

 

{

 

if((!is_user_alive(id))||(!ma_klase[id])) continue;

 

 

 

for (new i=1;i<=32;i++)

 

 

if(!is_user_alive(i) || get_user_team(i) == get_user_team(id)) continue;

 

 

 

get_user_origin(i, PlayerCoords)

 

 

 

message_begin(MSG_ONE_UNRELIABLE, g_msgHostageAdd, {0,0,0}, id)

 

write_byte(id)

 

write_byte(i) 

 

write_coord(PlayerCoords[0])

 

write_coord(PlayerCoords[1])

 

write_coord(PlayerCoords[2])

 

message_end()

 

 

 

message_begin(MSG_ONE_UNRELIABLE, g_msgHostageDel, {0,0,0}, id)

 

write_byte(i)

 

message_end()

 

}

 

}

 

}

public TakeDamage(this, idinflictor, idattacker, Float:damage, damagebits)

{

if(!is_user_connected(idattacker))

return HAM_IGNORED;

 

if(!ma_klase[idattacker])

return HAM_IGNORED;

 

if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_SCOUT && damagebits & DMG_BULLET)

cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

 

if(damagebits & DMG_HEGRENADE && get_user_team(this) != get_user_team(idattacker) && random_num(1,2) == 1)

cod_inflict_damage(idattacker, this, float(get_user_health(this))-damage+1.0, 0.0, idinflictor, damagebits);

 

if(get_user_team(this) != get_user_team(idattacker) && get_user_weapon(idattacker) == CSW_AK47 && damagebits & DMG_BULLET)

cod_inflict_damage(idattacker, this, 20.0, 0.0, idinflictor, damagebits);

 

 

return HAM_IGNORED;

}

Odpowiedz