Quick question on mysql and filterscript!
#4

Okay I fixed two of the errors I was getting by creating a stock (saw a similar post to mine):
Код:
#include <a_samp>
#include <a_mysql>

GetMoney(name[])
{
	mysql_connect("127.0.0.1", "root", "freshdatabase", "");
	new Query[256];
	format(Query, 256, "SELECT * FROM accounts WHERE username='%s'", name);
	mysql_query(Query);
	mysql_store_result();

	new nMoneyAmount;
	while(mysql_fetch_row_format(Query,"|"))
	{
		mysql_fetch_field_row(nMoneyAmount, "Money"); // THIS IS LINE 15!
	}
	return nMoneyAmount;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	new string[48], pMoney;
	pMoney = GetMoney(pName(playerid));
	if(!strcmp(cmdtext, "/mysqltest", true))
	{
		format (string, sizeof(string), "%d", pMoney);
		SendClientMessage(playerid, 0xC2A2DAAA, string);
	}
	return 0;
}

public OnFilterScriptInit()
{

}

stock pName(playerid)
{
    new
        iName[MAX_PLAYER_NAME];

    GetPlayerName(playerid, iName, sizeof(iName));
    return iName;
}
Still getting the one error though:
Код:
C:\Users\owner\Documents\server\Server\filterscripts\MYSQLTEST.pwn(15) : error 035: argument type mismatch (argument 1)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply


Messages In This Thread
Quick question on mysql and filterscript! - by Jerm - 13.10.2013, 07:30
Re: Quick question on mysql and filterscript! - by showdown - 13.10.2013, 08:01
Re: Quick question on mysql and filterscript! - by Jerm - 13.10.2013, 11:27
Re: Quick question on mysql and filterscript! - by Jerm - 13.10.2013, 12:04
Re: Quick question on mysql and filterscript! - by Jerm - 13.10.2013, 12:56
Re: Quick question on mysql and filterscript! - by Jerm - 14.10.2013, 02:08
Re: Quick question on mysql and filterscript! - by Jerm - 15.10.2013, 10:38
Re: Quick question on mysql and filterscript! - by [LCK]Chris - 15.10.2013, 10:49
Re: Quick question on mysql and filterscript! - by Jerm - 15.10.2013, 11:01
Re: Quick question on mysql and filterscript! - by [LCK]Chris - 15.10.2013, 11:09

Forum Jump:


Users browsing this thread: 1 Guest(s)