otra forma sin utilizar!!! [Ayuda]
#1

Hola amigos del samp aqui pidiendoles su ayuda... Cree unos mensajes de bienvenida despuйs de hacer Spawn, como podrнa hacer para que no vuelva a salir el mensaje de bienvenida... lo que sucede que al spawnear entra bien y sale el mensaje pero a lo que muero y vuelvo a spawnear sale nuevamente el mensaje.



como puedo hacer para solo me aparesca el mensaje solo al inicio cuando entre por primera vez y haga spawn no a cada instante despues de muerto..

pawn Код:
new Text:Texto1;
new Text:Texto2;
new Text:Texto3

public OnPlayerSpawn(playerid)
{
SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
TextDrawShowForPlayer(playerid, Texto1);
TextDrawShowForPlayer(playerid, Texto2);
TextDrawShowForPlayer(playerid, Texto3);
return 1;
}


public OnGameModeExit()
{
TextDrawHideForAll(Texto1);
TextDrawDestroy(Texto1);
TextDrawHideForAll(Texto2);
TextDrawDestroy(Texto2);
TextDrawHideForAll(Texto2);
TextDrawDestroy(Texto2);

return 1;
}


public OnGameModeInit()
{
Texto1 = TextDrawCreate(212.000000, 122.000000, ".::Bienvenido al Server::.");
TextDrawBackgroundColor(Texto1, 255);
TextDrawFont(Texto1, 1);
TextDrawLetterSize(Texto1, 0.479999, 2.099999);
TextDrawColor(Texto1, -67436289);
TextDrawSetOutline(Texto1, 0);
TextDrawSetProportional(Texto1, 1);
TextDrawSetShadow(Texto1, 1);

Texto2 = TextDrawCreate(239.000000, 141.000000, "~w~Version actual: ~g~0.5");
TextDrawBackgroundColor(Texto2, 255);
TextDrawFont(Texto2, 1);
TextDrawLetterSize(Texto2, 0.469999, 1.899999);
TextDrawColor(Texto2, -1);
TextDrawSetOutline(Texto2, 0);
TextDrawSetProportional(Texto2, 1);
TextDrawSetShadow(Texto2, 1);

Texto3 = TextDrawCreate(235.000000, 158.000000, "~r~~h~www.miweb.tk");
TextDrawBackgroundColor(Texto3, 255);
TextDrawFont(Texto3, 1);
TextDrawLetterSize(Texto3, 0.490000, 1.800000);
TextDrawColor(Texto3, -1);
TextDrawSetOutline(Texto3, 0);
TextDrawSetProportional(Texto3, 1);
TextDrawSetShadow(Texto3, 1);


return 1;
}


forward ServerNombre(playerid);
public ServerNombre(playerid)
{
 TextDrawHideForPlayer(playerid, Texto1);
 TextDrawHideForPlayer(playerid, Texto2);
 TextDrawHideForPlayer(playerid, Texto3);
}
muchas gracias
Reply
#2

cuando sales y vuelves a entrar al servidor y no sale de nuevo el textdraw es porque:

- Creas el textdraw GLOBAL al iniciar el servidor.
- Cuando se conecta alguien le muestras ese textdraw GLOBAL
- Cuando spawnea a los 8 segundos destruyes el textdraw GLOBAL

al destruir el textdraw ya no habrб que mostrar porque como dije, lo destruiste ya.

Usa TextDrawHideForPlayer como dijiste, crea una variable para cada jugador y cuando se conecte la seteas a false, cuando spawnee haces una condiciуn de que si la variable estб false empiezas el timer y seteas la variable a true para que cuando spawnee nuevamente no comience el timer
Reply
#3

Quote:
Originally Posted by aoEXE
Посмотреть сообщение
cuando sales y vuelves a entrar al servidor y no sale de nuevo el textdraw es porque:

- Creas el textdraw GLOBAL al iniciar el servidor.
- Cuando se conecta alguien le muestras ese textdraw GLOBAL
- Cuando spawnea a los 8 segundos destruyes el textdraw GLOBAL

al destruir el textdraw ya no habrб que mostrar porque como dije, lo destruiste ya.

Usa TextDrawHideForPlayer como dijiste, crea una variable para cada jugador y cuando se conecte la seteas a false, cuando spawnee haces una condiciуn de que si la variable estб false empiezas el timer y seteas la variable a true para que cuando spawnee nuevamente no comience el timer
NO te entendi men, seteas la variable a true para que cuando spawnee nuevamente no comience el timer?
Reply
#4

