AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Can you help me fix the warnings please? (https://forums.alliedmods.net/showthread.php?t=22786)

Jordan 01-03-2006 23:32

Can you help me fix the warnings please?
 
I'm getting compiling warnings (tag mismatches) on the lines right after:

new grav = get_user_gravity(id)

And I assume it has to do with the grav being there - I can't remove the grav from that spot though because the plugin won't compile then :(

Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #define PLUGIN "Personal Gravity" #define VERSION "1.0" #define AUTHOR "SatanWoJ" new arg1[32] new arg2[10] public plugin_init() {     register_plugin("Personal Gravity", "1.0", "SatanWoJ")     register_concmd("amx_pgrav", "gravity", ADMIN_KICK, "<nick> <gravity>")     register_clcmd("say /buygrav", "bgrav", 0)     new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_0     register_menucmd(register_menuid("Gravity Menu"), keys, "GravMenu") } public gravity(id, level, cid) {         if(!cmd_access(id, level, cid, 2))             return PLUGIN_HANDLED             read_argv(1, arg1, 31)         read_argv(2, arg2, 9)         new target = cmd_target(id, arg1, 15)         new Float:amount = str_to_float(arg2)/800         set_user_gravity(target, amount)         return PLUGIN_CONTINUE }     public bgrav(id) {         if(!is_user_alive(id))             return PLUGIN_HANDLED                     new menu[192]         new keys = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_0         format(menu, 191, "Gravity Menu^n^n1. 100 - $5000^n2. 200 - $3500^n3. 400 - $2000^n4. 550 - $1500^n5. 800 - $0^n^n0. BACK.")         show_menu(id, keys, menu)         return PLUGIN_HANDLED } public gravmenu(id, key) {     switch(key)     {         case 0:         {             new money = cs_get_user_money(id)             new grav = get_user_gravity(id)             if(money < 5000)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.125)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 } else {                         cs_set_user_money(id, money-5000)                         set_user_gravity(id, 0.125)                         return PLUGIN_HANDLED                     }         }         case 1:         {             new money = cs_get_user_money(id)             new grav = get_user_gravity(id)             if(money < 3500)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.25)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 } else {                         cs_set_user_money(id, money-3500)                         set_user_gravity(id, 0.25)                         return PLUGIN_HANDLED                     }         }         case 2:         {             new money = cs_get_user_money(id)             new grav = get_user_gravity(id)             if(money < 2000)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.5)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 } else {                         cs_set_user_money(id, money-2000)                         set_user_gravity(id, 0.5)                         return PLUGIN_HANDLED                     }         }         case 3:         {             new money = cs_get_user_money(id)             new grav = get_user_gravity(id)             if(money < 1500)             {                 client_print(id, print_chat, "You have insufficient funds!")                 return PLUGIN_HANDLED             }             else if(grav == 0.6875)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 } else {                         cs_set_user_money(id, money-1500)                         set_user_gravity(id, 0.6875)                         return PLUGIN_HANDLED                     }         }         case 4:         {             new grav = get_user_gravity(id)             if(grav == 1.0)                 {                     client_print(id, print_chat, "You already are at that gravity!")                     return PLUGIN_HANDLED                 } else {                         set_user_gravity(id, 1.0)                         return PLUGIN_HANDLED                     }         }         case 9:         {             return PLUGIN_HANDLED;         }     }     return PLUGIN_CONTINUE }

v3x 01-03-2006 23:35

Code:
new Float:grav = get_user_gravity(id);

Jordan 01-03-2006 23:41

DAMNT! >.< TY ^^


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

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