Acho que dessa maneira deve funcionar, se houver algum problema me avisa ou chama skype garotin1408
PHP код:
CMD:givedp(playerid, params[])
{
new player, quantidade, string[128];
if(sscanf(params,"??", player, quantidade)) return SendClientMessage(playerid, -1, "Use: /givedp [player-name] [ammount]");
if(PLAYERONLINE) {
DP[player] += quantidade;
format(string, sizeof(string), "Vocк adicionou %i Donate Points para o jogador %s [ONLINE]", quantidade, NOMEDOPLAYER );
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
else if(PLAYEROFFILINE) {
soma dp e atualiza na DB... como fazer ? XD
new query[200], dpatual;
format(query, sizeof(query), "SELECT * FROM accounts WHERE Username='%s'", player);
mysql_query(String da sua conexao aqui, query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
dpatual = cache_get_field_content_int(0, "DP");
}
mysql_free_result();
format(query, sizeof(query), "UPDATE accounts SET DP=%d WHERE Username='%s'",
dpatual + quantidade,
player);
mysql_query(String da sua conexao aqui, query);
format(string, sizeof(string), "Vocк adicionou %i Donate Points para o jogador %s [OFFLINE]", quantidade, player);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
}
}