AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hello! and... understanding Pawn compiler error. (https://forums.alliedmods.net/showthread.php?t=188804)

Jsanchez 06-30-2012 14:29

Hello! and... understanding Pawn compiler error.
 
Hello folks, I know It's not so nice to introduce myself by asking for help, but if you are reading this, i wanto thank you for your time and brain cells wasted. It's my first day scripting for AMX, My Brackground knowledge is basic Perl, the "Llama" book.

I'm following this tutorial for my first AMX/Pawn script, I've battled a few compiler errors but this one just gets me. (Code is NOT EXACTLY as the tutorial says). I would laso like to know if you know some webpage for common Pawn compiler errors. this one is not so complete.

oh well, as Linus once said... "Show me the code!"

COMPILER WARNING
Code:
Warning: Expression has no effect on line 46
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Ekimino's Map Chooser" #define VERSION "0.01" #define AUTHOR "Jorge Sanchez" new roll_RandomMenu; new roll_Rolls[12]; public plugin_init() {     register_plugin("Ekimino's Map Chooser", "0.01", "Jorge Sanchez");         roll_RandomMenu = menu_create("Roll, winner picks map", "menu_handle");         register_clcmd("ekimino_roll", "start_roll", ADMIN_USER, "Gaben");         build_menu();     } //public roll_RandomMenu(id, roll_RandomMenu, item) //{ //  if(item + 1 = 1) return PLUGIN_CONTINUE;             // Get item info     //menu_item_getinfo(roll_RandomMenu, item, access, roll_Rolls, 101,"rolls",_, callback);     //} public roll_randomizar(id, roll_RandomMenu, item) {     if( item < 0 ) return PLUGIN_CONTINUE;       // Get item info     new cmd[3];     new acces, callback; // ############################################################## // ##############################################################       menu_item_getinfo(roll_RandomMenu, access, cmd, 101,"Nombre","Nombre",callback); // THIS IS LINE 46  //########################################################## //#########################################################     new iChoice = str_to_num(cmd);       cmd[iChoice]++;       return PLUGIN_HANDLED; } public start_roll(id)     {         for(new i = 0; i < 33; i++)         {             if( is_user_alive(i) )             {                 menu_display(i, roll_RandomMenu, 0);             }         }                 return PLUGIN_HANDLED;     } build_menu(){     new slot;     menu_addtext(roll_RandomMenu, "Apretar 1 para la chance de elegir mapa", slot = 0);     menu_additem(roll_RandomMenu, "Rock n' Roll!", "random(100)");     menu_setprop(roll_RandomMenu, MPROP_PERPAGE, 0); }


I still get dizzy by the language, but It's more fun to learn by doing.

Jsanchez 06-30-2012 15:30

Re: Hello! and... understanding Pawn compiler error.
 
Solved, was using wrongly the function menu_item_getinfo, I wish the documentation would explain better each function.

Liverwiz 06-30-2012 16:00

Re: Hello! and... understanding Pawn compiler error.
 
Quote:

Originally Posted by Jsanchez (Post 1739905)
Solved, was using wrongly the function menu_item_getinfo, I wish the documentation would explain better each function.

Check out this tut on the New Menu System
http://forums.alliedmods.net/showthread.php?t=46364


All times are GMT -4. The time now is 15:03.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.