29/01/2025 02:03
(29/01/2025 00:08)Mateus Santos Escreveu: Eu fiz o teste /infoconta FuriaDevs e apareceu [SERVER]: Unknown command.
Eu acho que o problema é no 'strtolower(name)'. Não sei como corrigir.
Código:stock strtolower(string[])
{
for (new i = 0; i < strlen(string); i++)
{
if (string[i] >= 'A' && string[i] <= 'Z')
{
string[i] += ('a' - 'A');
}
}
return string;
}
CMD:infoconta(playerid, params[])
{
LoginCheck(playerid);
LevelCheck(playerid, 1);
new name[24];
if (sscanf(params, "s[24]", name)) {
SendClientMessageLang(playerid, COLOR_RED, "Uso: /infoconta [nome]", 0);
SendClientMessageLang(playerid, COLOR_RED, "Usage: /checkstat [name]", 1);
return 1;
}
strtolower(name);
ShowStatistics(playerid, name);
return 1;
}
https://i.imgur.com/KKSB2v5.png
Creio que essa função está meio overengineered.
Tente com a função:
Código PHP:
strtolower(const src[], dest[]) {
for(new i = 0; i < strlen(src); i++) {
if(src[i] == '\0') break;
dest[i] = tolower(src[i]);
}
return 1;
}
Obs: tolower é uma função nativa. Documentação: https://sampwiki.blast.hk/wiki/Tolower
Não estou disponível para realizar serviços relacionados ao SA-MP e não costumo responder a mensagens privadas, a menos que estejam relacionadas à moderação do fórum.