Page 1 of 1

Nesuprantu kodėl

Posted: 2011 Aug 16 16:47
by zirualas
Kodėl neveikia šis kodas neveikia? Tiksliau nerodo kelintas lygis Hud'e.

Code: Select all

/* Plugin generated by AMXX-Studio */ #include <amxmodx>#include <fakemeta> #define PLUGIN "Testing"#define VERSION "1.0"#define AUTHOR "Zirual" new level[32]; public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR)        register_forward(FM_StartFrame, "ShowInfo");    register_clcmd("say /lvlup", "lvlup");    register_clcmd("say /lvldown", "lvldown");} public ShowInfo(id){    set_hudmessage(0, 255, 0, -1.0, -1.0)    show_hudmessage(id, "Level: %d", level[id])}    public lvlup(id){    client_print(id, print_chat, "[AMXX] Level is: %d", level[id]);    level[id]++} public lvldown(id){    client_print(id, print_chat, "[AMXX] Level si: %d", level[id]);    level[id]--}   

Re: Nesuprantu kodėl

Posted: 2011 Aug 16 18:29
by hleV
Jei serveryje 1000 FPS, ShowInfo bus iššauktas 1000 kartų per sekundę. Tikrai nori dėl kažkokio HUD naudot tokį forward'ą?

Code: Select all

/* Plugin generated by AMXX-Studio */     #include <amxmodx>//#include <fakemeta>     #define PLUGIN "Testing"#define VERSION "1.0"#define AUTHOR "Zirual"     new level[32];     public plugin_init() {    register_plugin(PLUGIN, VERSION, AUTHOR)           set_task(1.0, "ShowInfo", _, _, _, "b"); //register_forward(FM_StartFrame, "ShowInfo");    register_clcmd("say /lvlup", "lvlup");    register_clcmd("say /lvldown", "lvldown");}     public ShowInfo(){    set_hudmessage(0, 255, 0, -1.0, -1.0, _, _, 1.1, 0.0, 0.0, 1); //set_hudmessage(0, 255, 0, -1.0, -1.0)    //show_hudmessage(id, "Level: %d", level[id])     static players[32], num;    get_players(players, num, "a");     for (new i, id; i < num; i++)    {        id = players[i];         show_hudmessage(id, "Level: %d", level[id]);    }}       public lvlup(id){    client_print(id, print_chat, "[AMXX] Level is: %d", level[id]);    level[id]++}     public lvldown(id){    client_print(id, print_chat, "[AMXX] Level si: %d", level[id]);    level[id]--}   

Re: Nesuprantu kodėl

Posted: 2011 Aug 17 10:45
by zirualas
Neveikia kažkodėl.
Log'as (nesusija su mano testing.amxx pluginu)
L 08/17/2011 - 11:41:59: -------- Mapchange to kz_hills --------
L 08/17/2011 - 11:41:59: [AMXX] Plugin "admin_sql.amxx" failed to load: Module/Library Class "dbi" required for plugin. Check modules.ini.
L 08/17/2011 - 11:41:59: [AMXX] Plugin "bb_he_grenade.amxx" failed to load: Plugin uses an unknown function (name "pev_valid") - check your modules.ini.

Re: Nesuprantu kodėl

Posted: 2011 Aug 17 10:49
by morka
Tau tu mysql moduli ijunk

Re: Nesuprantu kodėl

Posted: 2011 Aug 17 11:36
by zirualas
Aš nenaudoju mysql, aš šeip testinu.

Re: Nesuprantu kodėl

Posted: 2011 Aug 17 13:07
by hleV
Pataisiau kodą aukščiau.

Re: Nesuprantu kodėl

Posted: 2011 Aug 17 15:19
by zirualas
Ačiū. Bet tikriausiai niekad nesuprasiu for ciklo.