AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Server Crashes from Plugin[URGENT] (https://forums.alliedmods.net/showthread.php?t=121164)

NiQu 03-12-2010 13:10

Server Crashes from Plugin[URGENT]
 
Hi, im trying to make a plugin and when i open the shop for it and go to weapon chance and buy extra ammo for usp the server crashes.

IMG of crash: http://data.fuskbugg.se/skalman01/problem.bmp

Ive checked a few logs and see no errors in there.

The Menu Handler for USP Extra ammo:
PHP Code:

        case 4:
        {
            if ( 
cs_get_user_team(id) == CS_TEAM_T )
            {
                if ( 
USPExtraLevelT[id] < )
                {
                    if ( 
PlayerDollar[id] > get_pcvar_num(USPExtraCost2) )
                    {
                        if ( 
PlayerDollar[id] < get_pcvar_num(USPExtraCost2) )
                        {
                            
F_Print(id"You dont have enough money to buy this item!")
                            return 
PLUGIN_HANDLED;
                        }
                        new 
price4 get_pcvar_num(USPExtraCost2
                        new 
pricediff4 get_pcvar_num(USPExtraCost2_Diff);
                    
                        
F_Print(id"You bought Extra Bullet(USP) level %i"USPExtraLevelT[id] + 1);
                        if ( 
USPExtraLevelT[id] == )
                        {
                            
PlayerDollar[id] -= get_pcvar_num(price4);
                        }
                        if ( 
USPExtraLevelT[id] == )
                        {
                            
PlayerDollar[id] -= get_pcvar_num(price4) + pricediff4;
                        }
                        
USPExtraLevelT[id] += 1;
                    }
                    else
                    {
                        
F_Print(id"You dont have enough money to buy this item!");
                        return 
PLUGIN_HANDLED;
                    }
                }
            }
            else
            {
                
F_Print(id"You have to be Counter-Terrorist to buy this item!");
            }
        } 

Can anyone see anythign wrong in there that might cause the server to crash?

NiQu 03-13-2010 12:16

Re: Server Crashes from Plugin[URGENT]
 
Please someone help!

stupok 03-13-2010 12:49

Re: Server Crashes from Plugin[URGENT]
 
Don't post a 50MB bmp file, and you should probably post more code and details about before and after the crash.

My guess is that you're not checking if id is connected or alive or valid.

NiQu 03-13-2010 13:00

Re: Server Crashes from Plugin[URGENT]
 
How come ur so smart ?
Ill check if that is teh case.

Styles 03-14-2010 00:11

Re: Server Crashes from Plugin[URGENT]
 
Quote:

Originally Posted by stupok (Post 1116319)
Don't post a 50MB bmp file, and you should probably post more code and details about before and after the crash.

My guess is that you're not checking if id is connected or alive or valid.

Yeah but AMXx should prevent simple crashes like that. I want to know what F_Print does or w/e.

NiQu 03-16-2010 16:55

Re: Server Crashes from Plugin[URGENT]
 
I still need help with this..

Bugsy 03-17-2010 00:40

Re: Server Crashes from Plugin[URGENT]
 
I don't see anything in that code that could cause a crash but we do need to take a look at F_Print because that is likely your culprit. How were you able to narrow the 'crash code' down to that little snippet?


All times are GMT -4. The time now is 08:37.

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