Function done twice
im not sure why this is happening. i have a function that once you get to two rounds, the script will transfer the players to the other team and the restart the round. now the script does that, but it does it two times and i have been sitting here for two hours and trying to figure out why and now i have given up and ask for ur pro-assistance! :)
also, how do you print out the value of a boolean? with string u use %s and int %i but how do u do with bool? anyways, here is the relevant code PHP Code:
|
Re: Function done twice
I think i solved it. I just put the swap on round end, instead of round start.
|
Re: Function done twice
Because you restart so TeamInfo is called again. swapMess become true again and then swap() function is called too.
You have just to intercept restart event. :) Code:
|
Re: Function done twice
Quote:
|
Re: Function done twice
I can't recollect but I think round start and round end logevents are sometimes called two times in a row, sending two groups of infos... I'm not sure, but I think it depends on team score changes...
Anyway I didn't want to get so much into that problem so I added some code like this :mrgreen: Code:
register_logevent("roundEnd", 2, "1=Round_End")Code:
public roundEnd() |
Re: Function done twice
to print out a boolean just use %i, because dep down inside the heart of the computer, a boolean is just a int except it is made to hold only two values. 1 or 0. 1=true, 0=false. The boolean varriable it 1bit. just enough to make the binary god happy.
|
| All times are GMT -4. The time now is 21:34. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.