[Ajuda] MYSQL, atualizar
#4

Analisando o teu cуdigo acho que й isto que vocк queira
pawn Код:
forward OnAtualizaGrana(playerid, novaquantia);
public OnAtualizaGrana(playerid, novaquantia){
    new rows, fields;
    cache_get_data(rows, fields);
    pInfo[playerid][Dinheiro] = cache_get_field_content_int(0, "Dinheiro");
    pInfo[playerid][Dinheiro] += novaquantia;
   
    mysql_format(mysql, query, sizeof(query), "UPDATE `players` SET `Dinheiro`= '%d' WHERE `ID`=%d",\
    pInfo[playerid][Dinheiro], pInfo[playerid][ID]);
    mysql_tquery(mysql, query, "", "");
   
    ResetPlayerMoney(playerid);
    GivePlayerMoney(playerid, pInfo[playerid][Dinheiro]);
    return 1;
}
stock atualizarGrana(playerid, quantia){
    new query[128];

    pInfo[playerid][Dinheiro] = 0;
    mysql_format(mysql, query, sizeof(query), "SELECT * FROM `players` WHERE `Nome` = '%e' LIMIT 1", Name[playerid]);
    mysql_tquery(mysql, query, "OnAtualizaGrana", "ii", playerid, quantia);
}
Reply


Messages In This Thread
MYSQL, atualizar - by Lucca-Design - 07.01.2015, 17:50
Re: MYSQL, atualizar - by Skream - 07.01.2015, 17:52
Re: MYSQL, atualizar - by Lucca-Design - 07.01.2015, 18:01
Re: MYSQL, atualizar - by Skream - 07.01.2015, 18:02

Forum Jump:


Users browsing this thread: 1 Guest(s)