Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #define PLUGIN_VERSION "1.0"
- public Plugin:myinfo = {
- name = "X",
- author = "X",
- description = "X",
- version = PLUGIN_VERSION
- };
- static Handle:timer = INVALID_HANDLE;
- static notification_number;
- public OnPluginStart() {
- CreateConVar("round_end_slay_ver", PLUGIN_VERSION, "Round end slay version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
- HookEvent("round_start", on_round_start);
- }
- public on_round_start(Handle:event, const String:name[], bool:dontBroadcast) {
- if (timer != INVALID_HANDLE) // round restarted before end
- CloseHandle(timer);
- new Float:length = GetConVarFloat(FindConVar("mp_roundtime")) * 60.0 - 6.0;
- LogMessage("End round slay in %f seconds", length);
- notification_number = 5;
- timer = CreateTimer(length, on_round_time_end);
- }
- public OnMapEnd() {
- if (timer != INVALID_HANDLE) {
- CloseHandle(timer);
- timer = INVALID_HANDLE;
- }
- }
- public Action:on_round_time_end(Handle:timer_) {
- if (notification_number > 0) {
- PrintCenterTextAll("Round ending in %d seconds", notification_number);
- timer = CreateTimer(1.0, on_round_time_end);
- --notification_number;
- }
- else {
- timer = INVALID_HANDLE;
- LogMessage("Time up");
- for (new client=1; client<=MaxClients; ++client) {
- if (IsClientInGame(client) && !IsClientObserver(client) && IsPlayerAlive(client)) {
- for(int j = 0; j < 4; j++)
- {
- int weapon = GetPlayerWeaponSlot(client, j);
- if(weapon != -1)
- {
- RemovePlayerItem(client, weapon);
- RemoveEdict(weapon);
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement