SA-MP Forums Archive
[Ajuda] Veja se estou CERTO - 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] Veja se estou CERTO (/showthread.php?tid=442944)



Veja se estou CERTO - Wellington1999 - 09.06.2013

pawn Код:
new Text:TextdrawPing2;

TextDrawShowForPlayer(playerid, TextdrawPing2);

SetTimer("Ping2", 300, 1);

    TextdrawPing2 = TextDrawCreate(560.000000, 400.000000, "-");
TextDrawBackgroundColor(TextdrawPing2, 255);
TextDrawFont(TextdrawPing2, 1);
TextDrawLetterSize(TextdrawPing2, 0.500000, 1.000000);
TextDrawColor(TextdrawPing2, -1);
TextDrawSetOutline(TextdrawPing2, 0);
TextDrawSetProportional(TextdrawPing2, 1);
TextDrawSetShadow(TextdrawPing2, 1);

forward Ping2(giveplayerid);
public Ping2(giveplayerid)
{
    new str[128];
    format(str, sizeof(str), "~p~Ping:~y~%d", GetPlayerPing(giveplayerid));
    TextDrawSetString(TextdrawPing2, str);
    return true;
}
o Ping so fica do id 0


Re: Veja se estou CERTO - feliphemort - 09.06.2013

Crie um loop, talvez resolva.


Re: Veja se estou CERTO - VivendoVirtual - 09.06.2013

Tente Adpitar ele ao seu Gamemode !

pawn Код:
new Text:Ping[MAX_PLAYERS];

    for(new i=0; i < MAX_PLAYERS; i++){
    Ping[i] = TextDrawCreate(560.000000, 400.000000, " ");
    TextDrawBackgroundColor(Ping[i], 255);
    TextDrawFont(Ping[i], 3);
    TextDrawLetterSize(Ping[i], 0.230000, 1.400000);
    TextDrawColor(Ping[i], -1);
    TextDrawSetOutline(Ping[i], 0);
    TextDrawSetOutline(Ping[i], 1);
    TextDrawSetProportional(Ping[i], 1);

public OnPlayerSpawn(playerid)
{
    new VVString[128];
    format( VVString, sizeof VVString, "~w~Ping:~r~ %d/1200", GetPlayerPing(playerid));
    TextDrawSetString(Ping[playerid], VVString);
    TextDrawShowForPlayer( playerid, Ping[playerid] );
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new VVString[128];
    format( VVString, sizeof VVString, "~w~Ping:~r~ %d/1200", GetPlayerPing(playerid));
    TextDrawSetString(Ping[playerid], VVString);
    TextDrawShowForPlayer( playerid, Ping[playerid] );
    return 1;
}

//-----------------------------------------------------------------------------------------------//

new Text:TextdrawPing2[MAX_PLAYERS];

TextDrawShowForPlayer(playerid, TextdrawPing2[playerid]);

SetTimer("Ping2", 300, 1);

for(new playerid=0; playerid < MAX_PLAYERS; playerid++){
TextdrawPing2[playerid] = TextDrawCreate(560.000000, 400.000000, "-");
TextDrawBackgroundColor(TextdrawPing2[playerid], 255);
TextDrawFont(TextdrawPing2[playerid], 1);
TextDrawLetterSize(TextdrawPing2[playerid], 0.500000, 1.000000);
TextDrawColor(TextdrawPing2[playerid], -1);
TextDrawSetOutline(TextdrawPing2[playerid], 0);
TextDrawSetProportional(TextdrawPing2[playerid], 1);
TextDrawSetShadow(TextdrawPing2[playerid], 1);

forward Ping2(giveplayerid);
public Ping2(giveplayerid)
{
    new str[128];
    format(str, sizeof(str), "~p~Ping:~y~%d", GetPlayerPing(giveplayerid));
    TextDrawSetString(TextdrawPing2[playerid], str);
    return true;
}
Em Caso de Dъvidas manda Msg por Privado ^_^



Re: Veja se estou CERTO - MatheusAlcapone - 09.06.2013

[QUOTE=VivendoVirtual;2562782]
pawn Код:
new Text:Ping[MAX_PLAYERS]; //PING

    for(new i=0; i < MAX_PLAYERS; i++){
    Ping[i] = TextDrawCreate(560.000000, 400.000000, " ");
    TextDrawBackgroundColor(Ping[i], 255);
    TextDrawFont(Ping[i], 3);
    TextDrawLetterSize(Ping[i], 0.230000, 1.400000);
    TextDrawColor(Ping[i], -1);
    TextDrawSetOutline(Ping[i], 0);
    TextDrawSetOutline(Ping[i], 1);
    TextDrawSetProportional(Ping[i], 1);

public OnPlayerSpawn(playerid)
{
    new VVString[128];
    format( VVString, sizeof VVString, "~w~Ping:~r~ %d/1200", GetPlayerPing(playerid));
    TextDrawSetString(Ping[playerid], VVString);
    TextDrawShowForPlayer( playerid, Ping[playerid] );
    return 1;
}

public OnPlayerUpdate(playerid)
{
    new VVString[128];
    format( VVString, sizeof VVString, "~w~Ping:~r~ %d/1200", GetPlayerPing(playerid));
    TextDrawSetString(Ping[playerid], VVString);
    TextDrawShowForPlayer( playerid, Ping[playerid] );
    return 1;
}

Seu

new Text:TextdrawPing2[MAX_PLAYERS];

TextDrawShowForPlayer(playerid, TextdrawPing2[MAX_PLAYERS]);

SetTimer("Ping2", 300, 1);

for(new playerid=0; playerid < MAX_PLAYERS; playerid++){
TextdrawPing2[playerid] = TextDrawCreate(560.000000, 400.000000, "-");
TextDrawBackgroundColor(TextdrawPing2[playerid], 255);
TextDrawFont(TextdrawPing2[playerid], 1);
TextDrawLetterSize(TextdrawPing2[playerid], 0.500000, 1.000000);
TextDrawColor(TextdrawPing2[playerid], -1);
TextDrawSetOutline(TextdrawPing2[playerid], 0);
TextDrawSetProportional(TextdrawPing2[playerid], 1);
TextDrawSetShadow(TextdrawPing2[playerid], 1);

forward Ping2(giveplayerid);
public Ping2(giveplayerid)
{
    new str[128];
    format(str, sizeof(str), "~p~Ping:~y~%d", GetPlayerPing(giveplayerid));
    TextDrawSetString(TextdrawPing2[playerid], str);
    return true;
}
Esta errado o seu, Use playertextdraw.


Re: Veja se estou CERTO - VivendoVirtual - 09.06.2013

Editado o Poste !