Raised This Month: $ Target: $400
 0% 

Any idea why this code doesn't work?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-22-2013 , 20:45   Re: Any idea why this code doesn't work?
Reply With Quote #4

Quote:
Originally Posted by DeLiriuM View Post
Normal users should recieve XX amount of jbpacks + X amount (if killed with HS), VIP users (ADMIN_LEVEL_H) should recieve YY amount of jbpacks + X amount (if killed with HS), but they don't.
Would you give me an example?
Honestly, I don't care what you are trying to do. I'm trying to help you help yourself so that you can either fix this problem (and many others) yourself or get a better idea of what you are actually needing help with.

When something "doesn't work," you should always first check what code is actually being executed. If the whole function is not getting called at all then it doesn't do any good to change your code.

So, you should find out what code is actually being executed. I typically do this by adding in server_print() statements describing what part just got executed (you can also use log_amx).

Code:
function()
{
    server_print("function just got executed")
    if( g_bBoolean )
    {
        server_print("g_bBoolean is true")
    }
    else
    {
        server_print("g_bBoolean is false")
    }
    server_print("function finished executing")
    // etc.
}
The problem may be simpler to solve than this but a process like this will help you figure out where to look. Most likely, you will be able to solve your own problems this way (by knowing what is actually happening step-by-step).

E.g. If you never see anything print then you know that function() is not even being executed and you now know to look into why it's not being executed instead of looking inside the function which at that point would be irrelevant. If don't see what you expect to see from certain parts of the function then you know where to look into.

So, after this process, you should not ever say "it doesn't work" because you should have it narrowed down to what does not work.
__________________
fysiks is offline
 



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 20:39.


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