[Pedido] Id da casa em textdrawn <<<<<<
#1

Ola, Meus Amigo do forum presiso de um ajudinha de vcs se poder me ajuda eu acradeзo

eu queria assim um textdrawn com id da casa na tela ficar assim textdrawn Sua casa й id (%d)

se alguem poder me ajuda agradeзo muito obrigado *


Код:
textdrawn  Sua casa й id (%d)
Reply
#2

Cria uma TextDraw em seguida use TextDrawSetString.
Reply
#3

Eu tava colocando assim mais nao pego alguem pode me ajuda ?

Aqui й para fazer a funзao para conseguir o id dela

Quote:

for(new p = 0; p < MAX_PROPS; p++)
new string[128];
format(string, sizeof(string), "~p~Empresa ID ~y~%s", p);
TextDrawSetString(emptext[i], string);
TextDrawShowForPlayer(i, emptext[i]);
}
}
}
}

Aqui para aparecer o textdrawn para todos player sem casas ou com casa


Quote:

for(new i=0; i < MAX_PLAYERS; i++)
{
emptext[i] = TextDrawCreate(100,430," ");
TextDrawFont(emptext[i],1);
TextDrawColor(emptext[i],0xFFFFFFAA);
TextDrawLetterSize(emptext[i],0.499999,0.899999);
TextDrawSetOutline(emptext[i],1);
TextDrawSetShadow(emptext[i],0);
TextDrawSetProportional(emptext[i],1);
TextDrawBackgroundColor(emptext[i],0x000000ff);
}
return 1;
}

Reply
#4

Fiz uma base pra vocк... й sу trocar a variбvel Business_ID para a variбvel que armazena o ID da empresa...
pawn Код:
#if defined MAX_PLAYERS
    #undef MAX_PLAYERS
#define MAX_PLAYERS             ( 50 )
#endif

#define LOCAL_PLAYER        ( "/Players/%s.ini" )

static
    Text:BusinessID[ MAX_PLAYERS ];

forward OnBusinessUpdate( playerid );


public OnPlayerConnect( playerid )
{
    BusinessID[ playerid ]    =    TextDrawCreate( 100, 430, "_" );
    TextDrawFont(               BusinessID[ playerid ], 1 );
    TextDrawColor(              BusinessID[ playerid ], 0xFFFFFFAA );
    TextDrawLetterSize(         BusinessID[ playerid ], 0.499999, 0.899999 );
    TextDrawSetOutline(         BusinessID[ playerid ], 1 );
    TextDrawSetShadow(          BusinessID[ playerid ], 0 );
    TextDrawSetProportional(    BusinessID[ playerid ], 1 );
    TextDrawBackgroundColor(    BusinessID[ playerid ], 0x000000ff );
    return true;
}

public OnBusinessUpdate( playerid )
{
    new string[72];
    TextDrawHideForPlayer( playerid, BusinessID[ playerid ] )
    format( string, sizeof( string ), "~p~Empresa ID ~y~%i", dini_Get( LOCAL_PLAYER, "id") );  
    TextDrawSetString( BusinessID[ playerid ], string );   
    TextDrawShowForPlayer( i, BusinessID[ playerid ] );
    return true;
}


//Como chamar a funзгo:
SetTimerEx( "OnBusinessUpdate", 1000, true, "i", playerid );
//Ou
OnBusinessUpdate( playerid );
Reply
#5

Quote:
Originally Posted by Schocc
Посмотреть сообщение
Fiz uma base pra vocк... й sу trocar a variбvel Business_ID para a variбvel que armazena o ID da empresa...
pawn Код:
#define LOJA_DE_ARMAS           ( 0 )
#define MAX_EMPRESAS            ( 50 )
#define LOCAL_PROPRIEDADES      ( "/Pasta/%d.ini" )

#if defined MAX_PLAYERS
    #undef MAX_PLAYERS
#define MAX_PLAYERS             ( 50 )
#endif
   
forward OnBusinessUpdate( playerid );
static
    Business_ID,
    Text:BusinessID[ MAX_PLAYERS ];

