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

How ChangeLevel with Hook


Post New Thread Reply   
 
Thread Tools Display Modes
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 01-17-2016 , 04:55   Re: How ChangeLevel with Hook
Reply With Quote #11

You want to change map so no any other plugin or function could hook this event?
siriusmd99 is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 01-17-2016 , 05:03   Re: How ChangeLevel with Hook
Reply With Quote #12

Source Solved: http://zyl.pestermom.com/external/en.../game_end.html
Gold Source: ?
Change Map with Intermission
Vit_amin is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-17-2016 , 05:55   Re: How ChangeLevel with Hook
Reply With Quote #13

Instead of repeating "with intermission", you should explain what intermission is. I guess it's that little pause before changing map, where all entities stop, but I am not entirely sure. If so, you could probably execute it with:
PHP Code:
message_begin(MSG_ALL30);
message_end(); 
klippy is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-17-2016 , 06:35   Re: How ChangeLevel with Hook
Reply With Quote #14

Quote:
Originally Posted by KliPPy View Post
message_begin(MSG_ALL, SVC_INTERMISSION);
message_end();
Fixed.
__________________

Last edited by Arkshine; 01-17-2016 at 06:35.
Arkshine is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-17-2016 , 06:46   Re: How ChangeLevel with Hook
Reply With Quote #15

Quote:
Originally Posted by Arkshine View Post
Fixed.
I am wondering why I've never noticed there are SVC_ constants in messages_const.inc. Strange.
klippy is offline
Vit_amin
Senior Member
Join Date: Dec 2015
Location: Russian Federation
Old 01-17-2016 , 13:23   Re: How ChangeLevel with Hook
Reply With Quote #16

Thank you!
Vit_amin is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 01-18-2016 , 04:13   Re: How ChangeLevel with Hook
Reply With Quote #17

Here, I used Orpheu to achieve what you wanted. It will automatically change the map and everything - just the way game does it. The function is void CHalfLifeMultiplay::GoToIntermission(void). Run "say endgame" command to see it in action.
PHP Code:
#include <amxmodx>
#include <orpheu>
#include <orpheu_stocks>


#define PLUGIN "GoToIntermission"
#define VERSION "v1.0.0"
#define AUTHOR "KliPPy"


new g_pGameRules;
new 
OrpheuFunctiong_pfnGoToIntermission;


public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say endgame""cmdEndGame");
}

public 
plugin_precache() {
    
OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"), "OnInstallGameRules"OrpheuHookPost);
}

public 
OnInstallGameRules() {
    
g_pGameRules OrpheuGetReturn();
    
g_pfnGoToIntermission OrpheuGetFunctionFromObject(g_pGameRules"GoToIntermission""CHalfLifeMultiplay");
}

public 
cmdEndGame() {
    
OrpheuCallSuper(g_pfnGoToIntermissiong_pGameRules);

Attached Files
File Type: zip orpheu.zip (1.4 KB, 47 views)

Last edited by klippy; 01-18-2016 at 04:14.
klippy is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-18-2016 , 13:54   Re: How ChangeLevel with Hook
Reply With Quote #18

Orpheu is not needed to do this. Just send the intermission event and then set a task to change the map.
__________________
fysiks is offline
slLent
Member
Join Date: Apr 2010
Location: Tomsk, Russia
Old 08-01-2016 , 12:01   Re: How ChangeLevel with Hook
Reply With Quote #19

Quote:
Originally Posted by KliPPy View Post
Here, I used Orpheu to achieve what you wanted. It will automatically change the map and everything - just the way game does it. The function is void CHalfLifeMultiplay::GoToIntermission(void). Run "say endgame" command to see it in action.
The same can be done without orpheu.

PHP Code:
public _InterMission()
{
    new 
iEnt engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"game_end"));
    if (
iEnt) {
        
ExecuteHam(Ham_UseiEntiEntiEnt00.0);
        
engfunc(EngFunc_RemoveEntityiEnt);
    }

__________________
slLent is offline
Old 08-01-2016, 13:00
Craxor
This message has been deleted by Craxor. Reason: Bad ^oo^
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 15:49.


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