Yes, Should work. But You Have add this too , according to @HeXman fastrestart has to be called when a player is connected and ingame , so you have to add this before the fast restart; it waits 60 seconds to make sure everybody is connected.
also if you dont want this , you can restart it manally.
Code:
using system.threading
public override void OnMapChange()
{
thread.Sleep(60000);
servercommand("fast_restart");
}
EDIT:
SOLVED
Work Perfectly now for me, thank you Hexman for the plugin and OzonE for the great help.
it work good but i want to disable the cursor and some other shits of softcore plz answer me
I cant compile because of this error!
Error 1 'plugin_test.plugin_test.OnFastRestart()': no suitable method found to override
Whats problem?
Code:
Saeed Jan Ba Ejze :P
fuck it , i made one for ya.
New Version :
Fast Restart After 60 Seconds
Fast restart Alert On Chat.
Game Is Now L!VE On Chat.
Because Of Open Source FTW , Here Is The Source:
Code:
using System;
using System.Collections.Generic;
using Addon;
using System.Threading;
namespace plugin_test
{
public class plugin_test : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("Semi Hardcore Plugin 2.0 By HeXman, Edited By OzonE : Loaded!");
}
public override void OnMapChange()
{
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
Thread.Sleep(60000);
ServerCommand("fast_restart");
ServerSay("Game Is Now ^2L!VE",true);
}
public override void OnFastRestart()
{
hardcore();
}
public override void OnPlayerConnect(ServerClient Client)
{
SetClientDvar(Client.ClientNum, "g_hardcore \"1\"");
SetClientDvar(Client.ClientNum, "cg_drawCrosshair \"0\"");
SetClientDvar(Client.ClientNum, "cg_scoreboardPingText \"1\"");
}
public void hardcore()
{
foreach (ServerClient client in GetClients())
{
SetClientDvar(client.ClientNum, "g_hardcore \"1\"");
SetClientDvar(client.ClientNum, "cg_drawCrosshair \"0\"");
SetClientDvar(client.ClientNum, "cg_scoreboardPingText \"1\"");
}
}
}
}
DLL File Attached Now
EDIT : add me +rep
(04-24-2012, 09:07)OzonE Wrote: [ -> ]Code:
Saeed Jan Ba Ejze :P
fuck it , i made one for ya.
New Version :
Fast Restart After 60 Seconds
Fast restart Alert On Chat.
Game Is Now L!VE On Chat.
Because Of Open Source FTW , Here Is The Source:
Code:
using System;
using System.Collections.Generic;
using Addon;
using System.Threading;
namespace plugin_test
{
public class plugin_test : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("Semi Hardcore Plugin 2.0 By HeXman, Edited By OzonE : Loaded!");
}
public override void OnMapChange()
{
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
ServerSay("^1Warm Up! ^2Fast Restart In ^360 ^2Seconds!",true);
Thread.Sleep(60000);
ServerCommand("fast_restart");
ServerSay("Game Is Now ^2L!VE",true);
}
public override void OnFastRestart()
{
hardcore();
}
public override void OnPlayerConnect(ServerClient Client)
{
SetClientDvar(Client.ClientNum, "g_hardcore \"1\"");
SetClientDvar(Client.ClientNum, "cg_drawCrosshair \"0\"");
SetClientDvar(Client.ClientNum, "cg_scoreboardPingText \"1\"");
}
public void hardcore()
{
foreach (ServerClient client in GetClients())
{
SetClientDvar(client.ClientNum, "g_hardcore \"1\"");
SetClientDvar(client.ClientNum, "cg_drawCrosshair \"0\"");
SetClientDvar(client.ClientNum, "cg_scoreboardPingText \"1\"");
}
}
}
}
DLL File Attached Now
This is doing EXACTLY want I wanted, thank you very much. Finally no more typing fast_respawn on server console.......