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

round end rr?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Robin955
Veteran Member
Join Date: Jun 2013
Old 05-27-2015 , 10:51   round end rr?
Reply With Quote #1

usually when the timer hits 0 the round goes on if there is no objectives in the map like bomb zone or hostages.

when i goto sourcemod plugins and search round end all i find is for example round end slay. i notice that this round end slay kinda crashes my server when 20-30 ppl, so need just a simple rr and for example the timer.
so it counts down 5-4-3-2-1 and then sm_rr

someone who can simply modify this if thats possible into just running sm_rr?
Spoiler

Last edited by Robin955; 05-27-2015 at 10:51.
Robin955 is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 05-27-2015 , 13:05   Re: round end rr?
Reply With Quote #2

I'm not sure that's possible.
Miu is offline
Robin955
Veteran Member
Join Date: Jun 2013
Old 05-27-2015 , 13:12   Re: round end rr?
Reply With Quote #3

well if i can do sm commands on round start i know i can do it on round end :p
Robin955 is offline
DoPe^
Veteran Member
Join Date: Jul 2008
Location: Denmark / Copenhagen
Old 05-27-2015 , 13:35   Re: round end rr?
Reply With Quote #4

Quote:
Originally Posted by Robin955 View Post
usually when the timer hits 0 the round goes on if there is no objectives in the map like bomb zone or hostages.

when i goto sourcemod plugins and search round end all i find is for example round end slay. i notice that this round end slay kinda crashes my server when 20-30 ppl, so need just a simple rr and for example the timer.
so it counts down 5-4-3-2-1 and then sm_rr

someone who can simply modify this if thats possible into just running sm_rr?
Spoiler

PHP Code:
 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);
    
HookEvent("round_end"Event_RoundEnd);
}



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(lengthon_round_time_end);
}

public 
Action:Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
client GetClientOfUserId(GetEventInt(event"userid"));

       do 
stuff...
}



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.0on_round_time_end);
        --
notification_number;
    }
    else {
        
timer INVALID_HANDLE;
        
LogMessage("Time up");
        for (new 
client=1client<=MaxClients; ++client) {
            if (
IsClientInGame(client) && !IsClientObserver(client) && IsPlayerAlive(client)) {
                new 
deaths GetEntProp(clientProp_Data"m_iDeaths");
                
SetEntProp(clientProp_Data"m_iDeaths"deaths-1);
                new 
kills GetEntProp(clientProp_Data"m_iFrags");
                
SetEntProp(clientProp_Data"m_iFrags"kills+1);
                
ForcePlayerSuicide(client);
            }
        }
    }

?
__________________

Last edited by DoPe^; 05-27-2015 at 13:37.
DoPe^ is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 05-27-2015 , 13:36   Re: round end rr?
Reply With Quote #5

Really? How? I didn't think it was possible
Miu is offline
DoPe^
Veteran Member
Join Date: Jul 2008
Location: Denmark / Copenhagen
Old 05-27-2015 , 13:43   Re: round end rr?
Reply With Quote #6

Quote:
Originally Posted by Miu View Post
Really? How? I didn't think it was possible
I just thougt he was looking for the round_end event, didnt know it was a already made plugin he wanted fixed.
__________________
DoPe^ is offline
Kailo
Senior Member
Join Date: Sep 2014
Location: Moscow, Russia
Old 05-27-2015 , 14:23   Re: round end rr?
Reply With Quote #7

PHP Code:
#include <cstrike>

public void OnPluginStart()
{
    
RegConsoleCmd("sm_rr"Command_RR)
}

public 
Action Command_RR(int clientint args)
{
    
CS_TerminateRound(5.0CSRoundEnd_Draw)

Kailo is offline
Robin955
Veteran Member
Join Date: Jun 2013
Old 05-28-2015 , 04:25   Re: round end rr?
Reply With Quote #8

Kailo that doesn't compile btw.

i tried one of my own sp's but that didn't go well.

how come? all i want is server to do sm_rr at round end. not to slay nobody cause if it slays 20-30 ppl at once somethimes it crashes the server! also i run a rpg where suiciding = loss of exp so if this happends when its about to update the mysql table for players exp / levels and upgrades it can also mess that up and i need mapchange / restart of server to get all the mysql plugins running again.

whops, i simply tried this and that made every client do sm_rr hah. 20 restarts at once but it didnt crash the server atleast.

Spoiler

Last edited by Robin955; 05-28-2015 at 05:04.
Robin955 is offline
Robin955
Veteran Member
Join Date: Jun 2013
Old 05-28-2015 , 05:27   Re: round end rr?
Reply With Quote #9

Quote:
Originally Posted by DoPe^ View Post
I just thougt he was looking for the round_end event, didnt know it was a already made plugin he wanted fixed.
how do i make it like this? as you said do stuff on the line you added but guess we just need a diff line.

Spoiler
Robin955 is offline
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 05-28-2015 , 10:30   Re: round end rr?
Reply With Quote #10

Quote:
Originally Posted by Robin955 View Post
whops, i simply tried this and that made every client do sm_rr hah. 20 restarts at once but it didnt crash the server atleast.

Spoiler
Well, have a look at your own code...

It's pretty obvious... If you only want to do it once, you shouldn't loop through all your alive players and then execute commands. If you got 2 alive players, it would run twice. If you got 20, it would run 20 times....
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL 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 13:33.


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