pawn Код:
public OnPlayerRequestSpawn(playerid)
{
    SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
    TextDrawShowForPlayer(playerid, Texto1);
    TextDrawShowForPlayer(playerid, Texto2);
    TextDrawShowForPlayer(playerid, Texto3);
    return 1;
}
Reply
#5

Con una variable:
pawn Код:
new Logueado[MAX_PLAYERS];
new Text:Texto1;
new Text:Texto2;
new Text:Texto3

public OnPlayerSpawn(playerid)
{
    if(Logueado[playerid])//si estб en uno pasa. si es 0 no.
    {
        SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
    }
    TextDrawShowForPlayer(playerid, Texto1);
    TextDrawShowForPlayer(playerid, Texto2);
    TextDrawShowForPlayer(playerid, Texto3);
    if(Logueado[playerid] == 0){ Loguearse(playerid); }
    return 1;
}

forward Loguearse(playerid);
public Loguearse(playerid)
{
    SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
    Logueado[playerid] = 1;
    return true;
}
   

public OnGameModeExit()
{
TextDrawHideForAll(Texto1);
TextDrawDestroy(Texto1);
TextDrawHideForAll(Texto2);
TextDrawDestroy(Texto2);
TextDrawHideForAll(Texto2);
TextDrawDestroy(Texto2);

return 1;
}


public OnGameModeInit()
{
Texto1 = TextDrawCreate(212.000000, 122.000000, ".::Bienvenido al Server::.");
TextDrawBackgroundColor(Texto1, 255);
TextDrawFont(Texto1, 1);
TextDrawLetterSize(Texto1, 0.479999, 2.099999);
TextDrawColor(Texto1, -67436289);
TextDrawSetOutline(Texto1, 0);
TextDrawSetProportional(Texto1, 1);
TextDrawSetShadow(Texto1, 1);

Texto2 = TextDrawCreate(239.000000, 141.000000, "~w~Version actual: ~g~0.5");
TextDrawBackgroundColor(Texto2, 255);
TextDrawFont(Texto2, 1);
TextDrawLetterSize(Texto2, 0.469999, 1.899999);
TextDrawColor(Texto2, -1);
TextDrawSetOutline(Texto2, 0);
TextDrawSetProportional(Texto2, 1);
TextDrawSetShadow(Texto2, 1);

Texto3 = TextDrawCreate(235.000000, 158.000000, "~r~~h~www.miweb.tk");
TextDrawBackgroundColor(Texto3, 255);
TextDrawFont(Texto3, 1);
TextDrawLetterSize(Texto3, 0.490000, 1.800000);
TextDrawColor(Texto3, -1);
TextDrawSetOutline(Texto3, 0);
TextDrawSetProportional(Texto3, 1);
TextDrawSetShadow(Texto3, 1);


return 1;
}

// aqui no se que poner si pongo TextDrawDestroy ya no vuelve aparecer si relogeo.. y si pongo TextDrawHideForPlayer(playerid, Texto3); me sale a cada rato despues de morir y spawnear de nuevo..

forward ServerNombre(playerid);
public ServerNombre(playerid)
{
 TextDrawHideForPlayer(playerid, Texto1);
 TextDrawHideForPlayer(playerid, Texto2);
 TextDrawHideForPlayer(playerid, Texto3);
}
Reply
#6

asi creo que te dijo

Код:
new bool:Mostrar[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
	Mostrar[playerid] = false;
	return 1;
}
public OnPlayerSpawn(playerid)
{
    if(Mostrar[playerid] == false)
    {
        Mostrar[playerid] = true;
	    SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
	    TextDrawShowForPlayer(playerid, Texto1);
	    TextDrawShowForPlayer(playerid, Texto2);
	    TextDrawShowForPlayer(playerid, Texto3);
    }
    return 1;
}
Reply
#7

Quote:
Originally Posted by jotajeda
Посмотреть сообщение
Con una variable:
pawn Код:
new Logueado[MAX_PLAYERS];
new Text:Texto1;
new Text:Texto2;
new Text:Texto3

public OnPlayerSpawn(playerid)
{
    if(Logueado[playerid])//si estб en uno pasa. si es 0 no.
    {
        SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
    }
    TextDrawShowForPlayer(playerid, Texto1);
    TextDrawShowForPlayer(playerid, Texto2);
    TextDrawShowForPlayer(playerid, Texto3);
    if(Logueado[playerid] == 0){ Loguearse(playerid); }
    return 1;
}

