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

Changemap 0 client


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ganesh
Junior Member
Join Date: Mar 2017
Old 03-29-2017 , 03:31   Changemap 0 client
Reply With Quote #1

(sorry for my english)
Hey guy's ! i need help for a plugin look this exemple (is doesn't work for me)
https://pastebin.com/taHkfgGi

i need a plugin for change map when the last client leave the server
with a timer (ex: last client leave the server, 60s... and change map for mg_CHOOSEYOURMAP_V3)

Thxs

Tom
Ganesh is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 03-29-2017 , 04:33   Re: Changemap 0 client
Reply With Quote #2

You can modify this one

-- but use ForceChangeLevel instead of ServerCommand

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

public Plugin:myinfo =
{
    
name "SetDefaultMap",
    
author "Raska",
    
description "",
    
version "0.1",
    
url ""
}

new 
Handle:gh_Timer INVALID_HANDLE;

public 
OnClientDisconnect_Postclient )
{
    if( 
IsServerEmpty() )
    {
        if( 
gh_Timer != INVALID_HANDLE )
        {
            
KillTimergh_Timer );
            
gh_Timer INVALID_HANDLE;
        }
        
        
gh_Timer CreateTimer60.0Timer_CheckStatus );
    }
}

public 
Action:Timer_CheckStatusHandle:timerany:client )
{
    if( 
IsServerEmpty() )
        
ServerCommand"sm_map surf_10x_reloaded" );
    
    
gh_Timer INVALID_HANDLE;
    
    return 
Plugin_Continue;
}

IsServerEmpty()
{
    return ( 
GetTeamClientCountCS_TEAM_T ) == && GetTeamClientCountCS_TEAM_CT ) == )

__________________
Plugins: TeamGames
Includes: Menu stocks, ColorVariables, DownloadTableConfig

> No help through PM, make a topic.
KissLick is offline
Ganesh
Junior Member
Join Date: Mar 2017
Old 03-29-2017 , 09:48   Re: Changemap 0 client
Reply With Quote #3

Quote:
Originally Posted by KissLick View Post
You can modify this one

-- but use ForceChangeLevel instead of ServerCommand

PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

public Plugin:myinfo =
{
    
name "SetDefaultMap",
    
author "Raska",
    
description "",
    
version "0.1",
    
url ""
}

new 
Handle:gh_Timer INVALID_HANDLE;

public 
OnClientDisconnect_Postclient )
{
    if( 
IsServerEmpty() )
    {
        if( 
gh_Timer != INVALID_HANDLE )
        {
            
KillTimergh_Timer );
            
gh_Timer INVALID_HANDLE;
        }
        
        
gh_Timer CreateTimer60.0Timer_CheckStatus );
    }
}

public 
Action:Timer_CheckStatusHandle:timerany:client )
{
    if( 
IsServerEmpty() )
        
ServerCommand"sm_map surf_10x_reloaded" );
    
    
gh_Timer INVALID_HANDLE;
    
    return 
Plugin_Continue;
}

IsServerEmpty()
{
    return ( 
GetTeamClientCountCS_TEAM_T ) == && GetTeamClientCountCS_TEAM_CT ) == )

it's good ! Thxs man.

Last edited by Ganesh; 03-30-2017 at 11:12. Reason: Bug
Ganesh 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 10:26.


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