[Ajuda] Pegar string da tabela MYSQL
#7

Dessa maneira tambйm funciona, faзa como preferir.

PHP Code:
public OnPlayerConnect(playerid) {
    new 
        
Query[80],
        
name[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnameMAX_PLAYER_NAME);
    
mysql_format(ConnectQuerysizeof(Query), "SELECT * FROM Contas WHERE `Nome`='%e' LIMIT 1"name);
    
mysql_tquery(ConexaoQuery"MySQL_GetPlayerData""i"playerid);
}
forward MySQL_GetPlayerData(playerid);
public 
MySQL_GetPlayerData(playerid) {
    new 
        
email[60];
    
cache_get_value_name(0"Email"email);
    
SendClientMessage(playerid, -1email);
    return 
1;

Quote:
Originally Posted by LucasW
View Post
Opa amigo usando assim apareceu corretamente:
PHP Code:
CMD:meuemail(playeridparams[])
{
    new 
strEmail[60];
    new 
Cache:resultado mysql_query(ConexaoSQL"SELECT Email FROM `contas` WHERE `pID`= 17");
    
cache_get_value_name (0"Email" strEmail) ;
    
cache_delete(resultado); 
    new 
string[128];
    
format(stringsizeof(string),"| E-MAIL | Seu e-mail cadastrado em sua conta й: {ff0000}%s"strEmail);
    
SendClientMessage(playerid, -1string);
    return 
1;

porйm tenho que identificar o pID = 17 nгo por uma variavel ou seja 17 = a conta que eu to logado e no caso dos outros players? tentei add com a variavel Player[playerid][pID] porйm da warning e nгo funciona
Vocк tem que passar isso usando um format, parecido com o que eu fiz na public OnPlayerConnect.
Reply


Messages In This Thread
Pegar string da tabela MYSQL - by LucasW - 09.01.2020, 12:56
Re: Pegar string da tabela MYSQL - by Ever_SH - 09.01.2020, 13:21
Re: Pegar string da tabela MYSQL - by LucasW - 09.01.2020, 13:41
Re: Pegar string da tabela MYSQL - by Ever_SH - 09.01.2020, 13:56
Re: Pegar string da tabela MYSQL - by LucasW - 09.01.2020, 14:06
Re: Pegar string da tabela MYSQL - by LucasW - 09.01.2020, 14:26
Re: Pegar string da tabela MYSQL - by Malandrin - 09.01.2020, 14:32
Re: Pegar string da tabela MYSQL - by LucasW - 09.01.2020, 14:44
Re: Pegar string da tabela MYSQL - by Malandrin - 09.01.2020, 14:46
Re: Pegar string da tabela MYSQL - by LucasW - 09.01.2020, 14:50

Forum Jump:


Users browsing this thread: 1 Guest(s)