GetPlayerState Question
#7

Quote:
Originally Posted by Killa[DGZ]
Посмотреть сообщение
Why use 'GetPlayerState(playerid)' over and over instead of just storing the players current state gathered from OnPlayerStateChange within a variable for that player?
To answer this specifically; because it's redundant. If it's a local variable you will use multiple times in a single function call then sure. Otherwise you're wasting memory for no reason.

That's like asking why we would use GetPlayerHealth when we can store it in a variable. If you need the variable use it. Otherwise stick to the native calls.
Reply


Messages In This Thread
GetPlayerState Question - by Killa[DGZ] - 18.07.2017, 13:15
Re: GetPlayerState Question - by oMa37 - 18.07.2017, 13:36
Re: GetPlayerState Question - by Killa[DGZ] - 18.07.2017, 13:48
Re: GetPlayerState Question - by Sew_Sumi - 18.07.2017, 13:53
Re: GetPlayerState Question - by Killa[DGZ] - 18.07.2017, 14:03
Re: GetPlayerState Question - by Paulice - 18.07.2017, 17:15
Re: GetPlayerState Question - by nG Inverse - 19.07.2017, 04:35
Re: GetPlayerState Question - by Killa[DGZ] - 19.07.2017, 05:51
Re: GetPlayerState Question - by nG Inverse - 19.07.2017, 06:20
Re: GetPlayerState Question - by Killa[DGZ] - 19.07.2017, 07:10

Forum Jump:


Users browsing this thread: 2 Guest(s)