[Include] C-MYSQL (Remade) - Increased Speed & More Simple
#22

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?
Reply


Messages In This Thread
C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 10.08.2010, 08:50
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Grim_ - 10.08.2010, 08:54
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by DiddyBop - 10.08.2010, 08:58
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 10.08.2010, 16:19
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Grim_ - 10.08.2010, 16:25
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Kar - 10.08.2010, 16:51
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 10.08.2010, 23:35
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Brian_Furious - 10.08.2010, 23:53
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 11.08.2010, 00:18
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by [LoD]Hauke - 14.08.2010, 23:23
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 15.08.2010, 00:16
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by [LoD]Hauke - 15.08.2010, 00:52
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 15.08.2010, 01:49
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by [LoD]Hauke - 15.08.2010, 19:32
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 15.08.2010, 20:46
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by [LoD]Hauke - 15.08.2010, 22:30
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 15.08.2010, 22:52
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by [LoD]Hauke - 15.08.2010, 22:55
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Brian_Furious - 15.08.2010, 23:13
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 16.08.2010, 00:02
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Brian_Furious - 16.08.2010, 00:07
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Ace_Menace - 16.08.2010, 03:40
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 16.08.2010, 04:07
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Ace_Menace - 16.08.2010, 07:03
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by RenisiL - 16.08.2010, 07:06
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Double-O-Seven - 16.08.2010, 16:43
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 16.08.2010, 17:09
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Double-O-Seven - 16.08.2010, 17:12
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Carlton - 16.08.2010, 17:25
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Y_Less - 16.08.2010, 17:46
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Scenario - 16.08.2011, 02:34
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by TheBetaFox - 15.01.2012, 09:28
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Darnell - 11.07.2013, 10:03
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Y_Less - 11.07.2013, 10:11
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Darnell - 11.07.2013, 10:23
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by Darnell - 12.07.2013, 09:13
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by ReVson - 29.12.2017, 21:15
Re: C-MYSQL (Remade) - Increased Speed & More Simple - by JaKe Elite - 29.12.2017, 21:18

Forum Jump:


Users browsing this thread: 2 Guest(s)