AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved End Round plugin help needed (https://forums.alliedmods.net/showthread.php?t=327531)

FAQU 09-25-2020 00:23

End Round plugin help needed
 
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.

PC Gamer 09-25-2020 02:03

Re: End Round plugin help needed
 
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;



FAQU 09-25-2020 02:40

Re: End Round plugin help needed
 
Thank you so much ! It works like a charm. :)


All times are GMT -4. The time now is 06:01.

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