Raised This Month: $ Target: $400
 0% 

Internal Error :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
harbu
Senior Member
Join Date: Aug 2004
Location: Finland
Old 10-29-2004 , 10:37   Internal Error :(
Reply With Quote #1

I have tried deleting my parts of code to see what the error is and it seems to be this.
Code:
public createmoney[id]  {     new authid[32], query[256]     get_user_authid(id,authid,31)     new argtarget[32]     read_argv(1,argtarget,31)     new target = cmd_target(id,argtarget,8)     if(!target) return PLUGIN_HANDLED     new authid2[32]     get_user_authid(target,authid2,31)     format(query,255,"SELECT balance FROM money WHERE steamid='%s'",authid)     result = dbi_query(dbc,query)     new SourceName[32],TargetName[32]     get_user_name(id,SourceName,31)     get_user_name(target,TargetName,31)     if(dbi_nextrow(result) > 0) {         new Str[32],amount,balance         dbi_field(result,1,Str,31)         dbi_free_result(result)         balance = str_to_num(Str)         read_argv(2,Str,31)         amount = str_to_num(Str)         if(amount < 1 && amount > balance)  {             client_print(id,print_notify,"[TEM] Invalid Amount.")             set_hudmessage(0,175,0,-1.0,-0.02,0,0.0,5.0,0.0,0.0,2)             show_hudmessage(id,"[TEM] Invalid Amount.")             return PLUGIN_HANDLED         } else  {             format(query,255,"UPDATE money SET balance=balance+%i WHERE steamid='%s'",amount,authid2)             server_print("[TEM] Sending query: %s",query)             dbi_query(dbc,query)             format(query,255,"UPDATE money SET balance=balance WHERE steamid='%s'",authid)             server_print("[TEM] Sending query: %s",query)             dbi_query(dbc,query)             client_print(target,print_notify,"[TEM] You have received $%i from %s.",amount,SourceName)             client_print(id,print_notify,"[TEM] You have created $%i to %s.",amount,TargetName)             set_hudmessage(0,175,0,-1.0,-0.02,0,0.0,5.0,0.0,0.0,2)             show_hudmessage(target,"[TEM] Received $%i from %s",amount,SourceName)             show_hudmessage(id,"[TEM] Created $%i to %s",amount,TargetName)             }         }     }     return PLUGIN_HANDLED }

Basicly when i try to compile the code (more than this) it gives me an internal error. When i delete this part it dosent... So can anyone plz help me out and tell/fix what the error is?
harbu is offline
Send a message via MSN to harbu
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 10-29-2004 , 11:15  
Reply With Quote #2

you have too many } at the end.. might fix it
__________________
hello, i am pm
PM is offline
harbu
Senior Member
Join Date: Aug 2004
Location: Finland
Old 10-29-2004 , 12:06  
Reply With Quote #3

Well i took the extra } off the end but still it gives me the internal error
harbu is offline
Send a message via MSN to harbu
BAILOPAN
Join Date: Jan 2004
Old 10-29-2004 , 13:16  
Reply With Quote #4

Your spacing could be better, observe:

Code:
public createmoney(id) {     new authid[32], query[256]     get_user_authid(id,authid,31)     new argtarget[32]     read_argv(1,argtarget,31)     new target = cmd_target(id,argtarget,8)     if(!target) return PLUGIN_HANDLED     new authid2[32]     get_user_authid(target,authid2,31)     format(query,255,"SELECT balance FROM money WHERE steamid='%s'",authid)     result = dbi_query(dbc,query)     new SourceName[32],TargetName[32]     get_user_name(id,SourceName,31)     get_user_name(target,TargetName,31)     if(dbi_nextrow(result) > 0)     {         new Str[32],amount,balance         dbi_field(result,1,Str,31)         dbi_free_result(result)         balance = str_to_num(Str)         read_argv(2,Str,31)         amount = str_to_num(Str)         if(amount < 1 && amount > balance)         {             client_print(id,print_notify,"[TEM] Invalid Amount.")             set_hudmessage(0,175,0,-1.0,-0.02,0,0.0,5.0,0.0,0.0,2)             show_hudmessage(id,"[TEM] Invalid Amount.")             return PLUGIN_HANDLED         } else {             format(query,255,"UPDATE money SET balance=balance+%i WHERE steamid='%s'",amount,authid2)             server_print("[TEM] Sending query: %s",query)             dbi_query(dbc,query)             format(query,255,"UPDATE money SET balance=balance WHERE steamid='%s'",authid)             server_print("[TEM] Sending query: %s",query)             dbi_query(dbc,query)             client_print(target,print_notify,"[TEM] You have received $%i from %s.",amount,SourceName)             client_print(id,print_notify,"[TEM] You have created $%i to %s.",amount,TargetName)             set_hudmessage(0,175,0,-1.0,-0.02,0,0.0,5.0,0.0,0.0,2)             show_hudmessage(target,"[TEM] Received $%i from %s",amount,SourceName)             show_hudmessage(id,"[TEM] Created $%i to %s",amount,TargetName)         }     }     return PLUGIN_HANDLED }

The above should work. The brackets are spaced so you can easily see what is aligned.
Also you had:
Code:
public createmoney[id]
It should have been:
Code:
public createmoney(id)
__________________
egg
BAILOPAN is offline
harbu
Senior Member
Join Date: Aug 2004
Location: Finland
Old 10-29-2004 , 14:11  
Reply With Quote #5

Thanks Man! Good forums when u get help
Yeah the code is quite messy, actually it isnt all mine its twilightsuzukas economymod for ts but im improving, squashing the bugs from it...
Omg, it was that i had [] instead of (). I was searching like for 4 hours the reason and it was the public thingy
harbu is offline
Send a message via MSN to harbu
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 10-29-2004 , 15:02  
Reply With Quote #6

Quote:
Originally Posted by harbu
Thanks Man! Good forums when u get help
Yeah the code is quite messy, actually it isnt all mine its twilightsuzukas economymod for ts but im improving, squashing the bugs from it...
Omg, it was that i had [] instead of (). I was searching like for 4 hours the reason and it was the public thingy
And you had too many braces.. ok, would be probably a normal compiler error, but who cares
__________________
hello, i am pm
PM 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 08:00.


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