[Ajuda] Comando funcionar online/offline MYSQL
#6

Quote:
Originally Posted by garotin
Посмотреть сообщение
Acho que dessa maneira deve funcionar, se houver algum problema me avisa ou chama skype garotin1408
PHP код:
CMD:givedp(playeridparams[])
    {
        new 
playerquantidadestring[128];
        if(
sscanf(params,"??"playerquantidade)) return SendClientMessage(playerid, -1"Use: /givedp [player-name] [ammount]");
        if(
PLAYERONLINE) {
            
DP[player] += quantidade;
            
format(stringsizeof(string), "Vocк adicionou %i Donate Points para o jogador %s [ONLINE]"quantidadeNOMEDOPLAYER );
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
        }
        else if(
PLAYEROFFILINE) {
            
soma dp e atualiza na DB... como fazer XD
            
new query[200], dpatual;
            
format(querysizeof(query), "SELECT * FROM accounts WHERE Username='%s'"player);
            
mysql_query(String da sua conexao aquiquery);
            
mysql_store_result();
            while(
mysql_fetch_row_format(query,"|"))
            {
                
dpatual cache_get_field_content_int(0"DP");
            }
            
mysql_free_result();
            
format(querysizeof(query), "UPDATE accounts SET DP=%d WHERE Username='%s'",
            
dpatual quantidade,
            
player);
            
mysql_query(String da sua conexao aquiquery);
            
format(stringsizeof(string), "Vocк adicionou %i Donate Points para o jogador %s [OFFLINE]"quantidadeplayer);
            
SendClientMessage(playeridCOLOR_LIGHTBLUEstring);
        }
    } 
Lembrando que usei funзхes do plugin MySQL R33
MySQL store result nгo й necessaria na R33+
Reply


Messages In This Thread
Comando funcionar online/offline MYSQL - by warriorfrog - 28.09.2015, 00:42
Re: Comando funcionar online/offline MYSQL - by Kamper - 28.09.2015, 00:47
Re: Comando funcionar online/offline MYSQL - by n0minal - 28.09.2015, 02:59
Re: Comando funcionar online/offline MYSQL - by garotin - 28.09.2015, 13:28
Re: Comando funcionar online/offline MYSQL - by garotin - 28.09.2015, 13:38
Re: Comando funcionar online/offline MYSQL - by n0minal - 28.09.2015, 13:42
Re: Comando funcionar online/offline MYSQL - by garotin - 28.09.2015, 13:53

Forum Jump:


Users browsing this thread: 4 Guest(s)