SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/01/2014, 07:02 PM   #1
nguyenquynh
Banned
 
Join Date: Sep 2012
Posts: 94
Reputation: 0
Default Mysql dosen't work!

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
nguyenquynh is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kick dosen work no reason Hazko Scripting Help 3 16/08/2013 02:48 AM
Commands dosen't work _tHe_WoLf_ Scripting Help 18 15/09/2012 10:07 AM
[dcmd] setlevel dosen't work jonnyboy Help Archive 3 13/05/2011 04:48 PM
Help! PawnCommand seems that dosen't work. shindo Plugin Development 4 27/09/2010 05:45 AM
Dialog, dosen't work? Naxix Help Archive 11 14/04/2010 01:18 PM


All times are GMT. The time now is 05:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.