public OnPlayerConnect( playerid )
{
    BusinessID[ playerid ]    =    TextDrawCreate( 100, 430, "_" );
    TextDrawFont(               BusinessID[ playerid ], 1 );
    TextDrawColor(              BusinessID[ playerid ], 0xFFFFFFAA );
    TextDrawLetterSize(         BusinessID[ playerid ], 0.499999, 0.899999 );
    TextDrawSetOutline(         BusinessID[ playerid ], 1 );
    TextDrawSetShadow(          BusinessID[ playerid ], 0 );
    TextDrawSetProportional(    BusinessID[ playerid ], 1 );
    TextDrawBackgroundColor(    BusinessID[ playerid ], 0x000000ff );
    return true;
}

public OnBusinessUpdate( playerid )
{
    new string[72];
   
    TextDrawHideForPlayer( playerid, BusinessID[ playerid ] )
    format( string, sizeof( string ), "~p~Empresa ID ~y~%i", Business_ID );
    TextDrawSetString( BusinessID[ playerid ], string );   
    TextDrawShowForPlayer( i, BusinessID[ playerid ] );
    return true;
}


//Como chamar a funзгo:
SetTimerEx( "OnBusinessUpdate", 1000, true, "i", playerid );
//Ou
OnBusinessUpdate( playerid );
Код:
MAX_PROPS ??
Reply
#6

Assim fuciona ? Me ajudem por favor

Код:
for(new p = 0; p < MAX_PROPS; p++)
{
if(pickupid == dini_Int(string, "Id")){
format(string, sizeof(string), "~p~Empresa ID ~y~%s", p);
TextDrawSetString(emptext[i], string);
TextDrawShowForPlayer(i, emptext[i]);
}
}
}
Reply
#7

Quote:
Originally Posted by Smoking_Script
Посмотреть сообщение
Assim fuciona ? Me ajudem por favor

Код:
for(new p = 0; p < MAX_PROPS; p++)
{
if(pickupid == dini_Int(string, "Id")){
format(string, sizeof(string), "~p~Empresa ID ~y~%s", p);
TextDrawSetString(emptext[i], string);
TextDrawShowForPlayer(i, emptext[i]);
}
}
}
Vc tem que treinar + a linguagem PAWN, E outra editar servers nгo й uma boa idйia:
@OnTopic:
pawn Код:
#if defined MAX_PLAYERS
    #undef MAX_PLAYERS
#define MAX_PLAYERS             ( 50 )
#endif

#define LOCAL_PLAYER        ( "/Players/%s.ini" )

static
    Text:BusinessID[ MAX_PLAYERS ];

forward OnBusinessUpdate( playerid );

public OnPlayerConnect( playerid )
{
    BusinessID[ playerid ]    =    TextDrawCreate( 100, 430, "_" );
    TextDrawFont(               BusinessID[ playerid ], 1 );
    TextDrawColor(              BusinessID[ playerid ], 0xFFFFFFAA );
    TextDrawLetterSize(         BusinessID[ playerid ], 0.499999, 0.899999 );
    TextDrawSetOutline(         BusinessID[ playerid ], 1 );
    TextDrawSetShadow(          BusinessID[ playerid ], 0 );
    TextDrawSetProportional(    BusinessID[ playerid ], 1 );
    TextDrawBackgroundColor(    BusinessID[ playerid ], 0x000000ff );
    return true;
}

public OnBusinessUpdate( playerid )
{
    new string[72];
    TextDrawHideForPlayer( playerid, BusinessID[ playerid ] );  
    format( string, sizeof( string ), "~p~Empresa ID ~y~%i", dini_Get( LOCAL_PLAYER, "id") );  
    TextDrawSetString( BusinessID[ playerid ], string );    
    TextDrawShowForPlayer( i, BusinessID[ playerid ] );
    return true;
}


//Como chamar a funзгo:
SetTimerEx( "OnBusinessUpdate", 1000, true, "i", playerid );
//Ou
OnBusinessUpdate( playerid );
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)