SA-MP Forums Archive
Saving failure VX - RP 2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Saving failure VX - RP 2 (/showthread.php?tid=378849)



Saving failure VX - RP 2 - ikbenremco - 19.09.2012

Hello guys, I tried to add hitman to my server with pHit and pHitamount but it's looks like it's crashing my whoel server everytime it's saving.

Код:
                mysql_get_field("Hit", playerVariables[extraid][pHit]);
                mysql_get_field("Hitamount", playerVariables[extraid][pHitamount]);
Код:
  format(saveQuery, sizeof(saveQuery), "%s, hit = '%d', hitamount = '%d'", saveQuery, playerVariables[playerid][pHit], playerVariables[playerid][pHitamount]);
Here's a command to.
Код:
dcmd_hit(playerid, params[])
{
	new amount;
	if(sscanf(params, "dd", ID, amount))
	{
		SendClientMessage(playerid, COLOR_ERROR, "USAGE: /hit [ID] [amount]");
	}
	else if(amount > 0)
	{
		if(IsPlayerConnected(ID))
		{
			if(GetPlayerMoney(playerid) >= amount)
			{
				if(antispam[playerid] == 0)
				{
					hit[ID] = amount;
					hiter[ID] = playerid;
					new string[256];
					format(string, sizeof(string), "You have placed a hit on %s (%i) for $%i", ReturnPlayerName(ID), ID, amount);
					SendClientMessage(playerid, COLOR_MSG, string);
					format(string, sizeof(string), "%s (%i) has placed a hit on %s (%i) for $%i", ReturnPlayerName(playerid), playerid, ReturnPlayerName(ID), ID, amount);
					SendClientMessageToAll(COLOR_MSG, string);
					playerVariables[ID][pHitamount] = amount;
					playerVariables[ID][pHit] = 1;

				}
				else
				{
					SendClientMessage(playerid, COLOR_ERROR, "Please wait before placing another hit!");
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_ERROR, "You do not have enough money!");
			}
		}
		else
		{
			SendClientMessage(playerid, COLOR_ERROR, "That player is not connected!");
		}
	}
	else
	{
		SendClientMessage(playerid, COLOR_ERROR, "Minimum amount to hit a person with is $1!");
	}
	return 1;
}
I get no errors I dont know why it's not working do you need add something in MySQL or something?


Re: Saving faiure VX - RP 2 - jameskmonger - 19.09.2012

In your save query, use capital H

Dont use capital


Re: Saving failure VX - RP 2 - ikbenremco - 19.09.2012

I tried this :
Код:
format(saveQuery, sizeof(saveQuery), "%s, Hit = '%d', Hitamount = '%d'", saveQuery, playerVariables[playerid][pHit], playerVariables[playerid][pHitamount]);
It's still crashing


Re: Saving failure VX - RP 2 - jameskmonger - 19.09.2012

Check mysql_log