[Ajuda] Fixar comando dar DP on/off MYSQL
#1

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 (//)
Код:
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;
}
Reply


Messages In This Thread
Fixar comando dar DP on/off MYSQL - by warriorfrog - 15.11.2015, 20:34
Re: Fixar comando dar DP on/off MYSQL - by warriorfrog - 16.11.2015, 21:49
Re: Fixar comando dar DP on/off MYSQL - by warriorfrog - 17.11.2015, 18:46
Re: Fixar comando dar DP on/off MYSQL - by warriorfrog - 18.11.2015, 20:18
Re: Fixar comando dar DP on/off MYSQL - by warriorfrog - 19.11.2015, 06:06
Re: Fixar comando dar DP on/off MYSQL - by warriorfrog - 27.11.2015, 10:43
Re: Fixar comando dar DP on/off MYSQL - by Danzou - 27.11.2015, 11:04
Re: Fixar comando dar DP on/off MYSQL - by n0minal - 27.11.2015, 12:24
Re: Fixar comando dar DP on/off MYSQL - by cicinho - 27.11.2015, 13:02
Re: Fixar comando dar DP on/off MYSQL - by warriorfrog - 29.11.2015, 17:19

Forum Jump:


Users browsing this thread: 3 Guest(s)