Como fasso isso funcionar ?
#1

Tetei criar um [00:00:00] MENSAGEN pro meu sv fiz tudo certo (ao meu ver) mais quando qualquer mensageme enviada aparece: 91 MENSAGEM ESTA AQUI
Sendo que a mensagem fica cortada no meio, como podem ver almentei as string's e etc mais nao funcionou

PHP код:
SendClientMessageToAllEx(corstring[])
{
    
gettime(HoraMinutoSegundo);
    new 
tmp2[20], tmp3[128];
    
format(tmp220"[%d:%d:%d]"HoraMinutoSegundo);
    
format(tmp320"%d %s"tmp2string);
    
SendClientMessageToAll(cortmp3);
}
SendClientMessageEx(playeridcor, const string[])
{
    
gettime(HoraMinutoSegundo);
    new 
tmp2[20], tmp3[128];
    
format(tmp220"[%d - %d - %d]"HoraMinutoSegundo);
    
format(tmp320"%d %s"tmp2string);
    
SendClientMessage(playeridcortmp3);
    return 
1;

Reply
#2

Tente com este aqui, verifique o cуdigo para entender melhor...

pawn Код:
SendClientMessageEx(playerid, cor, string[])
{
    new Hora, Minuto, Segundo;
    gettime(Hora, Minuto, Segundo);
    new tmp2[34], tmp3[164];
    format(tmp2, sizeof tmp2, "[%d - %d - %d]", Hora, Minuto, Segundo);
    format(tmp3, sizeof tmp3, "%s %s", tmp2, string);
    return SendClientMessage(playerid, cor, tmp3);
}

SendClientMessageToAllEx(cor, string[])
{
    new Hora, Minuto, Segundo;
    gettime(Hora, Minuto, Segundo);
    new tmp2[34], tmp3[164];
    format(tmp2, sizeof tmp2, "[%d:%d:%d]", Hora, Minuto, Segundo);
    format(tmp3, sizeof tmp3, "%s %s", tmp2, string);
    return SendClientMessageToAll(cor, tmp3);
}
Reply
#3

pawn Код:
SendClientMessageToAllEx(cor, string[])
{
    gettime(Hora, Minuto, Segundo);
    new tmp2[20], tmp3[128];
    format(tmp2, 20, "[%d:%d:%d]", Hora, Minuto, Segundo);
    format(tmp3, strlen(string), "%s %s", tmp2, string);
    SendClientMessageToAll(cor, tmp3);
}

SendClientMessageEx(playerid, cor, const string[])
{
    gettime(Hora, Minuto, Segundo);
    new tmp2[20], tmp3[128];
    format(tmp2, 20, "[%d - %d - %d]", Hora, Minuto, Segundo);
    format(tmp3, 20, "%s %s", tmp2, string);
    SendClientMessage(playerid, cor, tmp3);
    return 1;
}
Reply
#4

faltou vc usar %s por se tratar de uma string
Reply
#5

Larceny + reputation codigo funciono perfeito


Quote:
Originally Posted by Vai_Besta
Посмотреть сообщение
faltou vc usar %s por se tratar de uma string
Vai Besta falar bestera !!! %s й para strings %d para numeros, pelo que eu saiba hora e sinais й numeros!!!
Reply
#6

Pode usar tambйm /timestamp, й um comando do SA-MP, como /fpslimit
Reply
#7

Quote:
Originally Posted by Hiuship
Посмотреть сообщение
Larceny + reputation codigo funciono perfeito




Vai Besta falar bestera !!! %s й para strings %d para numeros, pelo que eu saiba hora e sinais й numeros!!!
nгo,
porque vocк formatou a mensagem transformando em string (%s).

Код:
%d ou %i sгo usados em interadores (nъmeros inteiros)
%s  sгo usados em strings(textos)
o Vai_Besta estб certo.
Reply
#8

Quote:
Originally Posted by [O.z]Caroline
Посмотреть сообщение
nгo,
porque vocк formatou a mensagem transformando em string (%s).

Код:
%d ou %i sгo usados em interadores (nъmeros inteiros)
%s  sгo usados em strings(textos)
o Vai_Besta estб certo.
Correto, mas, nгo existem sу estes.
Existem outros como %f, %u, %%, dentre outros.
Reply
#9

Quote:
Originally Posted by DreeH
Посмотреть сообщение
Correto, mas, nгo existem sу estes.
Existem outros como %f, %u, %%, dentre outros.
claro, estes que postei era que estava sendo utilizado no cуdigo do garoto ali *--*
Reply
#10

Quote:
Originally Posted by Hiuship
Посмотреть сообщение
Larceny + reputation codigo funciono perfeito




Vai Besta falar bestera !!! %s й para strings %d para numeros, pelo que eu saiba hora e sinais й numeros!!!
Vocк transformou seus numeros em uma string

tai a lista da wiki
pawn Код:
%b  Inserts a number at this position in binary radix
%c  Inserts a single character.
%d  Inserts an integer (whole) number
%f  Inserts a floating point number.
%i  Inserts an integer.
%s  Inserts a string.
%x  Inserts a number in hexadecimal notation.
%%  Inserts the literal '%'
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)