[Tutorial] "Function" your variable-names - Make your life easier!
#3

Quote:
Originally Posted by Vince
View Post
I reckon that a constant array is shorter, still. But I don't know if it will actually be faster.
PHP Code:
// global
new const gAdminLevel[][] = {
    
"None"// 0
    
"Mod"// 1
    
"Support"// 2
    
"Admin" // 3
}; 
PHP Code:
//where ever
new string[64];
format(string,sizeof(string),"You`re: %s"gAdminLevel[PlayerInfo[playerid][pAdmin]]);
SendClientMessage(playeridYOUR_COLORstring); 
Still, it is good that repeated code is being denounced.
Yes, the constant array will be MUCH faster.
Reply


Messages In This Thread
"Function" your variable-names - Make your life easier! - by GangstaSunny - 08.02.2016, 21:57
Re: "Function" your variable-names - Make your life easier! - by Vince - 08.02.2016, 22:28
Re: "Function" your variable-names - Make your life easier! - by Crayder - 09.02.2016, 16:41

Forum Jump:


Users browsing this thread: 1 Guest(s)