Diferencias: static - new.
#1

Hola,
їquй diferencias hay entre static o new?, dependiendo de cуmo se use, ya sea de modo global, en una funciуn o comando.

Dejarй un ejemplo:

Код:
CMD:quitararmas(playerid, params[])
{
	if(PlayerInfo[playerid][jAdm] == 0) return SCM(playerid, COLOR_GRAD, "Necesitas ser administrador para usar este comando.");
    if(sscanf(params, "r", params[0])) return SCM(playerid, COLOR_LABELS, "Modo de uso: /quitararmas [ID]");
	if(!IsPlayerConnected(params[0])) return SCM(playerid, COLOR_GRAD, "El jugador seleccionado no estб conectado.");
	ResetPlayerWeapons(params[0]);
    static string[128]; // o new.
	format(string, sizeof(string), "El administrador %s te a quitado las armas.", NombreJugador(playerid));
	SCM(params[0], COLOR_VERDE_CLARO, string);
	format(string, sizeof(string), "Has quitado las armas a %s.", NombreJugador(params[0]));
	SCM(playerid, COLOR_VERDE, string);
	return 1;
}
Aclaro, que si llegase a ser mejor (se que lo es) las variables globales en static, їcuбles son los factores que tenga йste que no tenga new? (no pretendo reiniciar servidor, aclaro)

Espero darme a comprender, gracias por leer.
Reply


Messages In This Thread
Diferencias: static - new. - by Unrea1 - 15.09.2015, 09:42
Respuesta: Diferencias: static - new. - by oOFotherOo - 15.09.2015, 14:50
Re: Diferencias: static - new. - by admantis - 15.09.2015, 15:08
Respuesta: Diferencias: static - new. - by bm0z - 15.09.2015, 17:31
Re: Diferencias: static - new. - by MaRcOsWeB - 15.09.2015, 19:54
Respuesta: Diferencias: static - new. - by bm0z - 15.09.2015, 21:42
Re: Diferencias: static - new. - by Unrea1 - 15.09.2015, 22:53
Respuesta: Diferencias: static - new. - by bm0z - 15.09.2015, 23:03
Re: Diferencias: static - new. - by Unrea1 - 15.09.2015, 23:14
Re: Diferencias: static - new. - by MaRcOsWeB - 15.09.2015, 23:26

Forum Jump:


Users browsing this thread: 3 Guest(s)