Mysql dosen't work!
#1

Code:
stock g_mysql_GiftKey(playerid)
{

	new string[500];

	format(string, sizeof(string), "SELECT `KEY1` from giftcode WHERE `id` = '%d'", GetPlayerSQLId(playerid));
	mysql_function_query(MainPipeline, string, true, "OnQueryFinish", "iii", LOGIN_KEY, playerid, g_arrQueryHandle{playerid});
	return 1;
}
Code:
case LOGIN_KEY:
		{
		    new titlestring[64];
			new string[512];
			for(new i;i < rows;i++)
			{
				new
				    szMAK[129],
					szResult[129],
					szkey[129];
					
				cache_get_field_content(i, "Username", szResult, MainPipeline);
				if(strcmp(szResult, GetPlayerNameExt(extraid), true) != 0)
				{
					//g_mysql_AccountAuthCheck(extraid);
					return 1;
				}

				cache_get_field_content(i, "KEY1", szResult, MainPipeline);
				GetPVarString(extraid, "Passkey", szkey, sizeof(szkey));
				PlayerInfo[extraid][pCash] += 200000;
				PlayerInfo[extraid][pLevel] += 2;
				format(szMAK, sizeof(szMAK), szkey);


				if((isnull(szMAK)) || (isnull(szResult)) || (strcmp(szMAK, szResult) != 0))
				{
				    format(titlestring, sizeof(titlestring), "He Thong Nhap Gift Key - %s", GetPlayerNameEx(extraid));
					format(string, sizeof(string), "{FFFFFF}Nhap ma gift code duoi day de duoc nhan qua - %s", GetPlayerNameEx(extraid));
					ShowPlayerDialog(extraid,DIALOG_NHAPKEY,DIALOG_STYLE_INPUT,titlestring,string,"Thuc hien","Thoat");
					if(++gPlayerLogTries[extraid] == 2)
					{
						SendClientMessage(extraid, COLOR_RED, "[He Thong]: Giftcode nay khong ton tai.");
					}
					return 1;
				}
				DeletePVar(extraid, "Passkey");
				break;
			}
			return 1;
		}
Code:
if(dialogid == DIALOG_LOGINKEY)
	{
	    if(!isnull(inputtext) && strlen(inputtext) < 64)
		{
			SetPVarString(playerid, "Passkey", inputtext);
			g_mysql_GiftKey(playerid);
  		}
	}
This is table giftcode


and


I input key SAVEGAME but it don't give me money and level.... it don't load
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)