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

[CS:GO] Hooks


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SnowWolf
Junior Member
Join Date: Sep 2017
Old 01-12-2018 , 19:35   [CS:GO] Hooks
Reply With Quote #1

Hello i search some hooks..

I know this web : https://wiki.alliedmods.net/Counter-...fensive_Events

But on this web i can't find :
- hook for warm-up end
- hook for half of match
- hook for end of match

does anyone know any?
SnowWolf is offline
pride95
Senior Member
Join Date: Aug 2015
Old 01-13-2018 , 05:45   Re: [CS:GO] Hooks
Reply With Quote #2

cs_intermission for end of the match. if you change the map via sm_map this event is not hooked.
announce_phase_end for warmup end, half end and match end.

hook them and send a message via LogMessage to check when these events are hooked.

Last edited by pride95; 01-13-2018 at 05:45.
pride95 is offline
SnowWolf
Junior Member
Join Date: Sep 2017
Old 01-13-2018 , 06:31   Re: [CS:GO] Hooks
Reply With Quote #3

Sory. but i dont understand, i make good?

//===== HOOKS =====//
public OnPluginStart() {
LoadTranslations("sbot.phrases");
HookEvent("announce_phase_end", metchstart);
HookEvent("half end", halfinfo);
HookEvent("cs_intermission", metchend);
}

//===== ACTION =====//
public metchstart(Handle:event, const String:name[], bool:dontBradcast)
{
CPrintToChatAll(PREFIX, "poczatekmeczu");
CPrintToChatAll(PREFIX, "poczatekmeczu");
CPrintToChatAll(PREFIX, "poczatekmeczu");
}
SnowWolf is offline
pride95
Senior Member
Join Date: Aug 2015
Old 01-13-2018 , 07:38   Re: [CS:GO] Hooks
Reply With Quote #4

PHP Code:
HookEvent("cs_intermission"Event_MapEnd);
HookEvent("announce_phase_end"Event_Phase);

public 
Action Event_MapEnd(Event event, const char[] namebool dontBroadcast
{
        
PrintToChatAll("Map end");
}

public 
Action Event_Phase(Event event, const char[] namebool dontBroadcast
{
        
PrintToChatAll("Warmup end, half time or match end");

you should use a global variable: iPhase;
OnMapStart: iPhase = 0;

and in announce_phase_end you increase iPhase++;
if(iPhase == 1) then warmup end
if(iPhase == 2) then half time
if(iPhase == 3) then match end

i use
PHP Code:
    int iEntity CreateEntityByName("game_end");
    
DispatchSpawn(iEntity);
    
AcceptEntityInput(iEntity"EndGame"); 
in command_map instead of forcechangelevel cause i need to hook the end of the map before OnMapEnd() when map is changed;

Last edited by pride95; 01-13-2018 at 07:55.
pride95 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 07:57.


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