Raised This Month: $60 Target: $400
 15% 

Bomb explosion triggers an event twice


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stanciu
Junior Member
Join Date: Mar 2016
Location: Romania
Old 10-14-2020 , 07:50   Bomb explosion triggers an event twice
Reply With Quote #1

Hello,

Stumbled upon an error.

I have:

PHP Code:
register_event("SendAudio""eventTCastiga""a""2&%!MRAD_terwin"
Then

PHP Code:
public eventTCastiga()
{
    if(
g_MixInceput)
    {
        
g_ScorEchipaT++
    }

Which basically adds +1 score to TERRORRISTS.

Then I have this text that displays at the end of the round, which basically states the score and the overall number of rounds.

PHP Code:
if(g_ScorEchipaT != 16 && g_ScorEchipaCT != 16)
            
ColorChat(0GREEN"^1Runda ^4%d^1 s-a sfarsit. Scor: ^3[TERRORISTS] ^4%d ^1- ^4%d ^3[COUNTER-TERRORISTS]"g_NumarRundeTotalg_ScorEchipaTg_ScorEchipaCT
But if I plant the bomb and the bomb explodes, it adds +2 score to the TERRORISTs. Displays the score twice as well.

Example: Round 3 finished. Score: TERRORISTS 2 - 1 COUNTER TERRORISTS.
then displays again Round 4 finished. Score TERRORISTS 3 - 1 COUNTER TERRORISTS.

TL;DR bomb explosion adds +2 score instead of +1 and triggers twice.
stanciu is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 10-14-2020 , 16:02   Re: Bomb explosion triggers an event twice
Reply With Quote #2

https://forums.alliedmods.net/showthread.php?t=17379

This should help you.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
stanciu
Junior Member
Join Date: Mar 2016
Location: Romania
Old 10-14-2020 , 16:29   Re: Bomb explosion triggers an event twice
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
Thanks. I somehow have found a fix by having a variable check if the round is over or not. It fixed, might not be the best solution -- will switch to that soon! Thank you, solved!
stanciu is offline
Reply


Thread Tools
Display Modes

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 23:36.


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