[Ajuda] TextDrawґs
#1

Ola galera fiz duas text draws mas nenhuma e nem outra aparece quando logo no servidor.

CODE\/
pawn Код:
format(String,sizeof(String),"%s", zones); // Onde ele esta Ex: Jeferson
    Localidade = TextDrawCreate(57.5 ,337 , String);
    TextDrawFont(Localidade , 0);
    TextDrawLetterSize(Localidade , 0.4, 2.8000000000000003);
    TextDrawColor(Localidade , 0xffffffFF);
    TextDrawSetOutline(Localidade , true);
    TextDrawSetProportional(Localidade , true);
    TextDrawSetShadow(Localidade , 1);

    for(new i=0;i<MAX_PLAYERS;i++)
    {
        format(String,sizeof(String),"Veiculo: %s       Velocidade: %i Km/h",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400], GetPlayerSpeed(i));
        Vel = TextDrawCreate(181.5 ,392 , String);
        TextDrawFont(Vel , 1);
        TextDrawLetterSize(Vel , 0.5, 3.5);
        TextDrawColor(Vel , 0xffffffFF);
        TextDrawSetOutline(Vel , false);
        TextDrawSetProportional(Vel , true);
        TextDrawSetShadow(Vel , 1);
    }


if(newstate == PLAYER_STATE_DRIVER)
    {
        TimerVelocimetro[playerid] = SetTimerEx("RecarregarVelo", 100, true, "n", playerid);
    }
    else if(oldstate == PLAYER_STATE_DRIVER)
    {
        KillTimer(TimerVelocimetro[playerid]);
        TextDrawHideForPlayer(playerid, Vel);
    }


forward LocalidadePlayer(playerid);
public LocalidadePlayer(playerid)
{
    format(String,sizeof(String),"%s", zones);
    Localidade = TextDrawCreate(57.5 ,337 , String);
    TextDrawFont(Localidade , 0);
    TextDrawLetterSize(Localidade , 0.4, 2.8000000000000003);
    TextDrawColor(Localidade , 0xffffffFF);
    TextDrawSetOutline(Localidade , true);
    TextDrawSetProportional(Localidade , true);
    TextDrawSetShadow(Localidade , 1);
    return true;
}
forward RecarregarVelo(playerid);
public RecarregarVelo(playerid)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        format(String,sizeof(String),"Veiculo: %s       Velocidade: %i Km/h",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400], GetPlayerSpeed(i));
        Vel = TextDrawCreate(181.5 ,392 , String);
        TextDrawFont(Vel , 1);
        TextDrawLetterSize(Vel , 0.5, 3.5);
        TextDrawColor(Vel , 0xffffffFF);
        TextDrawSetOutline(Vel , false);
        TextDrawSetProportional(Vel , true);
        TextDrawSetShadow(Vel , 1);
    }
    return true;
}
Reply
#2

Botou O TextDrawShowForPlayer ?
Reply
#3

Nгo funfo ¬¬
Reply
#4

Deve da certo agora, Refiz ele

pawn Код:
// No Topo

new Text:Localidade;
new Text:Vel;
new TimerVelocimetro[MAX_PLAYERS];
new String[148];

// OnGameModeInit

public OnGameModeInit()
{
    format(String,sizeof(String),"%s", zones);
    Localidade = TextDrawCreate(57.5 ,337 , String);
    TextDrawFont(Localidade , 0);
    TextDrawLetterSize(Localidade , 0.4, 2.8000000000000003);
    TextDrawColor(Localidade , 0xffffffFF);
    TextDrawSetOutline(Localidade , 1);
    TextDrawSetProportional(Localidade , 1);
    TextDrawSetShadow(Localidade , 1);

    for(new i=0;i<MAX_PLAYERS;i++)
    {
        format(String,sizeof(String),"Veiculo: %s       Velocidade: %i Km/h",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400], GetPlayerSpeed(i));
        Vel = TextDrawCreate(181.5 ,392 , String);
        TextDrawFont(Vel , 1);
        TextDrawLetterSize(Vel , 0.5, 3.5);
        TextDrawColor(Vel , 0xffffffFF);
        TextDrawSetOutline(Vel , 0);
        TextDrawSetProportional(Vel , 1);
        TextDrawSetShadow(Vel , 1);
    }
    return 1;
}

// OnPlayerDisconnect

public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid, Velo);
    TextDrawHideForPlayer(playerid, Localidade);
    KillTimer(TimerVelocimetro[playerid]);
    return 1;
}

// OnPlayerStateChange

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        TimerVelocimetro[playerid] = SetTimerEx("RecarregarVelo", 100, true, "n", playerid);

    }
    else if(oldstate == PLAYER_STATE_DRIVER)
    {
        KillTimer(TimerVelocimetro[playerid]);
        TextDrawHideForPlayer(playerid, Vel);
    }
    return 1;
}


