28.06.2016, 14:40
Quote:
There is a difference. The method shown by PawnHunter will reset everything to 0 while Yashas' method can set any value. It is a very interesting way to reset an enum-array indeed!
As for smart techniques using streamer plugin is E_STREAMER_EXTRA_ID. When it loads all the houses for example, set that extra ID for the pickup/checkpoint to a value such as "MAX_HOUSES + index" and you can retrieve it back on pickup/entering cp and get directly the house the player is near, no unnecessary loops. |
resetPlayer[P_DATA]={0,-1,1 and so on}; while initializing, then Player[playerid] = resetPlayer;
Although I'm not sure which one is faster and if I remember correctly ****** did a little searching and PawnHunter's was faster in huge enum-arrays.
Rest points are quite interesting, I remember having argument about speed or memory, and with today's memory standard and sa-mp being single-threaded, speed wins everytime, having a couple megabytes of memory is no big deal with 16-32GB rams these days.