forward Loguearse(playerid);
public Loguearse(playerid)
{
    SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
    Logueado[playerid] = 1;
    return true;
}
   

public OnGameModeExit()
{
TextDrawHideForAll(Texto1);
TextDrawDestroy(Texto1);
TextDrawHideForAll(Texto2);
TextDrawDestroy(Texto2);
TextDrawHideForAll(Texto2);
TextDrawDestroy(Texto2);

return 1;
}


public OnGameModeInit()
{
Texto1 = TextDrawCreate(212.000000, 122.000000, ".::Bienvenido al Server::.");
TextDrawBackgroundColor(Texto1, 255);
TextDrawFont(Texto1, 1);
TextDrawLetterSize(Texto1, 0.479999, 2.099999);
TextDrawColor(Texto1, -67436289);
TextDrawSetOutline(Texto1, 0);
TextDrawSetProportional(Texto1, 1);
TextDrawSetShadow(Texto1, 1);

Texto2 = TextDrawCreate(239.000000, 141.000000, "~w~Version actual: ~g~0.5");
TextDrawBackgroundColor(Texto2, 255);
TextDrawFont(Texto2, 1);
TextDrawLetterSize(Texto2, 0.469999, 1.899999);
TextDrawColor(Texto2, -1);
TextDrawSetOutline(Texto2, 0);
TextDrawSetProportional(Texto2, 1);
TextDrawSetShadow(Texto2, 1);

Texto3 = TextDrawCreate(235.000000, 158.000000, "~r~~h~www.miweb.tk");
TextDrawBackgroundColor(Texto3, 255);
TextDrawFont(Texto3, 1);
TextDrawLetterSize(Texto3, 0.490000, 1.800000);
TextDrawColor(Texto3, -1);
TextDrawSetOutline(Texto3, 0);
TextDrawSetProportional(Texto3, 1);
TextDrawSetShadow(Texto3, 1);


return 1;
}

// aqui no se que poner si pongo TextDrawDestroy ya no vuelve aparecer si relogeo.. y si pongo TextDrawHideForPlayer(playerid, Texto3); me sale a cada rato despues de morir y spawnear de nuevo..

forward ServerNombre(playerid);
public ServerNombre(playerid)
{
 TextDrawHideForPlayer(playerid, Texto1);
 TextDrawHideForPlayer(playerid, Texto2);
 TextDrawHideForPlayer(playerid, Texto3);
}
ahora el textdraw no desaparece se queda ahi ._.?
Reply
#8

Quote:
Originally Posted by Zodiaco
Посмотреть сообщение
ahora el textdraw no desaparece se queda ahi ._.?
Perdуn lo hize rapido y era para darte la idea, pero realmente asн deberнas tener:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(Logueado[playerid] == 0){ Loguearse(playerid); }
    return 1;
}

forward Loguearse(playerid);
public Loguearse(playerid)
{
    SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
    TextDrawShowForPlayer(playerid, Texto1);
    TextDrawShowForPlayer(playerid, Texto2);
    TextDrawShowForPlayer(playerid, Texto3);
    Logueado[playerid] = 1;
    return true;
}
Reply
#9

Quote:
Originally Posted by pep_25
Посмотреть сообщение
asi creo que te dijo

Код:
new bool:Mostrar[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
	Mostrar[playerid] = false;
	return 1;
}
public OnPlayerSpawn(playerid)
{
    if(Mostrar[playerid] == false)
    {
        Mostrar[playerid] = true;
	    SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
	    TextDrawShowForPlayer(playerid, Texto1);
	    TextDrawShowForPlayer(playerid, Texto2);
	    TextDrawShowForPlayer(playerid, Texto3);
    }
    return 1;
}
muchas gracias me funciono +resp
Reply
#10

Quote:
Originally Posted by jotajeda
Посмотреть сообщение
Perdуn lo hize rapido y era para darte la idea, pero realmente asн deberнas tener:

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(Logueado[playerid] == 0){ Loguearse(playerid); }
    return 1;
}

forward Loguearse(playerid);
public Loguearse(playerid)
{
    SetTimerEx("ServerNombre", 8000, 0, "d", playerid);
    TextDrawShowForPlayer(playerid, Texto1);
    TextDrawShowForPlayer(playerid, Texto2);
    TextDrawShowForPlayer(playerid, Texto3);
    Logueado[playerid] = 1;
    return true;
}
ahora si funciono muchas gracias a los dos +respt
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)