forward LocalidadePlayer(playerid);
public LocalidadePlayer(playerid)
{
    format(String,sizeof(String),"%s", zones);
    Localidade = TextDrawCreate(57.5 ,337 , String);
    TextDrawFont(Localidade , 0);
    TextDrawLetterSize(Localidade , 0.4, 2.8000000000000003);
    TextDrawColor(Localidade , 0xffffffFF);
    TextDrawSetOutline(Localidade , 1);
    TextDrawSetProportional(Localidade , 1);
    TextDrawSetShadow(Localidade , 1);
    TextDrawShowForPlayer(playerid,Localidade);
    return 1;
}
forward RecarregarVelo(playerid);
public RecarregarVelo(playerid)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        format(String,sizeof(String),"Veiculo: %s       Velocidade: %i Km/h",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400], GetPlayerSpeed(i));
        Vel = TextDrawCreate(181.5 ,392 , String);
        TextDrawFont(Vel , 1);
        TextDrawLetterSize(Vel , 0.5, 3.5);
        TextDrawColor(Vel , 0xffffffFF);
        TextDrawSetOutline(Vel , false);
        TextDrawSetProportional(Vel , true);
        TextDrawSetShadow(Vel , 1);
        TextDrawShowForPlayer(playerid,Vel);    // ShowForPlayer
    }
    return 1;
}
Reply
#5

edt..

vc tбh criando os tds 2 vezes pq nгo cria uma sуh, e usa textdrawsetstring;
Reply
#6

agora aparece um monte de letras nada a ver.
Reply
#7

Quote:
Originally Posted by jpeg
Посмотреть сообщение
edt..

vc tбh criando os tds 2 vezes pq nгo cria uma sуh, e usa textdrawsetstring;
Lool e mesmo O.o

Arrumei:

pawn Код:
// No Topo

new Text:Localidade;
new Text:Vel;
new TimerVelocimetro[MAX_PLAYERS];
new String[148];

// OnGameModeInit

public OnGameModeInit()
{
    format(String,sizeof(String)," ");
    Localidade = TextDrawCreate(57.5 ,337);
    TextDrawFont(Localidade , 0);
    TextDrawLetterSize(Localidade , 0.4, 2.8000000000000003);
    TextDrawColor(Localidade , 0xffffffFF);
    TextDrawSetOutline(Localidade , 1);
    TextDrawSetProportional(Localidade , 1);
    TextDrawSetShadow(Localidade , 1);

    for(new i=0;i<MAX_PLAYERS;i++)
    {
        format(String,sizeof(String)," ");
        Vel = TextDrawCreate(181.5 ,392);
        TextDrawFont(Vel , 1);
        TextDrawLetterSize(Vel , 0.5, 3.5);
        TextDrawColor(Vel , 0xffffffFF);
        TextDrawSetOutline(Vel , 0);
        TextDrawSetProportional(Vel , 1);
        TextDrawSetShadow(Vel , 1);
    }
    return 1;
}

// OnPlayerDisconnect

public OnPlayerDisconnect(playerid, reason)
{
    TextDrawHideForPlayer(playerid, Velo);
    TextDrawHideForPlayer(playerid, Localidade);
    KillTimer(TimerVelocimetro[playerid]);
    return 1;
}

// OnPlayerStateChange

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(newstate == PLAYER_STATE_DRIVER)
    {
        TimerVelocimetro[playerid] = SetTimerEx("RecarregarVelo", 100, true, "n", playerid);

    }
    else if(oldstate == PLAYER_STATE_DRIVER)
    {
        KillTimer(TimerVelocimetro[playerid]);
        TextDrawHideForPlayer(playerid, Vel);
    }
    return 1;
}


forward LocalidadePlayer(playerid);
public LocalidadePlayer(playerid)
{
    format(String,sizeof(String),"%s", zones);
    TextDrawHideForPlayer(playerid, Localidade);
    TextDrawSetString(Localidade, String);
    TextDrawShowForPlayer(playerid,Localidade);
    return 1;
}
forward RecarregarVelo(playerid);
public RecarregarVelo(playerid)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    {
        format(String,sizeof(String),"Veiculo: %s       Velocidade: %i Km/h",vehName[GetVehicleModel(GetPlayerVehicleID(i))-400], GetPlayerSpeed(i));
        TextDrawHideForPlayer(playerid, Velo);
        TextDrawSetString(Velo, String);
        TextDrawShowForPlayer(playerid, Velo);
        // ShowForPlayer
    }
    return 1;
}
Ao criar uma Text que sera mudada, nao prescisa definir algo no TextDrawCreate e sim use TextDrawSetString pois assim ira mudar a TextDraw ...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)