←  Problemy

AMXX.pl: Support AMX Mod X i SourceMod

»

CoD Nowy
Kompilacja klasy!

Zablokowany

  • +
  • -
Frozen - zdjęcie Frozen 30.06.2011

Mam problem! gdy kompiluje ten code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <engine>


new const nazwa[] = "Hunter";
new const opis[] = "Ma M4A1 i AK47. Biega szybko i jest mniej widoczny!";
new const bronie = 1<<CSW_M4A1 | 1<<CSW_AK47;
new const zdrowie = -10;
new const kondycja = 120;
new const inteligencja = -10;
new const wytrzymalosc = -10;

public plugin_init() {
register_plugin(nazwa, "1.0", "QTM_Peyote");

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

public cod_class_enabled(id)
{
ma_klase[id] = true;
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 40);
}

public cod_class_enabled(id)
{
ma_klase[id] = false;
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 60);
}


}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1045\\ f0\\ fs16 \n\\ par }
*/



Wyskakuje ten blad:

Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

codclass_hunter.sma(21) : warning 217: loose indentation
codclass_hunter.sma(21) : error 029: invalid expression, assumed zero
codclass_hunter.sma(21) : error 004: function "cod_class_enabled" is not implemented
codclass_hunter.sma(23) : error 017: undefined symbol "ma_klase"
codclass_hunter.sma(23) : error 017: undefined symbol "id"
codclass_hunter.sma(23) : warning 215: expression has no effect
codclass_hunter.sma(24) : error 017: undefined symbol "id"
codclass_hunter.sma(24) : warning 215: expression has no effect
codclass_hunter.sma(24) : warning 215: expression has no effect
codclass_hunter.sma(24) : warning 215: expression has no effect
codclass_hunter.sma(24) : warning 215: expression has no effect
codclass_hunter.sma(24) : warning 215: expression has no effect
codclass_hunter.sma(24) : warning 215: expression has no effect
codclass_hunter.sma(24) : error 001: expected token: ";", but found ")"
codclass_hunter.sma(24) : error 029: invalid expression, assumed zero
codclass_hunter.sma(24) : fatal error 107: too many error messages on one line

Compilation aborted.
8 Errors.


Jak cos to opis klasy mozna znależć w codzie .sma
Użytkownik HamexPL edytował ten post 30.06.2011 14:02
Odpowiedz

  • +
  • -
BliBs_Pl - zdjęcie BliBs_Pl 30.06.2011

Po prostu nie dałeś new bool:ma_perk[33]; i zamiast cod_class_disabled(id) dałeś cod_class_enabled(id) po raz drugi.
Wpisz przed:
new const nazwa[] = "Hunter";
to:
new bool:ma_perk[33];

I cały kod wygląda tak:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <codmod>
#include <engine>

new bool:ma_perk[33];

new const nazwa[] = "Hunter";
new const opis[] = "Ma M4A1 i AK47. Biega szybko i jest mniej widoczny!";
new const bronie = 1<<CSW_M4A1 | 1<<CSW_AK47;
new const zdrowie = -10;
new const kondycja = 120;
new const inteligencja = -10;
new const wytrzymalosc = -10;

public plugin_init() {
register_plugin(nazwa, "1.0", "QTM_Peyote");

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

public cod_class_enabled(id)
{
ma_klase[id] = true;
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 40);
}

public cod_class_disabled(id)
{
ma_klase[id] = false;
set_rendering(id,kRenderFxGlowShell, 0, 0, 0, kRenderTransAlpha, 255);
}
Odpowiedz

  • +
  • -
Frozen - zdjęcie Frozen 30.06.2011

sam poprawilem jak sie o tym dowiedzialem ze to ten blad, to malo nie plakalem :D
Odpowiedz
Zablokowany