SA-MP Forums Archive
Ayuda Con TextDraw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Español/Spanish (https://sampforum.blast.hk/forumdisplay.php?fid=29)
+---- Thread: Ayuda Con TextDraw (/showthread.php?tid=148959)



Ayuda Con TextDraw - Roymer - 19.05.2010

Hola
Les Vengo a Pedir Ayuda Para Colocar un TextDraw.
Queria Poner El Nivel del Jugador en TextDraw.
Ya Tengo La Ubicacion del TextDraw.
Porfavor, Ayudenme! please!! xD!


Re: Ayuda Con TextDraw - Miguel - 20.05.2010

No se que es lo que quieres exactamente, pero creo que esto te puede ayudar:

pawn Код:
new
  string[12];

format(string, sizeof(string), "Nivel: %d", a);
TextDrawSetString(b, string);

// a == variable que contiene el nivel del jugador
// b == textdraw al que quieres asignarle "Nivel: Nє"
// Si quieres que se muestre el textdraw usa TextDrawShowForPlayer(playerid, b); recordando lo que es "b"



Re: Ayuda Con TextDraw - Roymer - 20.05.2010

Y Donde Pongo eso?


Re: Ayuda Con TextDraw - Miguel - 20.05.2010

Quote:
Originally Posted by Roymer
Y Donde Pongo eso?
Obviamente, donde quieras que se actualize el nivel con el textdraw... yo lo harнa cada vez que se establece o cambia el nivel.


Re: Ayuda Con TextDraw - Roymer - 20.05.2010

Es que lo Coloco Cuando Pones /Cuenta ( Te muestra tus stats ) (En la callback ShowStats ) Y me da error: Undefined symbol: TextDrawNivel (ID del TextDraw) y eso que pongo new text:TextDrawNivel[MAX_PLAYERS]

Alguna Otra Ubicacion?


Re: Ayuda Con TextDraw - Miguel - 20.05.2010

pawn Код:
TextDrawShowForPlayer(playerid, TextDrawNivel[playerid]);
pawn Код:
public ShowStats(playerid)
{
  new string[12];

  format(string, sizeof(string), "Nivel: %d", vardelnivel);
  TextDrawSetString(TextDrawNivel[playerid], string);
  TextDrawShowForPlayer(playerid, TextDrawNivel[playerid]);
  return 1;
}
Adivinando como es el callback...


Re: Ayuda Con TextDraw - Roymer - 20.05.2010

pawn Код:
C:\Documents and Settings\Pierson\Escritorio\Servidor\gamemodes\Rg.pwn(14977) : error 017: undefined symbol "TextDrawNivel"
C:\Documents and Settings\Pierson\Escritorio\Servidor\gamemodes\Rg.pwn(14977) : warning 215: expression has no effect
C:\Documents and Settings\Pierson\Escritorio\Servidor\gamemodes\Rg.pwn(14977) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\Pierson\Escritorio\Servidor\gamemodes\Rg.pwn(14977) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Pierson\Escritorio\Servidor\gamemodes\Rg.pwn(14977) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
linea: TextDrawSetString(TextDrawNivel[playerid], string);

Todo lo que Tengo:
Arriba de Todo el GM:
pawn Код:
new Text:TextdrawNivel[MAX_PLAYERS];//
En la Callback OnPlayerConnect:
pawn Код:
TextdrawNivel[playerid] = TextDrawCreate(37.000000, 334.000000, " ");
    TextDrawBackgroundColor(TextdrawNivel[playerid], 255);
    TextDrawFont(TextdrawNivel[playerid], 1);
    TextDrawLetterSize(TextdrawNivel[playerid], 0.280000, 1.000000);
    TextDrawColor(TextdrawNivel[playerid], -1);
    TextDrawSetOutline(TextdrawNivel[playerid], 0);
    TextDrawSetProportional(TextdrawNivel[playerid], 1);
    TextDrawSetShadow(TextdrawNivel[playerid], 1);
En la Calback OnPlayerDisconnect:
pawn Код:
TextDrawDestroy(TextdrawNivel[playerid]);
y Ya :S


Re: Ayuda Con TextDraw - Miguel - 20.05.2010

...

TextDrawNivel[playerid] es muy diferente a TextdrawNivel[playerid]...

pawn Код:
public ShowStats(playerid)
{
  new string[12];

  format(string, sizeof(string), "Nivel: %d", vardelnivel);
  TextDrawSetString(TextdrawNivel[playerid], string);
  TextDrawShowForPlayer(playerid, TextdrawNivel[playerid]);
  return 1;
}