Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Brian_Furious - 16.08.2010
Ye but what change in SA:MP??
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Ace_Menace - 16.08.2010
Quick Inquiry,
It seems that in your example script
you have the public function OnQueryFinish
It also seems that when I try to compile your example script (all bugs removed)
I cannot fix the following:
pawn Код:
(61) : error 017: undefined symbol "playerid"
(62) : error 017: undefined symbol "playerid"
Error lines marked:
pawn Код:
#include <a_samp>
#include <a_mysql>
#include <zcmd>
#include <sscanf2>
#include <C-MySQL>
new MyMoney[MAX_PLAYERS], MyKills[MAX_PLAYERS];
stock GetUserName(playerid) {
new name[24];
GetPlayerName(playerid, name, 24); return name;
}
CMD:register(playerid, params[]) {
if(CMySQL_Exists(GetUserName(playerid)))
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your account exists already!");
new password[32];
if(sscanf(params, "s[32]", password))
return SendClientMessage(playerid, 0xFFFFFFA, "<> /register <password>");
if(strlen(password) > 32)
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your password must be 32 characters or less.");
CMySQL_Create(GetUserName(playerid), password);
}
CMD:login(playerid, params[]) {
if(!CMySQL_Exists(GetUserName(playerid)))
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your account doesn't exist!");
new password[32];
if(sscanf(params, "s[32]", password))
return SendClientMessage(playerid, 0xFFFFFFA, "<> /login <password>");
if(strlen(password) > 32)
return SendClientMessage(playerid, 0xFFFFFFA, "<> Your password must be 32 characters or less.");
new Passwordz[32];
CMySQL_Get(GetUserName(playerid), "Password", Passwordz, true);
if(!strcmp(Passwordz, password, true)) {
SendClientMessage(playerid, 0xFFFFFFA, "<> You're now logged.");
CMySQL_Load(GetUserName(playerid), 1, playerid);
}
}
stock GetMyAdminLevel(Username[]) {
return CMySQL_Int(Username, "AdminLevel");
}
public OnPlayerDisconnect(playerid, reason) {
new string[128];
format(string, 128, "Money = %i, MyKills = %i", GetPlayerMoney(playerid), GetPlayerScore(playerid));
CMySQL_CustomDataSet(GetUserName(playerid), string);
}
public OnQueryFinish( query[], resultid, extraid, connectionHandle ) {
mysql_store_result();
new Data[128];
mysql_fetch_row_format(Data, "|");
--> sscanf(Data, "p<|>ii", MyMoney[playerid], MyKills[playerid]);
--> GivePlayerMoney(playerid, MyMoney[playerid]);
}
I could fix it, but I don't know how safe that would be,
any info on this?
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Carlton - 16.08.2010
pawn Код:
public OnQueryFinish( query[], resultid, extraid, connectionHandle ) {
mysql_store_result();
new Data[128];
mysql_fetch_row_format(Data, "|");
sscanf(Data, "p<|>ii", MyMoney[extraid], MyKills[extraid]);
GivePlayerMoney(playerid, MyMoney[extraid]);
}
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Ace_Menace - 16.08.2010
Scratch this post, (FAIL).
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
RenisiL - 16.08.2010
Nice work, just crazy
Re: C-MYSQL (Remade) - Increased Speed & More Simple - Double-O-Seven - 16.08.2010
I think CMySQL_Float is bugged. It can't read find the field.
Shouldn't there be
pawn Код:
format(SQLEscapeX[5], 128, "SELECT %s FROM %s WHERE %s = '%s'", SQLEscapeX[3], SQLEscapeX[0], SQLEscapeX[1], SQLEscapeX[2]);
instead of
pawn Код:
format(SQLEscapeX[5], 128, "SELECT %s FROM %s WHERE %s = '%s'", SQLEscapeX[1], SQLEscapeX[0], SQLEscapeX[1], SQLEscapeX[2]);
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Carlton - 16.08.2010
Quote:
Originally Posted by Double-O-Seven
I think CMySQL_Float is bugged. It can't read find the field.
Shouldn't there be
pawn Код:
format(SQLEscapeX[5], 128, "SELECT %s FROM %s WHERE %s = '%s'", SQLEscapeX[3], SQLEscapeX[0], SQLEscapeX[1], SQLEscapeX[2]);
instead of
pawn Код:
format(SQLEscapeX[5], 128, "SELECT %s FROM %s WHERE %s = '%s'", SQLEscapeX[1], SQLEscapeX[0], SQLEscapeX[1], SQLEscapeX[2]);
|
CMySQL_Float uses mysql_fetch_field_row (BlueG's plugin). So it would fetch the float value.
Re: C-MYSQL (Remade) - Increased Speed & More Simple - Double-O-Seven - 16.08.2010
I mean SQLEscapeX[3] as first parameter instead of SQLEscapeX[1]...
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Carlton - 16.08.2010
Quote:
Originally Posted by Double-O-Seven
I mean SQLEscapeX[3] as first parameter instead of SQLEscapeX[1]...
|
I know what you mean, but look at the way I did CMySQL_Float. If I just put a random value into the SELECT <Value>, instead of Selecting all it would be faster. But, you're right it could be SQLEscapeX[3]. But it didn't matter when I used it.
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Y_Less - 16.08.2010
May I suggest you look up the "#tryinclude" directive in pawn-lang.pdf - it will get rid of one level of configuration by auto-detecting which MySQL include a user has.
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Scenario - 16.08.2011
Quote:
Originally Posted by Toni
This isn't the C-SMF thread >_>
|
I swear to God my computer is playing a game with me...!
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
TheBetaFox - 15.01.2012
Sorry for the bump; but where do I specify the server, username and database?
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Darnell - 11.07.2013
Sorry for the bump, but is this still suggested to use?
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Y_Less - 11.07.2013
Quote:
Originally Posted by Darnell
Sorry for the bump, but is this still suggested to use?
|
Was it ever?
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Darnell - 11.07.2013
Quote:
Originally Posted by Y_Less
Was it ever?
|
That's why I am asking.
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
Darnell - 12.07.2013
---------
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
ReVson - 29.12.2017
Hi guys, anyone still have download link? Because i dont see any.
Re: C-MYSQL (Remade) - Increased Speed & More Simple -
JaKe Elite - 29.12.2017
Quote:
Originally Posted by ReVson
Hi guys, anyone still have download link? Because i dont see any.
|
Still attached to a corrupted/non-existing image.
http://solidfiles.com/d/8fbd/download