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);
new str1[10];
format(str1, sizeof(str1), "%d", playerid);
ro8 = TextDrawCreate(39.999992, 428.166687, str1);
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);
new str2[100];
format(str2, sizeof(str2), "%d", GetPlayerGrana(playerid));
ro9 = TextDrawCreate(160.941192, 427.583251, str2);
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);
new str3[100];
format(str3, sizeof(str3), "%s", PlayerName(playerid));
ro10 = TextDrawCreate(306.823608, 427.583374, str3);
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);
new str4[100];
format(str4, sizeof(str4), "%d", dini_Int(file, "Level"));
ro11 = TextDrawCreate(461.647186, 427.583312, str4);
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);
new str5[100];
new viptext[20];
if(IsPlayerVIP(playerid) == 1){format(viptext,20,"~w~Sim");}
else{format(viptext,20,"~w~Nao");}
format(str5, sizeof(str5), "%s", viptext);
ro12 = TextDrawCreate(591.999572, 427.000061, str5);
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);
return 1;
Como estб essa tua funзгo PlayerName? Ela tб funcionando bem em outras partes do gamemode?
|
#include <a_samp>
public OnGameModeInit()
{
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);
SetTimer("TodosPlayers", 1000, false);
return 1;
}
forward TodosPlayers();
public TodosPlayers()
{
for(new i; i < MAX_PLAYERS; i++)
{
// Funзгo para atualizar as text draws
return 1;
}
SetTimer("TodosPlayers", 1000, false);
}
ReturnName(playerid, underscore=1) { static name[MAX_PLAYER_NAME + 1]; GetPlayerName(playerid, name, sizeof(name)); if (!underscore) { for (new i = 0, len = strlen(name); i < len; i ++) { if (name[i] == '_') name[i] = ' '; } return name; }
PHP Code:
|
forward preloadtext(playerid);
public preloadtext(playerid)
{
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);
new str1[100];
format(str1, sizeof(str1), "%d", playerid);
ro8 = TextDrawCreate(39.999992, 428.166687, str1);
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);
new str2[500];
format(str2, sizeof(str2), "%d", GetPlayerGrana(playerid));
ro9 = TextDrawCreate(160.941192, 427.583251, str2);
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);
new str3[500];
format(str3, sizeof(str3), "%s", PlayerName(playerid));
ro10 = TextDrawCreate(306.823608, 427.583374, str3);
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);
new str4[500];
format(str4, sizeof(str4), "%d", dini_Int(file, "Level"));
ro11 = TextDrawCreate(461.647186, 427.583312, str4);
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);
new str5[100];
new viptext[20];
if(IsPlayerVIP(playerid) == 1){format(viptext,20,"~w~Sim");}
else{format(viptext,20,"~w~Nao");}
format(str5, sizeof(str5), "%s", viptext);
ro12 = TextDrawCreate(591.999572, 427.000061, str5);
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);
return 1;
}
Manda todas as textdraws, sem estar junto com essa forward.
Aн manda o cуdigo que vc tб usando dentro da forward. |
#include <a_samp>
public OnGameModeInit()
{
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);
SetTimer("TodosPlayers", 1000, false);
return 1;
}
forward TodosPlayers();
public TodosPlayers()
{
for(new i; i < MAX_PLAYERS; i++)
{
new str1[10];
format(str1, sizeof(str1), "%d", i);
TextDrawSetString(ro8, str1);
new str2[100];
format(str2, sizeof(str2), "%d", GetPlayerGrana(i)); // Se nгo der certo, olha essas funзхes, tipo essa GetPlayerGrana
TextDrawSetString(ro9, str2);
new str3[100];
format(str3, sizeof(str3), "%s", PlayerName(i));
TextDrawSetString(ro10, str3);
new str4[100];
format(str4, sizeof(str4), "%d", dini_Int(file, "Level"));
TextDrawSetString(rol11, str4);
new str5[100];
new viptext[20];
if(IsPlayerVIP(i) == 1){format(viptext,20,"~w~Sim");}
else{format(viptext,20,"~w~Nao");}
format(str5, sizeof(str5), "%s", viptext);
TextDrawSetString(ro12, str5);
return 1;
}
SetTimer("TodosPlayers", 1000, false);
}
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);
new str1[100];
format(str1, sizeof(str1), "~w~%d", playerid);
ro8 = TextDrawCreate(39.999992, 428.166687, str1);
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);
new str2[500];
format(str2, sizeof(str2), "~w~%d", GetPlayerGrana(playerid));
ro9 = TextDrawCreate(160.941192, 427.583251, str2);
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);
new str3[500];
format(str3, sizeof(str3), "~w~%s", PlayerName(playerid));
ro10 = TextDrawCreate(306.823608, 427.583374, str3);
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);
new str4[500];
format(str4, sizeof(str4), "~w~%d", dini_Int(file, "Level"));
ro11 = TextDrawCreate(461.647186, 427.583312, str4);
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);
new str5[100];
new viptext[20];
if(IsPlayerVIP(playerid) == 1){format(viptext,20,"~w~Sim");}
else{format(viptext,20,"~w~Nao");}
format(str5, sizeof(str5), "%s", viptext);
ro12 = TextDrawCreate(591.999572, 427.000061, str5);
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);
return 1;
}
Sim, essas sгo as textdraws, mas manda as stocks/forwards/funзхes que foram chamadas ali. Porque ao que tudo indica elas estгo retornando um valor 0.
O erro aparenta ser na funзгo propriamente dita. Seria legal que tu mandasse o cуdigo completo dessa PlayerName(playerid) e o cуdigo da GetPlayerGrana(playerid), porque o bug aparenta ser na funзгo. Mas faz o seguinte nas textdraws: PHP Code:
|
Vocк tem que criar como PlayerTextdraw.
Se usar como global, vai causar conflito quando houver outro jogador (as informaзхes irгo ser trocadas). Depois, em OnPlayerSpawn ou outra callback de sua preferкncia vocк precisa formatar a string. Use %s para letras e nъmeros e use %d apenas para nъmeros. |
Sou meio que iniciante no pawno, nгo dou conta de fazer isso...
|
// Topo do GM
new PlayerText:Rodape[MAX_PLAYERS][7];
forward RodapeTD(playerid);
// Public OnPlayerConnect
public OnPlayerConnect(playerid)
{
LoadTextDraws(playerid);
return 1;
}
// Final do GM
LoadTextDraws(playerid)
{
SetTimerEx("RodapeTD", 500, true, "d", playerid);
Rodape[playerid][0] = CreatePlayerTextDraw(playerid, 641.529418, 423.250000, "_");
PlayerTextDrawBackgroundColor(playerid, Rodape[playerid][0], 255);
PlayerTextDrawFont(playerid, Rodape[playerid][0], 0);
PlayerTextDrawLetterSize(playerid, Rodape[playerid][0], 0.000000, 2.535187);
PlayerTextDrawColor(playerid, Rodape[playerid][0], 0);
PlayerTextDrawSetOutline(playerid, Rodape[playerid][0], 0);
PlayerTextDrawSetProportional(playerid, Rodape[playerid][0], 1);
PlayerTextDrawSetShadow(playerid, Rodape[playerid][0], 1);
PlayerTextDrawUseBox(playerid, Rodape[playerid][0], 1);
PlayerTextDrawBoxColor(playerid, Rodape[playerid][0], 170);
PlayerTextDrawTextSize(playerid, Rodape[playerid][0], -2.000000, 0.000000);
Rodape[playerid][1] = CreatePlayerTextDraw(playerid, 10.823518, 428.749969, "ID:");
PlayerTextDrawBackgroundColor(playerid, Rodape[playerid][1], 51);
PlayerTextDrawAlignment(playerid, Rodape[playerid][1], 1);
PlayerTextDrawFont(playerid, Rodape[playerid][1], 1);
PlayerTextDrawLetterSize(playerid, Rodape[playerid][1], 0.449999, 1.600000);
PlayerTextDrawColor(playerid, Rodape[playerid][1], -16776961);
PlayerTextDrawSetOutline(playerid, Rodape[playerid][1], 0);
PlayerTextDrawSetProportional(playerid, Rodape[playerid][1], 1);
Rodape[playerid][2] = CreatePlayerTextDraw(playerid, 127.529457, 428.166564, "R$:");
PlayerTextDrawBackgroundColor(playerid, Rodape[playerid][2], 51);
PlayerTextDrawAlignment(playerid, Rodape[playerid][2], 1);
PlayerTextDrawFont(playerid, Rodape[playerid][2], 1);
PlayerTextDrawLetterSize(playerid, Rodape[playerid][2], 0.449999, 1.600000);
PlayerTextDrawColor(playerid, Rodape[playerid][2], 8388863);
PlayerTextDrawSetOutline(playerid, Rodape[playerid][2], 0);
PlayerTextDrawSetProportional(playerid, Rodape[playerid][2], 1);
Rodape[playerid][3] = CreatePlayerTextDraw(playerid, 255.048370, 428.166595, "NICK:");
PlayerTextDrawBackgroundColor(playerid, Rodape[playerid][3], 51);
PlayerTextDrawAlignment(playerid, Rodape[playerid][3], 1);
PlayerTextDrawFont(playerid, Rodape[playerid][3], 1);
PlayerTextDrawLetterSize(playerid, Rodape[playerid][3], 0.449999, 1.600000);
PlayerTextDrawColor(playerid, Rodape[playerid][3], -65281);
PlayerTextDrawSetOutline(playerid, Rodape[playerid][3], 0);
PlayerTextDrawSetProportional(playerid, Rodape[playerid][3], 1);
Rodape[playerid][4] = CreatePlayerTextDraw(playerid, 406.824035, 428.166748, "LEVEL:");
PlayerTextDrawBackgroundColor(playerid, Rodape[playerid][4], 51);
PlayerTextDrawAlignment(playerid, Rodape[playerid][4], 1);
PlayerTextDrawFont(playerid, Rodape[playerid][4], 1);
PlayerTextDrawLetterSize(playerid, Rodape[playerid][4], 0.449999, 1.600000);
PlayerTextDrawColor(playerid, Rodape[playerid][4], 65535);
PlayerTextDrawSetOutline(playerid, Rodape[playerid][4], 0);
PlayerTextDrawSetProportional(playerid, Rodape[playerid][4], 1);
Rodape[playerid][5] = CreatePlayerTextDraw(playerid, 553.411193, 427.583251, "VIP:");
PlayerTextDrawBackgroundColor(playerid, Rodape[playerid][5], 51);
PlayerTextDrawAlignment(playerid, Rodape[playerid][5], 1);
PlayerTextDrawFont(playerid, Rodape[playerid][5], 1);
PlayerTextDrawLetterSize(playerid, Rodape[playerid][5], 0.449999, 1.600000);
PlayerTextDrawColor(playerid, Rodape[playerid][5], -2147450625);
PlayerTextDrawSetOutline(playerid, Rodape[playerid][5], 0);
PlayerTextDrawSetProportional(playerid, Rodape[playerid][5], 1);
Rodape[playerid][6] = CreatePlayerTextDraw(playerid, 503.058441, 394.917114, "www.brasilcidadevirtual.tk");
PlayerTextDrawBackgroundColor(playerid, Rodape[playerid][6], 51);
PlayerTextDrawAlignment(playerid, Rodape[playerid][6], 1);
PlayerTextDrawFont(playerid, Rodape[playerid][6], 1);
PlayerTextDrawLetterSize(playerid, Rodape[playerid][6], 0.264588, 1.535833);
PlayerTextDrawColor(playerid, Rodape[playerid][6], 16777215);
PlayerTextDrawSetOutline(playerid, Rodape[playerid][6], 0);
PlayerTextDrawSetProportional(playerid, Rodape[playerid][6], 1);
return 1;
}
public RodapeTD(playerid)
{
if(IsPlayerConnected(playerid))
{
new String[45];
PlayerTextDrawSetString(playerid, Rodape[playerid][0], "_");
PlayerTextDrawShow(playerid, Rodape[playerid][0]);
format(String, sizeof(String), "ID: ~w~%d", playerid);
PlayerTextDrawSetString(playerid, Rodape[playerid][1], String);
PlayerTextDrawShow(playerid, Rodape[playerid][1]);
format(String, sizeof(String), "R$: ~w~%d", GetPlayerGrana(playerid));
PlayerTextDrawSetString(playerid, Rodape[playerid][2], String);
PlayerTextDrawShow(playerid, Rodape[playerid][2]);
format(String, sizeof(String), "NICK: ~w~%s", PlayerName(playerid));
PlayerTextDrawSetString(playerid, Rodape[playerid][3], String);
PlayerTextDrawShow(playerid, Rodape[playerid][3]);
format(String, sizeof(String), "LEVEL: ~w~%d", dini_Int(file, "Level"));
PlayerTextDrawSetString(playerid, Rodape[playerid][4], String);
PlayerTextDrawShow(playerid, Rodape[playerid][4]);
if(IsPlayerVIP(playerid) == 1)
{
format(String, sizeof(String), "VIP: ~w~Sim");
PlayerTextDrawSetString(playerid, Rodape[playerid][5], String);
PlayerTextDrawShow(playerid, Rodape[playerid][5]);
}
else
{
format(String, sizeof(String), "VIP: ~w~Nao");
PlayerTextDrawSetString(playerid, Rodape[playerid][5], String);
PlayerTextDrawShow(playerid, Rodape[playerid][5]);
}
PlayerTextDrawSetString(playerid, Rodape[playerid][6], "www.brasilcidadevirtual.tk");
PlayerTextDrawShow(playerid, Rodape[playerid][6]);
}
return 1;
}