29.01.2013, 13:48
No sй los demбs pero mi tйcnica serнa esta:
Deberнa funcionar, no lo he probado, si tienes alguna duda, Ўpregunta!
Saludos.
pawn Код:
new
Text:ks_A,
Text:ks_B,
Text:ks_C,
ks_gTimer[3],
ks_gUltimoActualizado
;
public OnGameModeInit() {
//---Aquн tus TextDraws globales.
ks_A = TextDrawCreate(.................);
ks_B = TextDrawCreate(.................);
ks_C = TextDrawCreate(.................);
return 1;
}
/* Luego siguiendo tu modelo en OnPlayerDeath */
new
cadena[128],
nombre[MAX_PLAYER_NAME]
;
GetPlayerName(killerid, n, 24);
if(kills[killerid] >= 2) {
ks_gUltimoActualizado++;
format(cadena, 128,
"~b~%s ~w~%s",
nombre,
TextoBaja(kills[killerid])
);
switch(ks_gUltimoActualizado) {
case 1: {
KillTimer(ks_gTimer[0]);
TextDrawSetString(A, cadena); //Lo ponemos en el primer TextDraw el mensaje.
TextDrawShowForAll(A); //Lo mostramos a todo el mundo.
ks_gTimer[0] = SetTimerEx("EsconderNotificacion", 2000, false, "i", 0);
}
case 2: {
KillTimer(ks_gTimer[1]);
TextDrawSetString(B, cadena); //Lo ponemos en el segundo TextDraw el mensaje.
TextDrawShowForAll(B); //Lo mostramos a todo el mundo.
ks_gTimer[1] = SetTimerEx("EsconderNotificacion", 2000, false, "i", 1);
}
case 3: {
KillTimer(ks_gTimer[2]);
TextDrawSetString(C, cadena); //Lo ponemos en el tercer TextDraw el mensaje.
TextDrawShowForAll(C); //Lo mostramos a todo el mundo.
ks_gTimer[2] = SetTimerEx("EsconderNotificacion", 2000, false, "i", 2);
ks_gUltimoActualizado = 0;
/* Ponemos la variable en 0, ya que cuando lleguemos al TextDraw C no habrб mбs sitio y vuelve a empezar desde el TextDraw A */
}
}
}
/* Funciуn para esconder el mensaje despuйs de dos segundos */
forward EsconderNotificacion(numero);
public EsconderNotificacion(numero) {
switch(numero) {
case 0: TextDrawHideForAll(A);
case 1: TextDrawHideForAll(B);
case 2: TextDrawHideForAll(C);
}
return 1;
}
/* Esta funciуn para facilitar un poco las cosas */
stock TextoBaja(numero) {
new msg[100];
switch(numero) {
case 2: msg = "Racha de dos bajas";
case 3: msg = "Racha de tres bajas";
case 4: msg = "Racha de cuatro bajas";
/* Puedes poner todos los 'case' que quieras. */
}
return msg;
}
Saludos.