Raised This Month: $ Target: $400
 0% 

Server crash on command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 05-09-2010 , 16:08   Server crash on command
Reply With Quote #1

Hey, why the hell my server is always crashing after i type: /shop

/shop opens up ShopMenu

here is my whole plugin:

http://pastebin.com/8rSCryFv

and if you are lazy to look up it all, just look here:

PHP Code:
public ShopMenu(id) {
    if (
PlayerCon[id]) {
        new 
title[100], m1[100], m2[100], m3[100], m4[100], m5[100]
        
format(title,99,"\wJusu taskai: \w%i"PlayerXP[id])
        if (!
PlayerDamage[id]){
        
format(m1,99,"\wZalos rodymas (Kaina: \w%i\w)"get_pcvar_num(ShopDamage))
        }else{
        
format(m1,99,"\dZalos rodymas\w *"get_pcvar_num(ShopDamage))
        } if(!
PlayerAwp[id]){
        
format(m2,99,"\wAwp naudojimas (Kaina: %i)"get_pcvar_num(ShopAwp))
        }else{
        
format(m2,99,"\wAwp naudojimas\w *"get_pcvar_num(ShopAwp))
        } if(!
PlayerPap[id]){
        
format(m3,99,"\wPapildomi bonusai (Kaina: \w%i\w)"get_pcvar_num(ShopPap))
        }else{
        
format(m3,99,"\wPapildomi bonusai\w *"get_pcvar_num(ShopPap))
        } if(!
PlayerKar[id]){
        
format(m4,99,"\wKario komplektas (Kaina: \w%i\w)"get_pcvar_num(ShopKar))
        }else{
        
format(m4,99,"\wKario komplektas\w *"get_pcvar_num(ShopKar))
        } if (!
PlayerSlot[id]){
        
format(m5,99,"\wSlotas serveryje (Kaina: \w%i\w)"get_pcvar_num(ShopSlot))
        }else{
        
format(m5,99,"\wSlotas serveryje\w *"get_pcvar_num(ShopSlot))
        }
        new 
menu menu_create(title"ShopMenuHandler")
        
menu_additem(menum1"2"0)
        
menu_additem(menum2"3",0)
        
menu_additem(menum3"4",0)
        
menu_additem(menum4"5",0)
        
menu_additem(menum5"6",0)
        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
menu_display(idmenu0)
        }else{
        
client_print(idprint_chat,"!g[User Shop]!y Tik registruoti zaidejai gali naudotis menu.")
    }
    return 
PLUGIN_HANDLED
}

public 
ShopMenuHandler(idmenuitem) {
    if( 
item == MENU_EXIT ) {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64]
    new 
accesscallback
    
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key) {
        case 
1: {
            
ShopMenu(id)
        }
        case 
2: {
            if (!
PlayerDamage[id]){
            
BuyDamage(id)
            }else{
            
ShopMenu(id)
        }
        }
        case 
3:  {
            if (!
PlayerAwp[id]){
            
BuyAwp(id)
            }else{
            
ShopMenu(id)
        }
        }
        case 
4:  {
            if (!
PlayerPap[id]){
            
BuyPap(id)
            }else{
            
ShopMenu(id)
        }
        }
        case 
5: {
            if (!
PlayerKar[id]){
            
BuyKar(id)
            }else{
            
ShopMenu(id)
        }
        }
        case 
6: {
            if (!
PlayerSlot[id]){
            
BuySlot(id)
            }else{
            
ShopMenu(id)
        }
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

Help please, someone ?

EDIT: here is message after crash in my server console:


Quote:
./hlds_run: line 321: 18326 Segmentation fault $HL_CMD
what it means ?

Last edited by reinert; 05-09-2010 at 16:55.
reinert is offline
HLM
Senior Member
Join Date: Apr 2008
Location: C:\WINDOWS\System32
Old 05-09-2010 , 16:55   Re: Server crash on command
Reply With Quote #2

any errors? what does it say in the logs when it crashes? check amxmodx error log and see what its saying.
__________________
+|- KARMA Respectively

HLM is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 05-10-2010 , 07:11   Re: Server crash on command
Reply With Quote #3

nothing in there.
reinert is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 05-11-2010 , 08:56   Re: Server crash on command
Reply With Quote #4

help.
reinert is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-11-2010 , 13:04   Re: Server crash on command
Reply With Quote #5

Quote:
Originally Posted by reinert View Post
help.
Don't bump until 2 weeks have passed since last post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-11-2010 , 11:48   Re: Server crash on command
Reply With Quote #6

if your server crashes there should be a log , ok if there is no log , try adding the plugin to your counter strike , not server. Check if it crashes ur Cs too
SaM.ThE.MaN is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 05-11-2010 , 12:01   Re: Server crash on command
Reply With Quote #7

how can i add it to CS ? Before I added ShopMenu and ShopMenuHandler and all shop buying methods, it worked fine for me.

I changed something:

PHP Code:
public ShopMenu(id) {
    if (
PlayerCon[id]) {
        new 
menu menu_create("0""ShopMenuHandler")
        
menu_additem(menu"1""2"0)
        
menu_additem(menu"2""3",0)
        
menu_additem(menu"3""4",0)
        
menu_additem(menu"4""5",0)
        
menu_additem(menu"5""6",0)

        
menu_setprop(menuMPROP_EXITMEXIT_ALL)
        
menu_display(idmenu0)
        }else{
        
client_print(idprint_chat,"!g[User Shop]!y Tik registruoti zaidejai gali naudotis menu.")
    }
    return 
PLUGIN_HANDLED
}

public 
ShopMenuHandler(idmenuitem) {
    if( 
item == MENU_EXIT ) {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    new 
data[6], iName[64]
    new 
accesscallback
    
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    
    new 
key str_to_num(data)
    
    switch(
key) {
        case 
1: {
        }
        case 
2: {
            if (!
PlayerDamage[id]){
            }else{
        }
        }
        case 
3:  {
            if (!
PlayerAwp[id]){
            }else{
        }
        }
        case 
4:  {
            if (!
PlayerPap[id]){
            }else{
        }
        }
        case 
5: {
            if (!
PlayerKar[id]){
            }else{
        }
        }
        case 
6: {
            if (!
PlayerSlot[id]){
            }else{
        }
        }
    }
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED

and now server doesn't crash, so where is the problem ?

Last edited by reinert; 05-11-2010 at 12:11.
reinert is offline
SaM.ThE.MaN
Senior Member
Join Date: Jan 2010
Old 05-11-2010 , 15:34   Re: Server crash on command
Reply With Quote #8

whats the problem now?
SaM.ThE.MaN is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 05-11-2010 , 15:39   Re: Server crash on command
Reply With Quote #9

Problem is, that someone could lock this topic, problem is solved
reinert 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 03:42.


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