AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Fireevent for game over? (https://forums.alliedmods.net/showthread.php?t=143141)

retsam 11-14-2010 22:05

Fireevent for game over?
 
My brain is fried.....

Is there a way to fireevent in a way to end the map and force a mapchange, rather than using changelevel to change it? I couldnt think if that is possible or not....

Like how at the end of maptime, it displays the scoreboard and gives a slight delay before changing the map?

pheadxdll 11-14-2010 22:11

Re: Fireevent for game over?
 
Firing the event game_over won't do anything as you guessed.

You can call CMultiplayRules::EndMultiplayerGame though and it will end the game, like gungame does. I happen to have some code to do it in linux:

Code:

    StartPrepSDKCall(SDKCall_GameRules);
    PrepSDKCall_SetSignature(SDKLibrary_Server, "@_ZN15CMultiplayRules18EndMultiplayerGameEv", 0);
    g_hEndGame = EndPrepSDKCall();
    if(g_hEndGame == INVALID_HANDLE)
    {
        SetFailState("Could not locate signature for CMultiplayRules::EndMultiplayerGame!");
        return;
    }


retsam 11-14-2010 22:29

Re: Fireevent for game over?
 
Right. Ya I had already tried the fireevent game_over deal heh.

Ok cool. So...thats linux only huh? Happen to have sig for windows?

That is basically what I was looking for.

pheadxdll 11-14-2010 23:08

Re: Fireevent for game over?
 
Try using these offsets, its a virtual function:

Windows: 118
Linux: 119

Edit: Just checked out gungame, it's exactly the same. It should work fine for you.

retsam 11-14-2010 23:15

Re: Fireevent for game over?
 
Thanks man, ill mess with it.


All times are GMT -4. The time now is 12:39.

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