Thread: changelevel
View Single Post
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 06-07-2012 , 09:59   Re: changelevel
Reply With Quote #5

Quote:
Originally Posted by jimaway View Post
public server_changelevel ( map[] )
There's no return for that forward. It's called afterwards.


You can't actually hook CGameRules::ChangeLevel, use GoToIntermission instead. The advantage of this is that it will not be called when a server admin changes the map via amxmodmenu or amx_map:

Code:
#include <amxmodx> #include <orpheu> #include <orpheu_stocks> new g_pGameRules; public plugin_precache() {     OrpheuRegisterHook( OrpheuGetFunction( "InstallGameRules" ), "On_InstallGameRules", OrpheuHookPost ); } public plugin_init() {     OrpheuRegisterHookFromObject( g_pGameRules, "GoToIntermission", "CGameRules", "On_GoToIntermission" ); } public On_InstallGameRules() {     g_pGameRules = OrpheuGetReturn(); } public OrpheuHookReturn: On_GoToIntermission() {     /* Change level / set short task to change level here / change amx_nextmap */ }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline