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

Solved End Round plugin help needed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
FAQU
Member
Join Date: Sep 2020
Location: Romania
Old 09-25-2020 , 00:23   End Round plugin help needed
Reply With Quote #1

I started working on a small endround plugin, however I wanted it to use the "mp_round_restart_delay" value as the delay amount for CS_TerminateRound.
I'm a complete noob when it comes to scripting, and I can't seem to figure out what I did wrong on my own. If anyone could help me, it'll be highly appreciated.

(Argument type mismatch on line 31; Tag mismatch on lines 31 and 32)

This is what I did so far :
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo 
{
    
name "EndRound",
    
author "FAQU",
    
description "Ends the current round with a draw",
    
version "0.1"
};

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_endround"EndRoundADMFLAG_GENERIC"End the current round with a draw");
    
RegAdminCmd("sm_er"EndRoundADMFLAG_GENERIC"End the current round with a draw");
}


public 
Action EndRound(int clientint args)
{
    if (
args 0)
    {
        
ReplyToCommand(client"[SM] Usage: sm_endround");
        return 
Plugin_Handled;
    }
    
    
Handle hDelay GetConVarFloat("mp_round_restart_delay");
    
CS_TerminateRound(hDelayCSRoundEnd_Drawtrue);
    return 
Plugin_Handled;

Sorry for my bad english.

Last edited by FAQU; 09-25-2020 at 09:11.
FAQU is offline
PC Gamer
Veteran Member
Join Date: Mar 2014
Old 09-25-2020 , 02:03   Re: End Round plugin help needed
Reply With Quote #2

I don't run a Counter Strike server so I didn't test the terminate round code found on a post by XHeadHunterX.

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

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo 
{
    
name "EndRound",
    
author "FAQU",
    
description "Ends the current round with a draw",
    
version "0.2"
}

public 
void OnPluginStart()
{
    
RegAdminCmd("sm_endround"EndRoundADMFLAG_GENERIC"End the current round with a draw");
    
RegAdminCmd("sm_er"EndRoundADMFLAG_GENERIC"End the current round with a draw");
}


public 
Action EndRound(int clientint args)
{

    if (
args 0)
    {
        
ReplyToCommand(client"[SM] Usage: sm_endround");
        return 
Plugin_Handled;
    }

    
CS_TerminateRound(GetConVarFloat(FindConVar("mp_round_restart_delay")), CSRoundEnd_Drawtrue);
    return 
Plugin_Handled;

PC Gamer is offline
FAQU
Member
Join Date: Sep 2020
Location: Romania
Old 09-25-2020 , 02:40   Re: End Round plugin help needed
Reply With Quote #3

Thank you so much ! It works like a charm.
FAQU is offline
Reply


Thread Tools
Display Modes

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 04:12.


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