AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Round End & Restart Events (https://forums.alliedmods.net/showthread.php?t=77354)

xPaw 09-11-2008 10:48

Round End & Restart Events
 
hi i got when the event calls restart or round end it call one same event but 2 times i need only one
PHP Code:

    register_logevent("eRandromize"2"1=Round_End")
    
register_event("TextMsg""eRandromize""a""2&#Game_C""2&#Game_w"

possible to do it in one line?

Exolent[jNr] 09-11-2008 11:26

Re: Round End & Restart Events
 
My understanding was that RestartRound and RoundEnd were being called at the same time, which executed your plugin's RoundEnd funtion twice?
If so, use this:

Code:
new bool:g_handle_round_end; public plugin_init() {   register_event("HLTV", "EventNewRound", "a", "1=0", "2=0");   register_event("TextMsg", "EventRoundEnd", "a", "2&#Game_C", "2&#Game_w");   register_logevent("EventRoundEnd", 2, "1=Round_End"); } public EventNewRound() {   g_handle_round_end = true; } public EventRoundEnd() {   if( !g_handle_round_end ) return;     g_handle_round_end = false;     // add your round end code here }

If this is not the case, please explain again :grrr:

xPaw 09-11-2008 11:36

Re: Round End & Restart Events
 
i just want when rr or roundend it call one function named eRandromise, not for example
rr - event_restart
round end - event_roundend

becuz when i use in event rr and round end same function

its being called 2 times when i restartround

Exolent[jNr] 09-11-2008 11:39

Re: Round End & Restart Events
 
That's what mine does, if you would read and understand the code.

EDIT: I just simplified the code.

xPaw 09-11-2008 11:43

Re: Round End & Restart Events
 
okay thanks, but possible do like

PHP Code:

register_event("TextMsg""EventRoundEndOrRestart""a""2&#Game_C""2&#Game_w""2&#Cstrike_TitlesTXT_CTs_Win""2&#Cstrike_TitlesTXT_Terrorists_Win""2&#Cstrike_TitlesTXT_Round_Draw"); 

i know looks like... :D

Exolent[jNr] 09-11-2008 11:45

Re: Round End & Restart Events
 
Why don't you use the Message Logging plugin by DamagedSoul, and then find if there are TextMsg events when the round ends.
Then, you can take those and register the event and try it out yourself.

xPaw 09-11-2008 12:07

Re: Round End & Restart Events
 
Quote:

Message Logging plugin by DamagedSoul
cant find

fxfighter 09-11-2008 12:50

Re: Round End & Restart Events
 
here


All times are GMT -4. The time now is 03:13.

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