Raised This Month: $ Target: $400
 0% 

[REQ] Automatic silent restart after first player joins


Post New Thread Reply   
 
Thread Tools Display Modes
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 04-23-2015 , 09:51   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #11

I'll wait for Kia, since he's coded a new zombie escape and he's good, to see if he can fix it. If not, than i'll search for an auto restart.

Last edited by PinHeaDi; 04-23-2015 at 10:17.
PinHeaDi is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 04-23-2015 , 11:14   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #12

Don't expect much from me too soon, I'm busy.
__________________
Kia is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-23-2015 , 11:28   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #13

@PinHeaDi it is a requirement on this forum that the module source code be made available. Without it, do not post code that requires the module to run.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Kz1.0
Senior Member
Join Date: Jan 2013
Location: Vietnam
Old 04-23-2015 , 12:04   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #14

Why don't you use Kia's ZE ? Dias's one is very bugged.
Kz1.0 is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-23-2015 , 12:17   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #15

Hook Game Commencing if i understand correctly your problem
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 04-23-2015 , 12:37   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #16

Quote:
Originally Posted by Kz1.0 View Post
Why don't you use Kia's ZE ? Dias's one is very bugged.
I have my reasons. This version is not bugged as previous ones.

Quote:
Originally Posted by ^SmileY View Post
Hook Game Commencing if i understand correctly your problem
If you can explain me how.

// Event
register_event("HLTV", "event_newround", "a", "1=0", "2=0")
register_logevent("event_roundend", 2, "1=Round_End")
register_event("TextMsg","event_roundend","a" ,"2=#Game_Commencing","2=#Game_will_restart_i n")
register_event("CurWeapon", "event_CurWeapon", "be", "1=1")

Those are the events.

P.S.: Yeah, it seems like the game doesn't commence after a player joins, only after two or more of them.

Last edited by PinHeaDi; 04-23-2015 at 13:38.
PinHeaDi is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 04-23-2015 , 21:20   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #17

The game will only starts when have 2 players 1 T, and 1 CT this is the logic of game, you can put sv_restart 1 at server.cfg and see if that plugin will be fixed.
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 04-24-2015 , 03:14   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #18

Quote:
Originally Posted by ^SmileY View Post
The game will only starts when have 2 players 1 T, and 1 CT this is the logic of game, you can put sv_restart 1 at server.cfg and see if that plugin will be fixed.
Not working.. well guess i'll stick with my request for the silent restart on player join.

P.S.: So basically I need a plugin, that will trigger an auto restart on every map once just after the first player joins.

Last edited by PinHeaDi; 04-24-2015 at 04:31.
PinHeaDi is offline
JusTGo
Veteran Member
Join Date: Mar 2013
Old 04-24-2015 , 06:53   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #19

try this:
PHP Code:
#include <amxmodx>
#include <cstrike>

new g_MaxPlayers

public plugin_init() 
{
    
register_logevent("JoinTeam"3"1=joined team")
    
g_MaxPlayers get_maxplayers()
}

public 
JoinTeam() {
    new 
loguser[80], name[32]
    
read_logargv(0loguser79)
    
parse_loguser(logusername31)

    new 
id get_user_index(name)
    
    if( 
is_user_bot(id) && !is_user_connected(id) && GetPlayingCount() > )
        return

    new 
temp[2]    
    
read_logargv(2temp1)
    switch(
temp[0])
    {
        case 
'T' :
        {
            
server_cmd("sv_restart 3")
        }
        case 
'C' :
        {
            
server_cmd("sv_restart 3")
        }
        case 
'S' :
        {
        }
    }
}

GetPlayingCount()
{
    new 
iPlayingidCsTeams:team
    
    
for (id 1id <= g_MaxPlayersid++)
    {
        if (!
is_user_connected(id))
            continue;
        
        
team cs_get_user_team(id)
        
        if (
team != CS_TEAM_SPECTATOR && team != CS_TEAM_UNASSIGNED)
            
iPlaying++
    }
    
    return 
iPlaying;

JusTGo is offline
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 04-24-2015 , 07:16   Re: [REQ] Automatic silent restart after first player joins
Reply With Quote #20

Quote:
Originally Posted by JusTGo View Post
try this:
PHP Code:
#include <amxmodx>
#include <cstrike>

new g_MaxPlayers

public plugin_init() 
{
    
register_logevent("JoinTeam"3"1=joined team")
    
g_MaxPlayers get_maxplayers()
}

public 
JoinTeam() {
    new 
loguser[80], name[32]
    
read_logargv(0loguser79)
    
parse_loguser(logusername31)

    new 
id get_user_index(name)
    
    if( 
is_user_bot(id) && !is_user_connected(id) && GetPlayingCount() > )
        return

    new 
temp[2]    
    
read_logargv(2temp1)
    switch(
temp[0])
    {
        case 
'T' :
        {
            
server_cmd("sv_restart 3")
        }
        case 
'C' :
        {
            
server_cmd("sv_restart 3")
        }
        case 
'S' :
        {
        }
    }
}

GetPlayingCount()
{
    new 
iPlayingidCsTeams:team
    
    
for (id 1id <= g_MaxPlayersid++)
    {
        if (!
is_user_connected(id))
            continue;
        
        
team cs_get_user_team(id)
        
        if (
team != CS_TEAM_SPECTATOR && team != CS_TEAM_UNASSIGNED)
            
iPlaying++
    }
    
    return 
iPlaying;

It does actually work, but its restarting every time when I join my server. And since I need only one restart at a map, can you make somehow to check if there was already one restart, and if it was restarted, not to do a second restart.
PinHeaDi 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 06:15.


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