Raised This Month: $51 Target: $400
 12% 

random players not spawning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-27-2018 , 15:51   random players not spawning
Reply With Quote #1

Hello,

Im running a deathmatch server with no round end, checking if the player is not alive and if he is in a team, then respawning, but the thing is this method works for around 80% of the players, the rest 20% are not respawning, they need to do "retry" and then it respawns, even that sometimes is no help, they have to restart their cs. Is there any other way to fix this issue? Like a doublecheck or something like that.

Also to mention, I am using an autoteamjoin plugin too.
__________________

Last edited by SomewhereLost; 10-27-2018 at 16:33.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-27-2018 , 16:42   Re: random players not spawning
Reply With Quote #2

Show your code?
__________________
Bugsy is offline
SomewhereLost
AlliedModders Donor
Join Date: Mar 2014
Location: Tomorrowland
Old 10-27-2018 , 17:38   Re: random players not spawning
Reply With Quote #3

I used to use switch statement too, but same result

PHP Code:
public StartRespawnCheck(id
{
    
id -= TASKID
    
if(is_user_connected(id))
    {
        if(!
is_user_alive(id) && !is_user_bot(id))
        {
            if(
is_in_a_team(id))
            {
            
/*switch( cs_get_user_team(id) ) 
            {
                case CS_TEAM_T, CS_TEAM_CT : 
                {*/
                
ExecuteHamB(Ham_CS_RoundRespawnid);
                return;
            }
                
set_task(get_pcvar_float(pCvarRespawnDelayOnServerJoin), "StartRespawnCheck"id TASKID)
        } else return;
    }
}

stock is_in_a_team(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_CT || cs_get_user_team(id) == CS_TEAM_T)
        return 
PLUGIN_HANDLED
    
return PLUGIN_CONTINUE
}

//public PlayerKilledPost(victim, attacker, shouldgib) 
public OnCBasePlayer_Killed_Post(id)
{
    if(!
is_user_connected(id))
        return;
    if(
is_user_alive(id))
        return;
    if(
task_exists(id TASKID))
        
remove_task(id TASKID)
    
set_task(get_pcvar_float(pCvarRespawnDelayOnDeath), "StartRespawnCheck"id TASKID)

Same goes for playerkilledpost, nothing changed, and also ExecuteHam instead of HamB.
__________________

Last edited by SomewhereLost; 10-27-2018 at 17:39.
SomewhereLost is offline
Send a message via Skype™ to SomewhereLost
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 10-28-2018 , 15:46   Re: random players not spawning
Reply With Quote #4

Try

PHP Code:

#define isTeam(%0)      (CS_TEAM_T <= cs_get_user_team(%0) <= CS_TEAM_CT)

public StartRespawnCheck(TaskId
{
    new 
id TaskId TASKID
    
    
if(is_user_connected(id))
    {
        if(
isTeam(id))
        {
            
ExecuteHamB(Ham_CS_RoundRespawnid);
            return;
        }
        
set_task(get_pcvar_float(pCvarRespawnDelayOnServerJoin), "StartRespawnCheck"id TASKID)
    }
}

//public PlayerKilledPost(victim, attacker, shouldgib) 
public OnCBasePlayer_Killed_Post(id)
{
if(!
is_user_connected(id))
    return;
    if(
is_user_alive(id))
        return;
    if(
task_exists(id TASKID))
        
remove_task(id TASKID)
    
set_task(get_pcvar_float(pCvarRespawnDelayOnDeath), "StartRespawnCheck"id TASKID)

I would call "StartRespawnCheck" on putinserver with 3 second delay.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 10-28-2018 at 15:46.
iceeedr is offline
Send a message via Skype™ to iceeedr
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 17:51.


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