View Single Post
Author Message
chancsomy
Junior Member
Join Date: Sep 2013
Old 02-11-2015 , 09:21   [CSGO]What command can only let the plugin only run 1 time?
Reply With Quote #1

i am scripting a knife round plugin.but once i activate this plugin . no matter it is a knife round or normal round. it says knife round start....
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <cstrike>

public OnPluginStart()
{
    
RegAdminCmd("sm_knife"knifeADMFLAG_SLAY"knife round");
}

public 
Action:knife(clientargs)
{
    
ServerCommand("exec knife.cfg");
    
PrintToChatAll("[\x05HKG\x01] \x04knife round begins in 10 seconds");
    
HookEvent("round_start"Event_RoundStart);
    
HookEvent("round_end"Event_RoundEnd);
}

public 
Event_RoundStart(Handle:event, const String:name[], bool:dontBroadcast)
{
    
PrintToChatAll("[\x05HKG\x01] \x04knife round starts!");
    return;
}

public 
Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
{
    if(
GetTeamScore(CS_TEAM_T) == 1){
        
PrintToChatAll("[\x05HKG\x01] \x04T WON");
        return;
    }
    else{
        
PrintToChatAll("[\x05HKG\x01] \x04CT WON");
        return;
    }

btw.sorry for my bad english hope u guys can know what i am saying

Last edited by chancsomy; 02-11-2015 at 09:25.
chancsomy is offline