Raised This Month: $ Target: $400
 0% 

Would need some help.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
broertje
Senior Member
Join Date: Mar 2005
Old 10-19-2005 , 10:36  
Reply With Quote #1

thank you so much...
broertje is offline
DarlD
Senior Member
Join Date: Aug 2004
Old 10-19-2005 , 10:39  
Reply With Quote #2

It still doesnt work.

Your plugin failed to compile! Read the errors below:


Welcome to the AMX Mod X 1.60-300 Compiler.
Copyright (c) 1997-2005 ITB CompuPhase, AMX Mod X Team

/home/users/amxmodx/tmp3/php8v6ywh.sma(117) : warning 217: loose indentation
/home/users/amxmodx/tmp3/php8v6ywh.sma(117) : error 014: invalid statement; not in switch
/home/users/amxmodx/tmp3/php8v6ywh.sma(117) : warning 215: expression has no effect
/home/users/amxmodx/tmp3/php8v6ywh.sma(117) : error 001: expected token: ";", but found ":"
/home/users/amxmodx/tmp3/php8v6ywh.sma(117) : error 029: invalid expression, assumed zero
/home/users/amxmodx/tmp3/php8v6ywh.sma(117) : fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/php8v6ywh.amx (compile failed).


Code:
// Setting the buttons for the buy Armor menu public giveStuff2(id, key) {     switch(key)     {         case 0:           {         if(cs_get_user_money(id) > 100) {             set_user_armor(id,(get_user_armor(id)+10))             cs_set_user_money(id,(cs_get_user_money(id)-100),1)         }         case 1:           {         if(cs_get_user_money(id) > 200) {             set_user_armor(id,(get_user_armor(id)+20))             cs_set_user_money(id,(cs_get_user_money(id)-200),1)         }         case 2:           {         if(cs_get_user_money(id) > 300) {             set_user_armor(id,(get_user_armor(id)+30))             cs_set_user_money(id,(cs_get_user_money(id)-300),1)         }         case 3:           {         if(cs_get_user_money(id) > 400) {             set_user_armor(id,(get_user_armor(id)+40))             cs_set_user_money(id,(cs_get_user_money(id)-400),1)         }         case 4:           {         if(cs_get_user_money(id) > 500) {             set_user_armor(id,(get_user_armor(id)+50))             cs_set_user_money(id,(cs_get_user_money(id)-500),1)         }         case 5:           {         if(cs_get_user_money(id) > 1000) {             set_user_armor(id,(get_user_armor(id)+100))             cs_set_user_money(id,(cs_get_user_money(id)-1000),1)         }         case 6:         {         if(cs_get_user_money(id) >= 16000) {        set_user_armor(id,(get_user_armor(id)+5000))        cs_set_user_money(id,(cs_get_user_money(id)-16000),1)       } }     return PLUGIN_CONTINUE }
__________________
DarlD is offline
Send a message via MSN to DarlD
broertje
Senior Member
Join Date: Mar 2005
Old 10-19-2005 , 10:41  
Reply With Quote #3

You Want To Post Final or You Can Do It On You're Own?
broertje is offline
broertje
Senior Member
Join Date: Mar 2005
Old 10-19-2005 , 10:44  
Reply With Quote #4

Still Have Problem,If I Do if(cs_get_user_money(id) > 100){ For All Cases,Changed Money... I Have An Error On Case1
broertje is offline
atomic
Veteran Member
Join Date: Jan 2005
Location: What The Foot?
Old 10-19-2005 , 10:44  
Reply With Quote #5

broertje..doubleposting is against the rules...also trippleposting tho
__________________
atomic is offline
broertje
Senior Member
Join Date: Mar 2005
Old 10-19-2005 , 10:46  
Reply With Quote #6

Uh What Do You Mean? You Mean This:
Quote:
You Want To Post Final or You Can Do It On You're Own?
and
Quote:
thank you so much...
broertje is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 10-19-2005 , 10:46  
Reply With Quote #7

i just wonder 1 thing then...
this:
Code:
(cs_get_user_money > 100)
woldn't that mean they gotto have 101 or more?

i would do it like this:
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> //What was the point of this if you dont use it? //#define PLUGIN "Buy Health" //#define VERSION "1.0" //#define AUTHOR "Broertje" public plugin_init() {     register_plugin("Buy Health", "1.0", "Broertje")     register_clcmd("say /buyhealth", "sayHP", 0, "- Show Menu To buy Hp!!!")     register_menucmd(register_menuid("BUY_HEALTH"),1023,"giveStuff"); } 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 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; }
[ --<-@ ] Black Rose is offline
broertje
Senior Member
Join Date: Mar 2005
Old 10-19-2005 , 10:55  
Reply With Quote #8

Doesn't Work?
broertje is offline
MistaGee
Senior Member
Join Date: Aug 2004
Location: Germany (Fulda)
Old 10-19-2005 , 10:57  
Reply With Quote #9

Quote:
Originally Posted by [ --<-@
Black Rose]woldn't that mean they gotto have 101 or more?
yep. fix for this:

Code:
 if(cs_get_user_money(id) >= 100){             set_user_armor(id,(get_user_armor(id)+10))             cs_set_user_money(id,(cs_get_user_money(id)-100),1)             }

Quote:
Originally Posted by DarlD
It still doesnt work.

Your plugin failed to compile! Read the errors below:
mostly bcuz you forgot a closing bracket in all the cases

Greetz MGee
__________________
Ich hab nie behauptet dass ich kein Genie bin!
Mumble-Django: A web interface for Mumble
MistaGee is offline
Send a message via ICQ to MistaGee
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 10-19-2005 , 10:59  
Reply With Quote #10

fix this, fix that! mine is done and should work? (at least i have compiled it some times... last time maby 10 secs ago...)
if not... i dunno... what amxx version r u using?
[ --<-@ ] Black Rose is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:52.


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