15.11.2015, 20:34
Tentei fazer o comando de dar DP online/offline com MYSQL, seguindo alguns tуpicos aqui do fуrum, mas nгo consegui, alguйm me ajuda a fixar?
Erros nos comentarios (//)
Erros nos comentarios (//)
Код:
CMD:givedp(playerid, params[]) { new player[MAX_PLAYER_NAME], quantidade, string[128]; if(sscanf(params,"si", player, quantidade)) return SendClientMessage(playerid, -1, "Use: /givedp [player-name] [ammount]"); new idplayer; idplayer = GetPlayerIdFromName(player); if(idplayer >= 0) { idplayer = GetPlayerIdFromName(player); DP[idplayer] += quantidade; format(string, sizeof(string), "O admin %s adicionou %i DONATE POINTS para %s (ONLINE)", PlayerName(playerid), quantidade, PlayerName(idplayer) ); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); SendClientMessage(idplayer, COLOR_LIGHTBLUE, string); } else { new rows, fields; cache_get_data(rows, fields); if (!rows) return SendClientMessage(playerid, -1, "Nгo hб nenhum player com esse nome."); new query[200], dpatual; format(query, sizeof(query), "SELECT * FROM accounts WHERE Username='%s'", player); mysql_query(ConnectMYSQL,query); mysql_store_result(); // error 017: undefined symbol "mysql_store_result" while(mysql_fetch_row_format(query,"|")) // error 017: undefined symbol "mysql_fetch_row_format" { dpatual = cache_get_field_content_int(0, "DP"); } mysql_free_result(); // error 017: undefined symbol "mysql_store_result" format(query, sizeof(query), "UPDATE accounts SET DP=%d WHERE Username='%s'", dpatual + quantidade, player); mysql_query(ConnectMYSQL,query); format(string, sizeof(string), "O admin %s adicionou %i DONATE POINTS para %s (OFFLINE)", PlayerName(playerid), quantidade, player ); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); SendClientMessage(idplayer, COLOR_LIGHTBLUE, string); } return 1; }