SA-MP Forums Archive
[Ajuda] TextDraw String - 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: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] TextDraw String (/showthread.php?tid=583263)



TextDraw String - JuniorTheDM - 27.07.2015

Bom Loguei No Pc do Meu Irmao Para Testar uns Comandos Dai Percebi Que As TextDraws Estao Bugando , Nao aparece a Funзao Aparece So Do Geito Que Eu Criei Vou Postar Elas Aki Me AJudem Por Favor !
PHP код:
//---TOPO GM---//
new PlayerText:INFO[9][MAX_PLAYERS];
//---OnGameModeInit---//
SetTimer("info"1000true);
//---OnPlayerConnect---//
INFO[0][playerid] = CreatePlayerTextDraw(playerid,510.000000330.000000"_");
        
PlayerTextDrawBackgroundColor(playerid,INFO[0][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[0][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[0][playerid], 0.50000012.000000);
        
PlayerTextDrawColor(playerid,INFO[0][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[0][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[0][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[0][playerid], 1);
        
PlayerTextDrawUseBox(playerid,INFO[0][playerid], 1);
        
PlayerTextDrawBoxColor(playerid,INFO[0][playerid], 100);
        
PlayerTextDrawTextSize(playerid,INFO[0][playerid], 632.00000010.000000);
        
PlayerTextDrawSetSelectable(playerid,INFO[0][playerid], 0);
        
INFO[1][playerid] = CreatePlayerTextDraw(playerid,542.000000325.000000"Info");
        
PlayerTextDrawBackgroundColor(playerid,INFO[1][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[1][playerid], 0);
        
PlayerTextDrawLetterSize(playerid,INFO[1][playerid], 0.9000003.000000);
        
PlayerTextDrawColor(playerid,INFO[1][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[1][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[1][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[1][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[1][playerid], 0);
          
INFO[2][playerid] = CreatePlayerTextDraw(playerid,510.000000360.000000"~b~Matou:~w~ --");
        
PlayerTextDrawBackgroundColor(playerid,INFO[2][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[2][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[2][playerid], 0.5000001.000000);
        
PlayerTextDrawColor(playerid,INFO[2][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[2][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[2][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[2][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[2][playerid], 0);
        
INFO[3][playerid] = CreatePlayerTextDraw(playerid,510.000000375.000000"~b~Morreu:~w~ --");
        
PlayerTextDrawBackgroundColor(playerid,INFO[3][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[3][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[3][playerid], 0.5000001.000000);
        
PlayerTextDrawColor(playerid,INFO[3][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[3][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[3][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[3][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[3][playerid], 0);
        
INFO[4][playerid] = CreatePlayerTextDraw(playerid,510.000000390.000000"~b~Spree:~w~ --");
        
PlayerTextDrawBackgroundColor(playerid,INFO[4][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[4][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[4][playerid], 0.5000001.000000);
        
PlayerTextDrawColor(playerid,INFO[4][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[4][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[4][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[4][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[4][playerid], 0);
        
INFO[5][playerid] = CreatePlayerTextDraw(playerid,510.000000405.000000"~b~Score:~w~ --");
        
PlayerTextDrawBackgroundColor(playerid,INFO[5][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[5][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[5][playerid], 0.5000001.000000);
        
PlayerTextDrawColor(playerid,INFO[5][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[5][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[5][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[5][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[5][playerid], 0);
        
INFO[6][playerid] = CreatePlayerTextDraw(playerid,510.000000427.000000"~b~Nome:~w~ NomeDoNosso_Lindo_Jogador");
        
PlayerTextDrawBackgroundColor(playerid,INFO[6][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[6][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[6][playerid], 0.2000001.000000);
        
PlayerTextDrawColor(playerid,INFO[6][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[6][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[6][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[6][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[6][playerid], 0);
        
INFO[7][playerid] = CreatePlayerTextDraw(playerid,534.000000304.000000"00/~b~00~w~/00");
        
PlayerTextDrawBackgroundColor(playerid,INFO[7][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[7][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[7][playerid], 0.4000001.000000);
        
PlayerTextDrawColor(playerid,INFO[7][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[7][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[7][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[7][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[7][playerid], 0);
        
INFO[8][playerid] = CreatePlayerTextDraw(playerid,542.000000316.000000"~b~00~w~:00:00");
        
PlayerTextDrawBackgroundColor(playerid,INFO[8][playerid], 255);
        
PlayerTextDrawFont(playerid,INFO[8][playerid], 1);
        
PlayerTextDrawLetterSize(playerid,INFO[8][playerid], 0.3000001.000000);
        
PlayerTextDrawColor(playerid,INFO[8][playerid], -1);
        
PlayerTextDrawSetOutline(playerid,INFO[8][playerid], 0);
        
PlayerTextDrawSetProportional(playerid,INFO[8][playerid], 1);
        
PlayerTextDrawSetShadow(playerid,INFO[8][playerid], 1);
        
PlayerTextDrawSetSelectable(playerid,INFO[8][playerid], 0);
//---OnPlayerSpawn---//
     
PlayerTextDrawShow(playeridINFO[0][playerid]);
     
PlayerTextDrawShow(playeridINFO[1][playerid]);
     
PlayerTextDrawShow(playeridINFO[2][playerid]);
     
PlayerTextDrawShow(playeridINFO[3][playerid]);
     
PlayerTextDrawShow(playeridINFO[4][playerid]);
     
PlayerTextDrawShow(playeridINFO[5][playerid]);
     
PlayerTextDrawShow(playeridINFO[6][playerid]);
     
PlayerTextDrawShow(playeridINFO[7][playerid]);
     
PlayerTextDrawShow(playeridINFO[8][playerid]);
//--Public Info---//
forward info(playerid);
public 
info(playerid)
{
    new 
STR[128], str2[128], str3[128], str4[128], str5[128];
    
format(STRsizeof(STR), "~b~Matou:~w~ %d"pInfo[playerid][Matou]);
    
PlayerTextDrawSetString(playeridINFO[2][playerid], STR);
    
format(str3sizeof(str3), "~b~Morreu:~w~ %d"pInfo[playerid][Morreu]);
    
PlayerTextDrawSetString(playeridINFO[3][playerid], str3);
    
format(str2sizeof(str2), "~b~Score:~w~ %d",GetPlayerScore(playerid));
    
PlayerTextDrawSetString(playeridINFO[5][playerid], str2);
    
format(str4sizeof(str4), "~b~Nick:~w~ %s",PlayerName(playerid));
    
PlayerTextDrawSetString(playeridINFO[6][playerid], str4);
    
format(str5sizeof(str5), "Seje Bem Vindo Ao Servidor ~b~%s ~w~Para Algumas Informaзoes Use /regras & /comandos"PlayerName(playerid));
    
PlayerTextDrawSetString(playeridTela_LoginNome[playerid], str5);
    return 
1;




Re: TextDraw String - n0minal - 27.07.2015

Dк PlayerTextDrawShow pra atualizar as textdraws toda vez que vocк modificб-las...


Re: TextDraw String - JuniorTheDM - 27.07.2015

Como Assim nao itendi


Re: TextDraw String - n0minal - 27.07.2015

Toda vez que vocк modificar uma textdraw vocк precisa mostrar ela pro player novamente pra atualizar, exemplo :

Код:
PlayerTextDrawsetstring(playerid, Info[9][playerid], "agora sim");//mudou
PlayerTextDrawShow(playerid,  Info[9][playerid ]);//atualizou



Re: TextDraw String - JuniorTheDM - 27.07.2015

Assim
PHP код:
public info(playerid)
{
    new 
STR[128], str2[128], str3[128], str4[128], str5[128];
    
format(STRsizeof(STR), "~b~Matou:~w~ %d"pInfo[playerid][Matou]);
    
PlayerTextDrawSetString(playeridINFO[2][playerid], STR);
    
PlayerTextDrawShow(playeridInfo[2][playerid]);//atualizou
    
format(str3sizeof(str3), "~b~Morreu:~w~ %d"pInfo[playerid][Morreu]);
    
PlayerTextDrawSetString(playeridINFO[3][playerid], str3);
    
PlayerTextDrawShow(playeridInfo[3][playerid]);//atualizou
    
format(str2sizeof(str2), "~b~Score:~w~ %d",GetPlayerScore(playerid));
    
PlayerTextDrawSetString(playeridINFO[5][playerid], str2);
    
PlayerTextDrawShow(playeridInfo[5][playerid]);//atualizou
    
format(str4sizeof(str4), "~b~Nick:~w~ %s",PlayerName(playerid));
    
PlayerTextDrawSetString(playeridINFO[6][playerid], str4);
    
PlayerTextDrawShow(playeridInfo[6][playerid]);//atualizou
    
format(str5sizeof(str5), "Seje Bem Vindo Ao Servidor ~b~%s ~w~Para Algumas Informaзoes Use /regras & /comandos"PlayerName(playerid));
    
PlayerTextDrawSetString(playeridTela_LoginNome[playerid], str5);
    return 
1;




Re: TextDraw String - n0minal - 27.07.2015

Sim, sу faltou a ъltima textdraw ai que vocк esqueceu...


Re: TextDraw String - JuniorTheDM - 27.07.2015

vOU Testar AGR


Re: TextDraw String - n0minal - 27.07.2015

Seu timer tб errado, precisa ser timerex na onplayerconnect, vocк tambйm tб usando muita memуria desnecessaria, nгo tem porque criar uma string pra cada format nesse seu cуdigo, por isso vocк estб com problemas de stack heap size.

Na verdade vocк nem precisa de timer, seu cуdigo tб fazendo um loop de 100ms com o timer quando vocк poderia usar apenas seu codigo na onplayerconnect.