AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [BIO] Respawn plugin crashes server (https://forums.alliedmods.net/showthread.php?t=327199)

HowToRuski 09-05-2020 10:24

[BIO] Respawn plugin crashes server
 
1 Attachment(s)
Hi, i have no idea why this plugin crashes my server, like when countdown reaches 7 my hlds just restarts and it also doesnt show any crash logs etc, it just crashes thats all. Anyone can help me?

ZaX 09-05-2020 10:36

Re: [BIO] Respawn plugin crashes server
 
You sure that this plugin causing the issue? Did you try to disable it and see whether it still crashes or not?

HowToRuski 09-05-2020 10:38

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by ZaX (Post 2716759)
You sure that this plugin causing the issue? Did you try to disable it and see whether it still crashes or not?

This is why i made this post. Yes, exactly this plugin does crash.

Supremache 09-05-2020 11:06

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by HowToRuski (Post 2716760)
This is why i made this post. Yes, exactly this plugin does crash.

There's somethings wrong in this plugin like:
1. in this faction
PHP Code:

public enfeksiyon_tipi(id)
{
    if(
is_user_connected(id))
    {
        switch(
get_pcvar_num(cvar_enf_sec))
        {
            case 
1insan(id)
            case 
2zombie(id)
            case 
3:
            {
                switch(
random_num(1,2))
                {
                    case 
1insan(id)
                    case 
2zombie(id)
                }
            }
        }
        
        if(
get_pcvar_num(cvar_godmode))
        {
            
fm_set_user_godmode(id1)
            
set_task(get_pcvar_float(cvar_godmode_timer), "stop_god"id)
        }
    }


This mod have zombie and human system so the problem in this plugin
PHP Code:

case 1insan(id)
                    case 
2zombie(id

The errors in those factions
Change those codes from:

PHP Code:

public zombie(id)
{
    if(!
is_user_zombie(id))
    {
        
infect_user(id0)
        
cs_set_user_team(idCS_TEAM_T)
    }
}

public 
insan(id)
{
    if(
is_user_zombie(id))
    {
        
cure_user(id)
        
cs_set_user_team(idCS_TEAM_CT)
    }
            
    
fm_give_item(id"weapon_m4a1")
    
fm_give_item(id"weapon_deagle")
    
fm_give_item(id"weapon_hegrenade")
    
fm_give_item(id"weapon_smokegrenade")
    
fm_give_item(id"weapon_flashbang")
    
cs_set_user_bpammo(idCSW_M4A1200)
    
cs_set_user_bpammo(idCSW_DEAGLE200)
    
cs_set_user_bpammo(idCSW_HEGRENADE1)
    
cs_set_user_bpammo(idCSW_SMOKEGRENADE1)
    
cs_set_user_bpammo(idCSW_FLASHBANG1)


To:

PHP Code:

public zombie(id)
{
    if(
is_user_zombie(id))
    {
        
infect_user(id0)
        
cs_set_user_team(idCS_TEAM_T)
    }
}

public 
insan(id)
{
    if(!
is_user_zombie(id))
    {
        
cure_user(id)
        
cs_set_user_team(idCS_TEAM_CT)
    }
            
    
fm_give_item(id"weapon_m4a1")
    
fm_give_item(id"weapon_deagle")
    
fm_give_item(id"weapon_hegrenade")
    
fm_give_item(id"weapon_smokegrenade")
    
fm_give_item(id"weapon_flashbang")
    
cs_set_user_bpammo(idCSW_M4A1200)
    
cs_set_user_bpammo(idCSW_DEAGLE200)
    
cs_set_user_bpammo(idCSW_HEGRENADE1)
    
cs_set_user_bpammo(idCSW_SMOKEGRENADE1)
    
cs_set_user_bpammo(idCSW_FLASHBANG1)



HowToRuski 09-05-2020 11:09

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by Supremache (Post 2716763)
There's somethings wrong in this plugin like:
1. in this faction
PHP Code:

public enfeksiyon_tipi(id)
{
    if(
is_user_connected(id))
    {
        switch(
get_pcvar_num(cvar_enf_sec))
        {
            case 
1insan(id)
            case 
2zombie(id)
            case 
3:
            {
                switch(
random_num(1,2))
                {
                    case 
1insan(id)
                    case 
2zombie(id)
                }
            }
        }
        
        if(
get_pcvar_num(cvar_godmode))
        {
            
fm_set_user_godmode(id1)
            
set_task(get_pcvar_float(cvar_godmode_timer), "stop_god"id)
        }
    }


This mod have zombie and human system so the problem in this plugin
PHP Code:

case 1insan(id)
                    case 
2zombie(id

The errors in those factions
Change those codes from:

PHP Code:

public zombie(id)
{
    if(!
is_user_zombie(id))
    {
        
infect_user(id0)
        
cs_set_user_team(idCS_TEAM_T)
    }
}

public 
insan(id)
{
    if(
is_user_zombie(id))
    {
        
cure_user(id)
        
cs_set_user_team(idCS_TEAM_CT)
    }
            
    
fm_give_item(id"weapon_m4a1")
    
fm_give_item(id"weapon_deagle")
    
fm_give_item(id"weapon_hegrenade")
    
fm_give_item(id"weapon_smokegrenade")
    
fm_give_item(id"weapon_flashbang")
    
cs_set_user_bpammo(idCSW_M4A1200)
    
cs_set_user_bpammo(idCSW_DEAGLE200)
    
cs_set_user_bpammo(idCSW_HEGRENADE1)
    
cs_set_user_bpammo(idCSW_SMOKEGRENADE1)
    
cs_set_user_bpammo(idCSW_FLASHBANG1)


To:

PHP Code:

public zombie(id)
{
    if(
is_user_zombie(id))
    {
        
infect_user(id0)
        
cs_set_user_team(idCS_TEAM_T)
    }
}

public 
insan(id)
{
    if(!
is_user_zombie(id))
    {
        
cure_user(id)
        
cs_set_user_team(idCS_TEAM_CT)
    }
            
    
fm_give_item(id"weapon_m4a1")
    
fm_give_item(id"weapon_deagle")
    
fm_give_item(id"weapon_hegrenade")
    
fm_give_item(id"weapon_smokegrenade")
    
fm_give_item(id"weapon_flashbang")
    
cs_set_user_bpammo(idCSW_M4A1200)
    
cs_set_user_bpammo(idCSW_DEAGLE200)
    
cs_set_user_bpammo(idCSW_HEGRENADE1)
    
cs_set_user_bpammo(idCSW_SMOKEGRENADE1)
    
cs_set_user_bpammo(idCSW_FLASHBANG1)



Well thanks for the help but looks like it didnt help me, still crashing :/

Supremache 09-05-2020 11:10

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by HowToRuski (Post 2716764)
Well thanks for the help but looks like it didnt help me, still crashing :/

I didn't gave you the solve i told there's some wrongs in this plugin and i saw that problem

Edit: I saw another problem in this faction
PHP Code:

public respawn(o_id[]) 

    new 
id o_id[0
    if(
get_user_team(id) == || is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 
    
    ExecuteHamB
(Ham_CS_RoundRespawnid)
    
    return 
PLUGIN_CONTINUE    


When plugin disable user alive in respawn faction so it mean this faction will never work.

so change those codes from:

PHP Code:

if(get_user_team(id) == || is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 

To:

PHP Code:

if(get_user_team(id) == || !is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 


HowToRuski 09-05-2020 11:25

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by Supremache (Post 2716766)
I didn't gave you the solve i told there's some wrongs in this plugin and i saw that problem

Edit: I saw another problem in this faction
PHP Code:

public respawn(o_id[]) 

    new 
id o_id[0
    if(
get_user_team(id) == || is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 
    
    ExecuteHamB
(Ham_CS_RoundRespawnid)
    
    return 
PLUGIN_CONTINUE    


When plugin disable user alive in respawn faction so it mean this faction will never work.

so change those codes from:

PHP Code:

if(get_user_team(id) == || is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 

To:

PHP Code:

if(get_user_team(id) == || !is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 


Changed that, now the server doesnt crash but players arent respawning...

Supremache 09-05-2020 11:39

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by HowToRuski (Post 2716768)
Changed that, now the server doesnt crash but players arent respawning...

Edit those codes again
from:
PHP Code:

if(get_user_team(id) == || !is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 

to:
PHP Code:

if(!is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 

If your problem didn't solved then let me check if there's other problems in this plugin

HowToRuski 09-05-2020 11:47

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by Supremache (Post 2716770)
Edit those codes again
from:
PHP Code:

if(get_user_team(id) == || !is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 

to:
PHP Code:

if(!is_user_alive(id)) 
        return 
PLUGIN_CONTINUE 

If you problem didn't solved so let me check if there's other erorrs

Doesnt crash the server but still not respawning. The ! is making them not respawn too...

Supremache 09-05-2020 11:57

Re: [BIO] Respawn plugin crashes server
 
Quote:

Originally Posted by HowToRuski (Post 2716772)
Doesnt crash the server but still not respawning. The ! is making them not respawn too...

Oh i did something wrong try this now
PHP Code:

public respawn(o_id[]) 
{
    new 
id o_id[0
    
    if (!
is_user_connected(id))
        return 
PLUGIN_CONTINUE
        
    
if (!is_user_alive(id))
    {
        
ExecuteHamB(Ham_CS_RoundRespawnid)

    }
    return 
PLUGIN_CONTINUE  
    




All times are GMT -4. The time now is 13:51.

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