SetTimerEx no se activa en OnPlayerConnect D:
#1

Buenas noches

Verб, me estoy creando una presentaciуn al momento de conectarse con textdraw's el problema es que en el callback OnPlayerConnect no llama a la funciуn que le indico, osea, no se ejecuta.

pawn Код:
public OnPlayerConnect(playerid)
{
    InicioCuenta = SetTimerEx("Inicio",1000,1, "is",playerid);
    TextDrawShowForPlayer(playerid, Iniciando);
    TextDrawShowForPlayer(playerid, Fondo);
    AccountInfo[playerid][aLogged] = 0;
    AccountInfo[playerid][aAdmin] = 0;
    AccountInfo[playerid][aBloqueado] = 0;
    AccountInfo[playerid][aSilencio] = 0;
    adminservicio[playerid] = 0;
    Advertido[playerid] = 0;
   
    new string[256];
    GetPlayerName(playerid, string, sizeof(string));
    format(string,sizeof(string), "{00FFFF}!>> %s {CCFFFF}se ah unido a Lunnatiic'z Freeroam!!", string);
    SendClientMessageToAll(0xBBBBBBAA,string);
   
    SetPVarInt(playerid, "laser", 0);
    SetPVarInt(playerid, "color", 18643);
    return 1;
}
Eso es lo que esta en el callback, la funciуn a la que llamo es la siguiente.

pawn Код:
public Inicio(playerid)
{
    switch(Letras)
    {
        case 0: { Letras = 12, PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, L); }
        case 1: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, U); }
        case 2: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, N);}
        case 3: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, N2); }
        case 4: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, A); }
        case 5: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, T); }
        case 6: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, i1); }
        case 7: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, i2); }
        case 8: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, C); }
        case 9: { Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, Acento); }
        case 10:{ Letras--; PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, Z1); }
        case 11:{ Letras--; PlayerPlaySound(playerid, 1056, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, Freeroam); }
        case 12:{ Letras--; PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0), TextDrawShowForPlayer(playerid, VerdeB),TextDrawShowForPlayer(playerid, BlancoB), TextDrawShowForPlayer(playerid, RojoB), TextDrawShowForPlayer(playerid, SimboloB), ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{FFFF33}Reglas del Servidor", reglas, "Continuar", ""), KillTimer(InicioCuenta);}
    }
}
obviamente ya esta el forward & el resto de definiciones, de quй manera se utilizarнa el SetTimer? Dado a que ya use un prinft & no se imprime, e inclusive introduci las funciones en un comando & tampoco se ejecuta xD

pawn Код:
if (!strcmp( cmdtext, "/test", true))
    {
      InicioCuenta = SetTimer("Inicio",1000,1);
      TextDrawShowForPlayer(playerid, Iniciando);
      TextDrawShowForPlayer(playerid, Fondo);
      return 1;
    }
Tambiйn intentй con

pawn Код:
if (!strcmp( cmdtext, "/test", true))
    {
      InicioCuenta = SetTimerEx("Inicio",1000,1, "is", playerid);
      TextDrawShowForPlayer(playerid, Iniciando);
      TextDrawShowForPlayer(playerid, Fondo);
      return 1;
    }
.

Alguna idea del porquй?
Reply
#2

Haber, si te puedo ayudar.

Ya que la funciуn tiene un parametro (playerid), utiliza SetTimerEx(..., "d", playerid); No sй porque pones "is".
Y yo lo que harнa, es poner el Letras para cada jugador, Letras[playerid], porque se supone que depende el jugador serб diferente el orden.
Reply
#3

Es parecido a como si usaras sscanf, las letras significan un parбmetro, y luego pones donde y como vas a llamar ese parametro, para usarlo despuйs. Claro, al poner dos letras, y solo un lugar donde se guarde el parametro tienes problemas

Lista de las letritas de los parametros:
Код:
i	 Stands for an integer parameter.
d	 Exactly the same as i.
a	 Passes an array, the next parameter must be an integer ("i") with the array's size.
s	 Stands for a string parameter.
f	 Stands for a float parameter.
b	 Stands for a boolean parameter
https://sampwiki.blast.hk/wiki/SetTimerEx

OFF: Se ah unido? xDD
Reply
#4

Quote:
Originally Posted by Code8976Man
Посмотреть сообщение
Haber, si te puedo ayudar.

Ya que la funciуn tiene un parametro (playerid), utiliza SetTimerEx(..., "d", playerid); No sй porque pones "is".
Y yo lo que harнa, es poner el Letras para cada jugador, Letras[playerid], porque se supone que depende el jugador serб diferente el orden.
Exactamente eso hice ayer, pero nada D:
Reply
#5

Prueba: InicioCuenta[playerid].

Cada jugador tiene que tener su propio timer.
Reply
#6

Quote:
Originally Posted by Code8976Man
Посмотреть сообщение
Prueba: InicioCuenta[playerid].

Cada jugador tiene que tener su propio timer.
Tss's

ЎCasi!

Sуlo mostrу el primer Text D:

їA quй se debe?

Quedo asн.

pawn Код:
new InicioCuenta[MAX_PLAYERS];

InicioCuenta[playerid] = SetTimerEx("Inicio", 1000, 1, "d", playerid);
e.e
Reply
#7

Mi pregunta es... їPor que le das un timer de 1 segundo?
Yo mis textdraw's los tengo normales, y perfectos pero sin ese timer.
Reply
#8

Quote:
Originally Posted by TiNcH010
Посмотреть сообщение
Mi pregunta es... їPor que le das un timer de 1 segundo?
Yo mis textdraw's los tengo normales, y perfectos pero sin ese timer.
їA quй quieres llegar?, їA que le aumente el tiempo?
Reply
#9

Quote:
Originally Posted by Lunnatiicz
Посмотреть сообщение
їA quй quieres llegar?, їA que le aumente el tiempo?
No, a que le quites el tiempo?
Reply
#10

Quote:
Originally Posted by TiNcH010
Посмотреть сообщение
No, a que le quites el tiempo?
Nada..

їCreen que sea por el switch?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)