[Tutorial] HeadShot System [Explained]
#25

Quote:
Originally Posted by saffierr
View Post
How is it considered as 'better' lol, I truly don't see how, as it's different for everyone.
Having "new bool:Something = false;" is just for the sight of your eyes, and yes, I know a boolean is FALSE by default, but as I've said, it's just for the sight.
I do not see how it is possibly considered as better.
Not better, but as better programming practice. Like I said, you aren't going to find any high level projects (or whatever you want to call them) do any of that.

Quote:
Originally Posted by Michael Shimmins
The first example nearly always wins in my book:

if(foo)
{
}
It's shorter and more concise. Why add an extra check to something when it's absolutely not needed? Just wasting cycles...

I do agree, though, that sometimes the more verbose syntax makes things more readable (which is ultimately more important as long as performance is acceptable) in situations where variables are poorly named.
There are tens and thousands of other comments behind the matter just like that one, look it up or continuing doing the opposite. Whatever, I can't force you to do anything, really.

-----

Quote:
Originally Posted by Lordzy
View Post
About IsPlayerDead : By considering what you said, it can fail sometimes. OnPlayerSpawn can be bypassed, though it's the responsibility of the server developer. But there are exceptional cases where you get spawned without OnPlayerSpawn getting called, so I'd recommend to consider state too along with what SickAttack suggested.

OT : There's no need to check if both the players have no teams assigned. If one among them doesn't have a team then it's assured that both either has no team or are from different teams.
Other than that, good tutorial.
Is that so? Please explain how it can be recreated.

Getting desynced is honestly the only way it won't be called, are you referring to that?
Reply


Messages In This Thread
HeadShot System [Explained] - by iLearner - 11.01.2017, 17:35
Re: HeadShot System [Explained] - by Gammix - 11.01.2017, 17:43
Re: HeadShot System [Explained] - by Logic_ - 11.01.2017, 17:44
Re: HeadShot System [Explained] - by iLearner - 11.01.2017, 17:45
Re: HeadShot System [Explained] - by RedRex - 11.01.2017, 17:54
Re: HeadShot System [Explained] - by saffierr - 11.01.2017, 18:02
Re: HeadShot System [Explained] - by Logic_ - 11.01.2017, 18:05
Re: HeadShot System [Explained] - by iLearner - 11.01.2017, 18:06
Re: HeadShot System [Explained] - by saffierr - 11.01.2017, 18:08
Re: HeadShot System [Explained] - by RyderX - 11.01.2017, 18:32
Re: HeadShot System [Explained] - by PhoneixViper - 11.01.2017, 18:55
Re: HeadShot System [Explained] - by Gammix - 11.01.2017, 19:06
Re: HeadShot System [Explained] - by iLearner - 11.01.2017, 19:07
Re: HeadShot System [Explained] - by SickAttack - 11.01.2017, 19:27
Re: HeadShot System [Explained] - by iLearner - 11.01.2017, 19:35
Re: HeadShot System [Explained] - by SickAttack - 11.01.2017, 19:48
Re: HeadShot System [Explained] - by saffierr - 12.01.2017, 00:14
Re: HeadShot System [Explained] - by SickAttack - 12.01.2017, 00:28
Re: HeadShot System [Explained] - by saffierr - 12.01.2017, 00:58
Re: HeadShot System [Explained] - by muzammilfreeman - 12.01.2017, 01:01
Re: HeadShot System [Explained] - by Lordzy - 12.01.2017, 11:04
Re: HeadShot System [Explained] - by SyS - 12.01.2017, 11:57
Re: HeadShot System [Explained] - by iLearner - 12.01.2017, 12:39
Re: HeadShot System [Explained] - by Gammix - 12.01.2017, 13:16
Re: HeadShot System [Explained] - by SickAttack - 12.01.2017, 14:11
Re: HeadShot System [Explained] - by Lordzy - 12.01.2017, 14:23
Re: HeadShot System [Explained] - by iLearner - 12.01.2017, 14:27
Re: HeadShot System [Explained] - by GoldenLion - 12.01.2017, 14:32
Re: HeadShot System [Explained] - by SickAttack - 12.01.2017, 14:33
Re: HeadShot System [Explained] - by iLearner - 12.01.2017, 14:42
Re: HeadShot System [Explained] - by GoldenLion - 12.01.2017, 14:45
Re: HeadShot System [Explained] - by saffierr - 12.01.2017, 14:52
Re: HeadShot System [Explained] - by iLearner - 12.01.2017, 15:07
Re: HeadShot System [Explained] - by GhostHacker9 - 20.01.2017, 08:28

Forum Jump:


Users browsing this thread: 1 Guest(s)