How is better? Consume less memory.
#1

This:

Код:
new Function[MAX_PLAYERS];

forward MyFirstPublic(params);
public MyFirstPublic(params){
switch(Function[params]){
case 0: //Code
case 1: //Code
case 2: //Code
case 3: //Code
//etc...
}}

//reference

Function[playerid] = 0, MyFirstPublic(playerid);
Function[playerid] = 1, SetTimerEx("MyFirstPublic",3000,false,"i",playerid);
Or this:

Код:
forward MyFirstPublic(params);
public MyFirstPublic(params)
{
SetTimerEx("MySecondPublic",3000,false,"i",params);
}

forward MySecondPublic(params);
public MySecondPublic(params)
{
SetTimerEx("MyThirdPublic",3000,false,"i",params);
}

forward MyThirdPublic(params);
public MyThirdPublic(params)
{
//Code...
}

//Reference:

SetTimerEx("MyFirstPublic",3000,false,"i",playerid);
Which of the 2 methods is best?
Reply
#2

Using switch() is better, and better more if you avoid using too much timers.
Reply
#3

Use whatever is easier/better for you to handle.

Any speed/memory difference is completely irrelevant here.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)