20.02.2015, 07:00
(
Последний раз редактировалось Etolas; 20.02.2015 в 16:48.
)
Hello,
First, sorry for my bad English, it isn't my first language.
I've a question about optimization in my script. Which of the following proposals is the best ?
OR
Actually, I'd have said the second one is such better than the first because he has less timer of course but I'd like to have a confirmation.
Thank you for your help.
Etolas
First, sorry for my bad English, it isn't my first language.
I've a question about optimization in my script. Which of the following proposals is the best ?
Код:
public OnPlayerConnect(playerid) { SetTimerEx("Timer", 1000, false, "i", playerid); return 1; } public Timer(playerid) { SendClientMessage(playerid, -1, "Example message"); }
Код:
public OnGameModeInit() { SetTimer("Timer", 1000, false); return 1; } public Timer() { for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { SendClientMessage(i, -1, "Example message"); } } }
Thank you for your help.
Etolas