Nesuprantu kodėl

Šiame forume rašomi vartotojų klausimai/problemos su kuriomis jie susidūrė kuriant pluginus.
Post Reply
User avatar
zirualas
Gana aktyvus vartotojas
Posts: 216
Joined: 2010 Oct 16 21:33
Skype: zirual
Location: Vilnius
Contact:

Nesuprantu kodėl

Post 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]--}   

User avatar
hleV
AMX Mod X ekspertai
Posts: 875
Joined: 2011 Apr 02 11:23
Skype: hlev.lt
Location: Šiauliai

Re: Nesuprantu kodėl

Post 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]--}   
Last edited by hleV on 2011 Aug 17 13:07, edited 1 time in total.
Image ← RIP best userbar
DISKUSIJA: KIETAS PLUGIN'O UŽSAKOVAS
Privačios pagalbos neteikiu!

User avatar
zirualas
Gana aktyvus vartotojas
Posts: 216
Joined: 2010 Oct 16 21:33
Skype: zirual
Location: Vilnius
Contact:

Re: Nesuprantu kodėl

Post 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.

morka
Gana aktyvus vartotojas
Posts: 292
Joined: 2011 Jan 08 00:21

Re: Nesuprantu kodėl

Post by morka »

Tau tu mysql moduli ijunk
Image

User avatar
zirualas
Gana aktyvus vartotojas
Posts: 216
Joined: 2010 Oct 16 21:33
Skype: zirual
Location: Vilnius
Contact:

Re: Nesuprantu kodėl

Post by zirualas »

Aš nenaudoju mysql, aš šeip testinu.

User avatar
hleV
AMX Mod X ekspertai
Posts: 875
Joined: 2011 Apr 02 11:23
Skype: hlev.lt
Location: Šiauliai

Re: Nesuprantu kodėl

Post by hleV »

Pataisiau kodą aukščiau.
Image ← RIP best userbar
DISKUSIJA: KIETAS PLUGIN'O UŽSAKOVAS
Privačios pagalbos neteikiu!

User avatar
zirualas
Gana aktyvus vartotojas
Posts: 216
Joined: 2010 Oct 16 21:33
Skype: zirual
Location: Vilnius
Contact:

Re: Nesuprantu kodėl

Post by zirualas »

Ačiū. Bet tikriausiai niekad nesuprasiu for ciklo.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 0 guests