Raised This Month: $ Target: $400
 0% 

Server Crashes from Plugin[URGENT]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
NiQu
Veteran Member
Join Date: Nov 2009
Old 03-12-2010 , 13:10   Server Crashes from Plugin[URGENT]
Reply With Quote #1

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?
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 03-13-2010 , 12:16   Re: Server Crashes from Plugin[URGENT]
Reply With Quote #2

Please someone help!
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 03-13-2010 , 12:49   Re: Server Crashes from Plugin[URGENT]
Reply With Quote #3

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.
__________________
stupok is offline
NiQu
Veteran Member
Join Date: Nov 2009
Old 03-13-2010 , 13:00   Re: Server Crashes from Plugin[URGENT]
Reply With Quote #4

How come ur so smart ?
Ill check if that is teh case.
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 03-14-2010 , 00:11   Re: Server Crashes from Plugin[URGENT]
Reply With Quote #5

Quote:
Originally Posted by stupok View Post
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.
Styles is offline
Send a message via AIM to Styles
NiQu
Veteran Member
Join Date: Nov 2009
Old 03-16-2010 , 16:55   Re: Server Crashes from Plugin[URGENT]
Reply With Quote #6

I still need help with this..
__________________
My Projects
  • RoTAPI V0.0.1 ------- Private
    • Progress - [||||||||||]
  • CashMod V0.0.6 ----- Public
    • Progress - [||||||||||]
  • CashMod V0.0.7 ----- Public
    • Progress - [||||||||||]
NiQu is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 03-17-2010 , 00:40   Re: Server Crashes from Plugin[URGENT]
Reply With Quote #7

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?
__________________
Bugsy 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:37.


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