Code Optimization
#2

I'm not sure if you do that will make a difference in the speed of the code.

It is not necessary, however you can save space and lines you making something like this

PHP код:
#include <a_samp>
enum myenum
{
    
PlayerCuffed,
    
PlayerCuffedTime,
    
RegistrationStep
};
new 
Player[MAX_PLAYERS][myenum];
ResetVariables(playerid)
{
    for(new 
myenum:imyenumi++)
    {
        
Player[playerid][i] = 0;
    }
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
    
ResetVariables(playerid);
    return 
1;

The three lines in the function reset variables will make all the work restart all the variables of enumeration(playerid).
Reply


Messages In This Thread
Code Optimization - by DusanInfinity - 03.10.2015, 12:24
Re: Code Optimization - by x3378 - 03.10.2015, 12:40
Re: Code Optimization - by DusanInfinity - 03.10.2015, 14:39
Re: Code Optimization - by Vince - 03.10.2015, 15:05
Re: Code Optimization - by DusanInfinity - 04.10.2015, 11:23
AW: Re: Code Optimization - by Nero_3D - 04.10.2015, 12:07

Forum Jump:


Users browsing this thread: 1 Guest(s)