[Ajuda] TEXTDRAWS NГO APARECEM
#1

Galera, criei um rodapй aqui, porйm as textdraws nгo estгo aparecendo.

OnPlayerConnect:
Quote:

TextDrawShowForPlayer(playerid, ro1);
TextDrawShowForPlayer(playerid, ro2);
TextDrawShowForPlayer(playerid, ro3);
TextDrawShowForPlayer(playerid, ro4);
TextDrawShowForPlayer(playerid, ro5);
TextDrawShowForPlayer(playerid, ro6);
TextDrawShowForPlayer(playerid, ro7);
TextDrawShowForPlayer(playerid, ro;
TextDrawShowForPlayer(playerid, ro9);
TextDrawShowForPlayer(playerid, ro10);
TextDrawShowForPlayer(playerid, ro11);
TextDrawShowForPlayer(playerid, ro12);

OnPlayerDisconnect:
Quote:

TextDrawHideForPlayer(playerid, ro1);
TextDrawHideForPlayer(playerid, ro2);
TextDrawHideForPlayer(playerid, ro3);
TextDrawHideForPlayer(playerid, ro4);
TextDrawHideForPlayer(playerid, ro5);
TextDrawHideForPlayer(playerid, ro6);
TextDrawHideForPlayer(playerid, ro7);
TextDrawHideForPlayer(playerid, ro;
TextDrawHideForPlayer(playerid, ro9);
TextDrawHideForPlayer(playerid, ro10);
TextDrawHideForPlayer(playerid, ro11);
TextDrawHideForPlayer(playerid, ro12);
return 1;

TextDraws:
Quote:

ro1 = TextDrawCreate(641.529418, 423.250000, "usebox");
TextDrawLetterSize(ro1, 0.000000, 2.535187);
TextDrawTextSize(ro1, -2.000000, 0.000000);
TextDrawAlignment(ro1, 1);
TextDrawColor(ro1, 0);
TextDrawUseBox(ro1, true);
TextDrawBoxColor(ro1, 170);
TextDrawSetShadow(ro1, 0);
TextDrawSetOutline(ro1, 0);
TextDrawFont(ro1, 0);

ro2 = TextDrawCreate(10.823518, 428.749969, "ID:");
TextDrawLetterSize(ro2, 0.449999, 1.600000);
TextDrawAlignment(ro2, 1);
TextDrawColor(ro2, -16776961);
TextDrawSetShadow(ro2, 0);
TextDrawSetOutline(ro2, 0);
TextDrawBackgroundColor(ro2, 51);
TextDrawFont(ro2, 1);
TextDrawSetProportional(ro2, 1);

ro3 = TextDrawCreate(127.529457, 428.166564, "R$:");
TextDrawLetterSize(ro3, 0.449999, 1.600000);
TextDrawAlignment(ro3, 1);
TextDrawColor(ro3, 8388863);
TextDrawSetShadow(ro3, 0);
TextDrawSetOutline(ro3, 1);
TextDrawBackgroundColor(ro3, 51);
TextDrawFont(ro3, 1);
TextDrawSetProportional(ro3, 1);

ro4 = TextDrawCreate(255.048370, 428.166595, "NICK:");
TextDrawLetterSize(ro4, 0.449999, 1.600000);
TextDrawAlignment(ro4, 1);
TextDrawColor(ro4, -65281);
TextDrawSetShadow(ro4, 0);
TextDrawSetOutline(ro4, 1);
TextDrawBackgroundColor(ro4, 51);
TextDrawFont(ro4, 1);
TextDrawSetProportional(ro4, 1);

ro5 = TextDrawCreate(406.824035, 428.166748, "LEVEL:");
TextDrawLetterSize(ro5, 0.449999, 1.600000);
TextDrawAlignment(ro5, 1);
TextDrawColor(ro5, 65535);
TextDrawSetShadow(ro5, 0);
TextDrawSetOutline(ro5, 1);
TextDrawBackgroundColor(ro5, 51);
TextDrawFont(ro5, 1);
TextDrawSetProportional(ro5, 1);

ro6 = TextDrawCreate(553.411193, 427.583251, "VIP:");
TextDrawLetterSize(ro6, 0.449999, 1.600000);
TextDrawAlignment(ro6, 1);
TextDrawColor(ro6, -2147450625);
TextDrawSetShadow(ro6, 0);
TextDrawSetOutline(ro6, 1);
TextDrawBackgroundColor(ro6, 51);
TextDrawFont(ro6, 1);
TextDrawSetProportional(ro6, 1);

ro7 = TextDrawCreate(503.058441, 394.917114, "www.brasilcidadevirtual.tk");
TextDrawLetterSize(ro7, 0.264588, 1.535833);
TextDrawAlignment(ro7, 1);
TextDrawColor(ro7, 16777215);
TextDrawSetShadow(ro7, 0);
TextDrawSetOutline(ro7, 1);
TextDrawBackgroundColor(ro7, 51);
TextDrawFont(ro7, 3);
TextDrawSetProportional(ro7, 1);

ro8 = TextDrawCreate(39.999992, 428.166687, "%d", i);
TextDrawLetterSize(ro8, 0.449999, 1.600000);
TextDrawAlignment(ro8, 1);
TextDrawColor(ro8, -1);
TextDrawSetShadow(ro8, 0);
TextDrawSetOutline(ro8, 1);
TextDrawBackgroundColor(ro8, 51);
TextDrawFont(ro8, 1);
TextDrawSetProportional(ro8, 1);

ro9 = TextDrawCreate(160.941192, 427.583251, "%d", GetPlayerGrana(i));
TextDrawLetterSize(ro9, 0.449999, 1.600000);
TextDrawAlignment(ro9, 1);
TextDrawColor(ro9, -1);
TextDrawSetShadow(ro9, 0);
TextDrawSetOutline(ro9, 1);
TextDrawBackgroundColor(ro9, 51);
TextDrawFont(ro9, 1);
TextDrawSetProportional(ro9, 1);

ro10 = TextDrawCreate(306.823608, 427.583374, "%s", aname);
TextDrawLetterSize(ro10, 0.449999, 1.600000);
TextDrawAlignment(ro10, 1);
TextDrawColor(ro10, -1);
TextDrawSetShadow(ro10, 0);
TextDrawSetOutline(ro10, 1);
TextDrawBackgroundColor(ro10, 51);
TextDrawFont(ro10, 1);
TextDrawSetProportional(ro10, 1);

ro11 = TextDrawCreate(461.647186, 427.583312, "%d", dini_Int(file, "Level"));
TextDrawLetterSize(ro11, 0.449999, 1.600000);
TextDrawAlignment(ro11, 1);
TextDrawColor(ro11, -1);
TextDrawSetShadow(ro11, 0);
TextDrawSetOutline(ro11, 1);
TextDrawBackgroundColor(ro11, 51);
TextDrawFont(ro11, 1);
TextDrawSetProportional(ro11, 1);

ro12 = TextDrawCreate(591.999572, 427.000061, "%s", viptext);
TextDrawLetterSize(ro12, 0.449999, 1.600000);
TextDrawAlignment(ro12, 1);
TextDrawColor(ro12, -1);
TextDrawSetShadow(ro12, 0);
TextDrawSetOutline(ro12, 1);
TextDrawBackgroundColor(ro12, 51);
TextDrawFont(ro12, 1);
TextDrawSetProportional(ro12, 1);

Reply
#2

UP..
Reply
#3

Alguem pode ajudar?
Reply
#4

PHP код:
public OnGameModeInit()
{
    
SetTimer("preloadtext"1000false);
    return 
1;
}
public 
OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playeridro1);
TextDrawShowForPlayer(playeridro2);
TextDrawShowForPlayer(playeridro3);
TextDrawShowForPlayer(playeridro4);
TextDrawShowForPlayer(playeridro5);
TextDrawShowForPlayer(playeridro6);
TextDrawShowForPlayer(playeridro7);
TextDrawShowForPlayer(playeridro8);
TextDrawShowForPlayer(playeridro9);
TextDrawShowForPlayer(playeridro10);
TextDrawShowForPlayer(playeridro11);
TextDrawShowForPlayer(playeridro12);
 return 
1;
}
forward preloadtext(playerid);
public 
preloadtext(playerid)
{
    
ro1 TextDrawCreate(641.529418423.250000"usebox");
TextDrawLetterSize(ro10.0000002.535187);
TextDrawTextSize(ro1, -2.0000000.000000);
TextDrawAlignment(ro11);
TextDrawColor(ro10);
TextDrawUseBox(ro1true);
TextDrawBoxColor(ro1170);
TextDrawSetShadow(ro10);
TextDrawSetOutline(ro10);
TextDrawFont(ro10);
ro2 TextDrawCreate(10.823518428.749969"ID:");
TextDrawLetterSize(ro20.4499991.600000);
TextDrawAlignment(ro21);
TextDrawColor(ro2, -16776961);
TextDrawSetShadow(ro20);
TextDrawSetOutline(ro20);
TextDrawBackgroundColor(ro251);
TextDrawFont(ro21);
TextDrawSetProportional(ro21);
ro3 TextDrawCreate(127.529457428.166564"R$:");
TextDrawLetterSize(ro30.4499991.600000);
TextDrawAlignment(ro31);
TextDrawColor(ro38388863);
TextDrawSetShadow(ro30);
TextDrawSetOutline(ro31);
TextDrawBackgroundColor(ro351);
TextDrawFont(ro31);
TextDrawSetProportional(ro31);
ro4 TextDrawCreate(255.048370428.166595"NICK:");
TextDrawLetterSize(ro40.4499991.600000);
TextDrawAlignment(ro41);
TextDrawColor(ro4, -65281);
TextDrawSetShadow(ro40);
TextDrawSetOutline(ro41);
TextDrawBackgroundColor(ro451);
TextDrawFont(ro41);
TextDrawSetProportional(ro41);
ro5 TextDrawCreate(406.824035428.166748"LEVEL:");
TextDrawLetterSize(ro50.4499991.600000);
TextDrawAlignment(ro51);
TextDrawColor(ro565535);
TextDrawSetShadow(ro50);
TextDrawSetOutline(ro51);
TextDrawBackgroundColor(ro551);
TextDrawFont(ro51);
TextDrawSetProportional(ro51);
ro6 TextDrawCreate(553.411193427.583251"VIP:");
TextDrawLetterSize(ro60.4499991.600000);
TextDrawAlignment(ro61);
TextDrawColor(ro6, -2147450625);
TextDrawSetShadow(ro60);
TextDrawSetOutline(ro61);
TextDrawBackgroundColor(ro651);
TextDrawFont(ro61);
TextDrawSetProportional(ro61);
ro7 TextDrawCreate(503.058441394.917114"www.brasilcidadevirtual.tk");
TextDrawLetterSize(ro70.2645881.535833);
TextDrawAlignment(ro71);
TextDrawColor(ro716777215);
TextDrawSetShadow(ro70);
TextDrawSetOutline(ro71);
TextDrawBackgroundColor(ro751);
TextDrawFont(ro73);
TextDrawSetProportional(ro71);
ro8 TextDrawCreate(39.999992428.166687"%d"i);
TextDrawLetterSize(ro80.4499991.600000);
TextDrawAlignment(ro81);
TextDrawColor(ro8, -1);
TextDrawSetShadow(ro80);
TextDrawSetOutline(ro81);
TextDrawBackgroundColor(ro851);
TextDrawFont(ro81);
TextDrawSetProportional(ro81);
ro9 TextDrawCreate(160.941192427.583251"%d"GetPlayerGrana(i));
TextDrawLetterSize(ro90.4499991.600000);
TextDrawAlignment(ro91);
TextDrawColor(ro9, -1);
TextDrawSetShadow(ro90);
TextDrawSetOutline(ro91);
TextDrawBackgroundColor(ro951);
TextDrawFont(ro91);
TextDrawSetProportional(ro91);
ro10 TextDrawCreate(306.823608427.583374"%s"aname);
TextDrawLetterSize(ro100.4499991.600000);
TextDrawAlignment(ro101);
TextDrawColor(ro10, -1);
TextDrawSetShadow(ro100);
TextDrawSetOutline(ro101);
TextDrawBackgroundColor(ro1051);
TextDrawFont(ro101);
TextDrawSetProportional(ro101);
ro11 TextDrawCreate(461.647186427.583312"%d"dini_Int(file"Level"));
TextDrawLetterSize(ro110.4499991.600000);
TextDrawAlignment(ro111);
TextDrawColor(ro11, -1);
TextDrawSetShadow(ro110);
TextDrawSetOutline(ro111);
TextDrawBackgroundColor(ro1151);
TextDrawFont(ro111);
TextDrawSetProportional(ro111);
ro12 TextDrawCreate(591.999572427.000061"%s"viptext);
TextDrawLetterSize(ro120.4499991.600000);
TextDrawAlignment(ro121);
TextDrawColor(ro12, -1);
TextDrawSetShadow(ro120);
TextDrawSetOutline(ro121);
TextDrawBackgroundColor(ro1251);
TextDrawFont(ro121);
TextDrawSetProportional(ro121);
return 
1;

Nвo precisa esconder no OnPlayerDisconnect
Reply
#5

Olha, faz tempo que nгo programo em Pawn mas eu tenho quase certeza que coisas como:
Код:
ro12 = TextDrawCreate(591.999572, 427.000061, "%s", viptext);
Nгo darгo certo (a nгo ser que vc tenha feito algum hook)
Os parвmetros sгo: TextDrawCreate(Float, Float:y, text[])
Reply
#6

Й tbm use PlayerTextDraw pq й para cada player й nгo para todos. isso vai dar um bug faзa os seus rot com MAX_PLAYERS

ro12 = TextDrawCreate(591.999572, 427.000061, "%s", viptext);

Isso tbm n vai da certo, essa funзгo apenas ta criando a textdraw. "%s", viptext vc ta usando os parametros errado,

Para fazer funcionar faзa assim:

PHP код:
new PlayerText:Rot[MAX_PLAYERS][1]; // [MAX_PLAYERS][1] - vai ser para cada id й [1] serб 1 textdraw so para mostrar.
public OnGameModeInit()
{
    
Rot[playerid][0] = CreatePlayerTextDraw(playerid591.999572427.000061"~r~Nick: ~w~Ninguem");
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    new 
string[46], pNome[24];
    
GetPlayerName(playeridpNome24);
    
format(stringsizeof(string), "~r~Nick: ~w~%s"pNome(playerid));
    
PlayerTextDrawSetString(playeridRot[playerid][0], string);
    
PlayerTextDrawShow(playeridRot[playerid][0]);
    return 
1;

Reply
#7

Quote:
Originally Posted by AutoMatic2
Посмотреть сообщение
Й tbm use PlayerTextDraw pq й para cada player й nгo para todos. isso vai dar um bug faзa os seus rot com MAX_PLAYERS

ro12 = TextDrawCreate(591.999572, 427.000061, "%s", viptext);

Isso tbm n vai da certo, essa funзгo apenas ta criando a textdraw. "%s", viptext vc ta usando os parametros errado,

Para fazer funcionar faзa assim:

PHP код:
new PlayerText:Rot[MAX_PLAYERS][1]; // [MAX_PLAYERS][1] - vai ser para cada id й [1] serб 1 textdraw so para mostrar.
public OnGameModeInit()
{
    
Rot[playerid][0] = CreatePlayerTextDraw(playerid591.999572427.000061"~r~Nick: ~w~Ninguem");
    return 
1;
}
public 
OnPlayerUpdate(playerid)
{
    new 
string[46], pNome[24];
    
GetPlayerName(playeridpNome24);
    
format(stringsizeof(string), "~r~Nick: ~w~%s"pNome(playerid));
    
PlayerTextDrawSetString(playeridRot[playerid][0], string);
    
PlayerTextDrawShow(playeridRot[playerid][0]);
    return 
1;

Seu cуdigo nгo vai funcionar, OnGameModeInit nгo possui o parвmetro playerid, o correto seria criar no OnPlayerConnect. Nгo precisa de usar OnPlayerUpdate para atualizar o nick do jogador basta na hora da criaзгo da textdraw no OnPlayerConnect formatar usando o nick do jogador. Tambйm nгo tem sentido criar uma array bidimensional para usar uma textdraw basta usar MAX_PLAYERS.
Reply
#8

Eu fiz aqui no fуrum msm o comando e n vi a array nгo vai ser so o Nome tambйm o level, vip, seja o que for quando ele colocar mais no update.

Outra tbm eu dei um exemplo porйm ele ta usando nick na textdraw tbm -_- sу nгo ia funcionar pq n ta no connect pq o OnGameModeInit n tem playerid.

PHP код:
PlayerText:Rot[MAX_PLAYERS][10]; //Seja o que for. dependendo de quantas textdraw ele quier colocar
//(Level, Dinheiro, VIP, Nome, ID, TempoOnline)... 
Reply
#9

Aconselho vocк a fazer as textdraws em variбveis que fica muito mais organizado e bonito :3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)