Portal SAMP
[Ajuda] Problemas com MySQL - 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] Problemas com MySQL (/showthread.php?tid=1163)



Problemas com MySQL - lucasms14 - 05/05/2021

Eu estou fazendo um sistema de admin e estou quebrando a cabeça com a tela de login sobrepondo a dialog de ban do player. Basicamente anula esta dialog abaixo, me da kick e mostra a tela de login. Alguem sabe como posso fazer para resolver isto?


Código:
[color=#569cd6]    new[/color][color=#d4d4d4] query[[/color][color=#b5cea8]128[/color][color=#d4d4d4]];[/color]
[color=#d4d4d4]    [/color][color=#dcdcaa]format[/color][color=#d4d4d4](query, sizeof(query), [/color][color=#ce9178]"SELECT * FROM `banidos` WHERE `nome` = '%s'"[/color][color=#d4d4d4], [/color][color=#dcdcaa]PlayerName[/color][color=#d4d4d4](playerid));[/color]
[color=#d4d4d4]    [/color][color=#dcdcaa]mysql_query[/color][color=#d4d4d4](DBConn, query);[/color]
[color=#d4d4d4]    [/color][color=#c586c0]if[/color][color=#d4d4d4]([/color][color=#dcdcaa]cache_num_rows[/color][color=#d4d4d4]())[/color]
[color=#d4d4d4]    {[/color]
[color=#d4d4d4]        [/color][color=#569cd6]new[/color][color=#d4d4d4] str[[/color][color=#b5cea8]130[/color][color=#d4d4d4]], nomeadm[[/color][color=#b5cea8]20[/color][color=#d4d4d4]], motivo[[/color][color=#b5cea8]15[/color][color=#d4d4d4]];[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]cache_get_value_name[/color][color=#d4d4d4]([/color][color=#b5cea8]0[/color][color=#d4d4d4], [/color][color=#ce9178]"admin"[/color][color=#d4d4d4], nomeadm);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]cache_get_value_name[/color][color=#d4d4d4]([/color][color=#b5cea8]0[/color][color=#d4d4d4], [/color][color=#ce9178]"motivo"[/color][color=#d4d4d4], motivo);[/color]
[color=#d4d4d4]        [/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]ID {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, PlayerData[playerid][accid]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]Conta {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#dcdcaa]PlayerName[/color][color=#d4d4d4](playerid));[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]Admin {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, nomeadm);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]Motivo {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, motivo);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]ShowPlayerDialog[/color][color=#d4d4d4](playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, [/color][color=#ce9178]"Banido:"[/color][color=#d4d4d4], str,[/color][color=#ce9178]"Ok"[/color][color=#d4d4d4], [/color][color=#ce9178]""[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]Kick[/color][color=#d4d4d4](playerid);[/color]
[color=#d4d4d4]        [/color][color=#c586c0]return[/color][color=#d4d4d4] [/color][color=#b5cea8]1[/color][color=#d4d4d4];[/color]
[color=#d4d4d4]    }[/color]



RE: Problemas com MySQL - MateusCandido - 11/05/2021

(05/05/2021 13:37)lucasms14 Escreveu: Eu estou fazendo um sistema de admin e estou quebrando a cabeça com a tela de login sobrepondo a dialog de ban do player. Basicamente anula esta dialog abaixo, me da kick e mostra a tela de login. Alguem sabe como posso fazer para resolver isto?


Código:
[color=#569cd6]    new[/color][color=#d4d4d4] query[[/color][color=#b5cea8]128[/color][color=#d4d4d4]];[/color]
[color=#d4d4d4]    [/color][color=#dcdcaa]format[/color][color=#d4d4d4](query, sizeof(query), [/color][color=#ce9178]"SELECT * FROM `banidos` WHERE `nome` = '%s'"[/color][color=#d4d4d4], [/color][color=#dcdcaa]PlayerName[/color][color=#d4d4d4](playerid));[/color]
[color=#d4d4d4]    [/color][color=#dcdcaa]mysql_query[/color][color=#d4d4d4](DBConn, query);[/color]
[color=#d4d4d4]    [/color][color=#c586c0]if[/color][color=#d4d4d4]([/color][color=#dcdcaa]cache_num_rows[/color][color=#d4d4d4]())[/color]
[color=#d4d4d4]    {[/color]
[color=#d4d4d4]        [/color][color=#569cd6]new[/color][color=#d4d4d4] str[[/color][color=#b5cea8]130[/color][color=#d4d4d4]], nomeadm[[/color][color=#b5cea8]20[/color][color=#d4d4d4]], motivo[[/color][color=#b5cea8]15[/color][color=#d4d4d4]];[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]cache_get_value_name[/color][color=#d4d4d4]([/color][color=#b5cea8]0[/color][color=#d4d4d4], [/color][color=#ce9178]"admin"[/color][color=#d4d4d4], nomeadm);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]cache_get_value_name[/color][color=#d4d4d4]([/color][color=#b5cea8]0[/color][color=#d4d4d4], [/color][color=#ce9178]"motivo"[/color][color=#d4d4d4], motivo);[/color]
[color=#d4d4d4]        [/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]ID {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, PlayerData[playerid][accid]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]Conta {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#dcdcaa]PlayerName[/color][color=#d4d4d4](playerid));[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]Admin {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, nomeadm);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, [/color][color=#ce9178]"[/color][color=#d7ba7d]\n[/color][color=#ce9178]Motivo {FF0000}"[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]strcat[/color][color=#d4d4d4](str, motivo);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]ShowPlayerDialog[/color][color=#d4d4d4](playerid, DIALOG_BANIDO, DIALOG_STYLE_MSGBOX, [/color][color=#ce9178]"Banido:"[/color][color=#d4d4d4], str,[/color][color=#ce9178]"Ok"[/color][color=#d4d4d4], [/color][color=#ce9178]""[/color][color=#d4d4d4]);[/color]
[color=#d4d4d4]        [/color][color=#dcdcaa]Kick[/color][color=#d4d4d4](playerid);[/color]
[color=#d4d4d4]        [/color][color=#c586c0]return[/color][color=#d4d4d4] [/color][color=#b5cea8]1[/color][color=#d4d4d4];[/color]
[color=#d4d4d4]    }[/color]

Provavelmente a ordem que você colocou o código no gamemode, você pode tentar ou invés de usar "return 1" usar "return Kick()" ou você pode colocar pra só mostrar o dialog de login caso não encontre o ban do jogador.

Obs: Este problema não esta relacionado ao MySQL é mais um erro na ordem do código.