AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Bad Load Of My Own Plugin On Server (https://forums.alliedmods.net/showthread.php?t=19554)

broertje 10-19-2005 12:25

Bad Load Of My Own Plugin On Server
 
Code:
#include <amxmodx>   #include <amxmisc>   #include <fun>   #include <cstrike>   #define PLUGIN "BuyMenus" #define VERSION "1.0" #define AUTHOR "Broertje" public plugin_init() {       register_plugin("Buymenus", "1.0", "Broertje")     register_clcmd("say /buyhealth", "sayHP", 0, "- Show Menu To buy Hp!!!")     register_clcmd("say /buyarmor", "sayAP", 0, "- Show Menu To buy Ap!!!")     register_clcmd("say /buymisc", "sayMisc", 0, "- Show Menu To buy Things!!!")     register_menucmd(register_menuid("BUY_HEALTH"),1023,"giveStuff");     register_menucmd(register_menuid("BUY_ARMOR"),1023,"giveStuff2");     register_menucmd(register_menuid("BUY_MISC"),1023,"giveStuff3"); } public sayMisc(id)     {     new menu[192]     new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)           format(menu, 191, "\yBuy:^n\w^n1. Buy 3 Frags - 3000$^n2. Buy -3 Deaths - 3000$^n3. Buy Low Gravity - 500$^n4. Buy Silent FootSteps - 500$")     show_menu(id, keys, menu, -1, "BUY_MISC")     return PLUGIN_HANDLED } public sayAP(id)     {     new menu[192]     new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)           format(menu, 191, "\yBuy Armor:^n\w^n1. Buy 10AP - 100$^n2. Buy 20AP - 200$^n3. Buy 30AP - 300$^n4. Buy 40AP - 400$^n5. Buy 50AP - 500$^n6. Buy 100AP - 1000$")     show_menu(id, keys, menu, -1, "BUY_HEALTH")     return PLUGIN_HANDLED } public sayHP(id)     {     new menu[192]     new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)           format(menu, 191, "\yBuy Health:^n\w^n1. Buy 10HP - 100$^n2. Buy 20HP - 200$^n3. Buy 30HP - 300$^n4. Buy 40HP - 400$^n5. Buy 50HP - 500$^n6. Buy 100HP - 1000$")     show_menu(id, keys, menu, -1, "BUY_HEALTH")     return PLUGIN_HANDLED } public giveStuff3(id, key)     {     new money = cs_get_user_money(id)     new frags = get_user_frags(id)     new deaths = get_user_deaths(id)     switch(key)     {         case 0:         {             if (money > 2999) {                 set_user_frags(id, frags + 3)                 cs_set_user_money(id, money - 3000, 1)             }         }         case 1:         {             if (money > 2999) {                 set_user_deaths(id, deaths - 3)                 cs_set_user_money(id, money - 3000, 1)             }         }         case 2:         {             if (money > 499) {                 set_user_gravity(id,0.5)                 cs_set_user_money(id, money - 500, 1)             }         }         case 3:         {             if (money > 399) {                 set_user_footsteps(id, 1)                 cs_set_user_money(id, money - 500, 1)             }         }     }     return PLUGIN_HANDLED; } public giveStuff(id, key)     {     new money = cs_get_user_money(id)     new health = get_user_health(id)     switch(key)     {         case 0:         {             if (money > 99) {                 set_user_health(id, health + 10)                 cs_set_user_money(id, money - 100, 1)             }         }         case 1:         {             if (money > 199) {                 set_user_health(id, health + 20)                 cs_set_user_money(id, money - 200, 1)             }         }         case 2:         {             if (money > 299) {                 set_user_health(id, health + 30)                 cs_set_user_money(id, money - 300, 1)             }         }         case 3:         {             if (money > 399) {                 set_user_health(id, health + 40)                 cs_set_user_money(id, money - 400, 1)             }         }         case 4:         {             if (money > 499) {                 set_user_health(id, health + 50)                 cs_set_user_money(id, money - 500, 1)             }         }         case 5:         {             if (money > 999) {                 set_user_health(id, health + 100)                 cs_set_user_money(id, money - 1000, 1)             }         }     }     return PLUGIN_HANDLED;      }     public giveStuff2(id, key)     {     new money = cs_get_user_money(id)     new armor = get_user_armor(id)     switch(key)     {         case 0:         {             if (money > 99) {                 set_user_armor(id, armor + 10)                 cs_set_user_money(id, money - 100, 1)             }         }         case 1:         {             if (money > 199) {                 set_user_armor(id, armor + 20)                 cs_set_user_money(id, money - 200, 1)             }         }         case 2:         {             if (money > 299) {                 set_user_armor(id, armor + 30)                 cs_set_user_money(id, money - 300, 1)             }         }         case 3:         {             if (money > 399) {                 set_user_armor(id, armor + 40)                 cs_set_user_money(id, money - 400, 1)             }         }         case 4:         {             if (money > 499) {                 set_user_armor(id, armor + 50)                 cs_set_user_money(id, money - 500, 1)             }         }         case 5:         {             if (money > 999) {                 set_user_armor(id, armor + 100)                 cs_set_user_money(id, money - 1000, 1)             }         }     }     return PLUGIN_HANDLED; }
It Says Bad Load,But When I Compile I Have 0 Errors,And Modules Are Enabled

[ --<-@ ] Black Rose 10-19-2005 12:31

im no good wid manus but i think...
Code:
public giveStuff3(id, key)       {       new money = cs_get_user_money(id)       new frags = get_user_frags(id)       new deaths = get_user_deaths(id)     switch(key)       {           case 0:           {               if (money > 2999) {                   set_user_frags(id, frags + 3)                   cs_set_user_money(id, money - 3000, 1)               }           }           case 1:           {               if (money > 2999) {                   set_user_deaths(id, deaths - 3)                   cs_set_user_money(id, money - 3000, 1)               }           }           case 2:           {               if (money > 499) {                   set_user_gravity(id,0.5)                 cs_set_user_money(id, money - 500, 1)               }           }           case 3:           {               if (money > 399) {                   set_user_footsteps(id, 1)                 cs_set_user_money(id, money - 500, 1)             }         }       }     return PLUGIN_HANDLED; }
4 cases
BUT...
Code:
public sayMisc(id)       {       new menu[192]       new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)           format(menu, 191, "\yBuy:^n\w^n1. Buy 3 Frags - 3000$^n2. Buy -3 Deaths - 3000$^n3. Buy Low Gravity - 500$^n4. Buy Silent FootSteps - 500$")       show_menu(id, keys, menu, -1, "BUY_MISC")       return PLUGIN_HANDLED   }
6 btns?

am i right?
as i said not good wid menus... but try it

change
Code:
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<5)
to:
Code:
new keys = (1<<0)|(1<<1)|(1<<2)|(1<<3)
??

broertje 10-19-2005 12:37

So I Deleted 2btns,Still Not Working

Brad 10-19-2005 12:39

Place "debug" on the same line and after your plugin. Then, restart your map. Then, look in the most recent AMXX log and see what it says re: your bad load.

broertje 10-19-2005 12:42

set_user_deaths check modules.ini

[ --<-@ ] Black Rose 10-19-2005 12:42

Quote:

Originally Posted by broertje
So I Deleted 2btns,Still Not Working

u sure u did it on the right place...? :wink:

broertje 10-19-2005 12:45

thats not the error,its new deaths = get_user_deaths(id)
we do't need that i think,so i can just delete it,will try it now

broertje 10-19-2005 12:47

i'm just going to delete that option,error is still there

[ --<-@ ] Black Rose 10-19-2005 12:47

okey... yea i thought that might b to small problem to make it bad load...

broertje 10-19-2005 12:49

Woooohooo,its working now


All times are GMT -4. The time now is 00:04.

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