Portal SAMP
[Ajuda] Sscanf - Versão de Impressão

+- Portal SAMP (https://portalsamp.com)
+-- Fórum: SA-MP (https://portalsamp.com/forumdisplay.php?fid=5)
+--- Fórum: Área de suporte (https://portalsamp.com/forumdisplay.php?fid=6)
+--- Tópico: [Ajuda] Sscanf (/showthread.php?tid=1760)



Sscanf - EXPEDITO_011 - 23/10/2021

Sacanf2 bugado eu uso o comando certo e retorna a mensangem de como usar o comando, Me Ajuda Pfv!


RE: Sscanf - k2bi_YT - 23/10/2021

Codigo?


RE: Sscanf - EXPEDITO_011 - 23/10/2021

(23/10/2021 22:35)k2bi_YT Escreveu: Codigo?

(23/10/2021 22:35)k2bi_YT Escreveu: Codigo?

CMD:an(playerid, params[])
{
new string[256], aNome[MAX_PLAYER_NAME], tAn[256];
if(sscanf(params, "tAn[256]", tAn)) return SendClientMessage(playerid, GROOVE_COR, "[ERRO] Use /an [Texto]");
format(string, sizeof(string), "%s ANUNCIOU: %s", tAn);
SendClientMessageToAll(MENSANGEMA_COR, string);
return 1;
}
return 1;
}


RE: Sscanf - xbruno1000x - 23/10/2021

(23/10/2021 22:39)EXPEDITO_011 Escreveu:
(23/10/2021 22:35)k2bi_YT Escreveu: Codigo?

(23/10/2021 22:35)k2bi_YT Escreveu: Codigo?

CMD:an(playerid, params[])
{
new string[256], aNome[MAX_PLAYER_NAME], tAn[256];
if(sscanf(params, "tAn[256]", tAn)) return SendClientMessage(playerid, GROOVE_COR, "[ERRO] Use /an [Texto]");
format(string, sizeof(string), "%s ANUNCIOU: %s", tAn);
SendClientMessageToAll(MENSANGEMA_COR, string);
return 1;
}
return 1;
}

"tAn[256]"
Isso aí não existe. Usa-se s para string, d para números inteiros e i para números reais.
Deveria ser:
Código:
if(sscanf(params, "s[256]", tAn))