SQL help. -
iGetty - 24.06.2012
Hello there,
I am having problems with a bit of SQL.
Here is the problem:
I keep getting "Syntax Error's" and I don't know where from? I've checked the code for around 30 minutes, also the PHPMyAdmin table, for any error's in that.
Here is the code:
pawn Код:
format(query, sizeof(query), "UPDATE Accounts SET BanHour=%d, BanMinute=%d, Weapon1=%d, Weapon1A=%d, Weapon2=%d, Weapon2A=%d, Weapon3=%d, Weapon3A=%d, Weapon4=%d, Weapon4A=%d, Weapon5=%d, Weapon5A=%d, Weapon6=%d, Weapon6A=%d, Weapon7=%d, Weapon7A=%d WHERE Username='%s'",
Player[playerid][BanHour],
Player[playerid][BanMinute],
GetPlayerWeaponData(playerid, 1, Player[playerid][Weapon1], Player[playerid][Weapon1a]),
GetPlayerWeaponData(playerid, 2, Player[playerid][Weapon2], Player[playerid][Weapon2a]),
GetPlayerWeaponData(playerid, 3, Player[playerid][Weapon3], Player[playerid][Weapon3a]),
GetPlayerWeaponData(playerid, 4, Player[playerid][Weapon4], Player[playerid][Weapon4a]),
GetPlayerWeaponData(playerid, 5, Player[playerid][Weapon5], Player[playerid][Weapon5a]),
GetPlayerWeaponData(playerid, 6, Player[playerid][Weapon6], Player[playerid][Weapon6a]),
GetPlayerWeaponData(playerid, 7, Player[playerid][Weapon7], Player[playerid][Weapon7a]),
pname);
mysql_query(query);
format(query, sizeof(query), "UPDATE Accounts SET Weapon8=%d, Weapon8A=%d, Weapon9=%d, Weapon9A=%d, Weapon10=%d, Weapon10A=%d, Weapon11=%d, Weapon11A=%d, Weapon12=%d, Weapon12A=%d WHERE Username = '%s'",
GetPlayerWeaponData(playerid, 8, Player[playerid][Weapon8], Player[playerid][Weapon8a]),
GetPlayerWeaponData(playerid, 9, Player[playerid][Weapon9], Player[playerid][Weapon9a]),
GetPlayerWeaponData(playerid, 10, Player[playerid][Weapon10], Player[playerid][Weapon10a]),
GetPlayerWeaponData(playerid, 11, Player[playerid][Weapon11], Player[playerid][Weapon11a]),
GetPlayerWeaponData(playerid, 12, Player[playerid][Weapon12], Player[playerid][Weapon12a]),
pname);
mysql_query(query);
If anyone at all can help me, I would be MOST grateful!
Thanks!
Re: SQL help. -
SuperViper - 24.06.2012
1) Make sure the length of 'query' is large enough to handle your queries.
2) You need to store the values from GetPlayerWeaponData before using them.
Re: SQL help. -
iGetty - 24.06.2012
How do I do the second one?
Re: SQL help. -
phillip875 - 24.06.2012
pawn Код:
enum weapons {
weapon1,
weapon1ammo,
weapon2,
weapon2ammo,
weapon3,
weapon3ammo,
weapon4,
weapon4ammo,
weapon5,
weapon5ammo,
weapon6,
weapon6ammo,
weapon7,
weapon7ammo,
weapon8,
weapon8ammo,
weapon9,
weapon9ammo,
weapon10,
weapon10ammo,
weapon11,
weapon11ammo,
weapon12,
weapon12ammo,
weapon13,
weapon13ammo
}
new WeapData[MAX_PLAYERS][weapons];
stock GrabWeapons(playerid)
{
GetPlayerWeaponData(playerid,0,WeapData[playerid][weapon1],WeapData[playerid][weapon1ammo]);
GetPlayerWeaponData(playerid,1,WeapData[playerid][weapon2],WeapData[playerid][weapon2ammo]);
GetPlayerWeaponData(playerid,2,WeapData[playerid][weapon3],WeapData[playerid][weapon3ammo]);
GetPlayerWeaponData(playerid,3,WeapData[playerid][weapon4],WeapData[playerid][weapon4ammo]);
GetPlayerWeaponData(playerid,4,WeapData[playerid][weapon5],WeapData[playerid][weapon5ammo]);
GetPlayerWeaponData(playerid,5,WeapData[playerid][weapon6],WeapData[playerid][weapon6ammo]);
GetPlayerWeaponData(playerid,6,WeapData[playerid][weapon7],WeapData[playerid][weapon7ammo]);
GetPlayerWeaponData(playerid,7,WeapData[playerid][weapon8],WeapData[playerid][weapon8ammo]);
GetPlayerWeaponData(playerid,8,WeapData[playerid][weapon9],WeapData[playerid][weapon9ammo]);
GetPlayerWeaponData(playerid,9,WeapData[playerid][weapon10],WeapData[playerid][weapon10ammo]);
GetPlayerWeaponData(playerid,10,WeapData[playerid][weapon11],WeapData[playerid][weapon11ammo]);
GetPlayerWeaponData(playerid,11,WeapData[playerid][weapon12],WeapData[playerid][weapon12ammo]);
GetPlayerWeaponData(playerid,12,WeapData[playerid][weapon13],WeapData[playerid][weapon13ammo]);
}
Edit: Be sure to use GrabWeapons(playerid); in your callback so it will grab the data or else it won't do it.
Re: SQL help. -
phillip875 - 24.06.2012
This should save weapons on disconnect and load them when they connect again:
pawn Код:
#define FILTERSCRIPT
#include <a_samp>
#include <a_mysql>
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
#define host ""
#define db ""
#define user ""
#define pwd ""
forward UpdateWeapons(playerid);
enum weapons {
weapon1,
weapon1ammo,
weapon2,
weapon2ammo,
weapon3,
weapon3ammo,
weapon4,
weapon4ammo,
weapon5,
weapon5ammo,
weapon6,
weapon6ammo,
weapon7,
weapon7ammo,
weapon8,
weapon8ammo,
weapon9,
weapon9ammo,
weapon10,
weapon10ammo,
weapon11,
weapon11ammo,
weapon12,
weapon12ammo,
weapon13,
weapon13ammo
}
new WeapData[MAX_PLAYERS][weapons];
stock LoadStoredWeapons(playerid)
{
new ReceiveWeapModel[13],ReceiveWeapAmmo[13],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
format(ReceiveWeapModel[0],256,"SELECT Weapon1 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[1],256,"SELECT Weapon2 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[2],256,"SELECT Weapon3 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[3],256,"SELECT Weapon4 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[4],256,"SELECT Weapon5 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[5],256,"SELECT Weapon6 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[6],256,"SELECT Weapon7 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[7],256,"SELECT Weapon8 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[8],256,"SELECT Weapon9 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[9],256,"SELECT Weapon10 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[10],256,"SELECT Weapon11 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[11],256,"SELECT Weapon12 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapModel[12],256,"SELECT Weapon13 FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[0],256,"SELECT Weapon1A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[1],256,"SELECT Weapon2A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[2],256,"SELECT Weapon3A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[3],256,"SELECT Weapon4A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[4],256,"SELECT Weapon5A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[5],256,"SELECT Weapon6A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[6],256,"SELECT Weapon7A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[7],256,"SELECT Weapon8A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[8],256,"SELECT Weapon9A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[9],256,"SELECT Weapon10A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[10],256,"SELECT Weapon11A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[11],256,"SELECT Weapon12A FROM Accounts WHERE Username = '%s';",pName);
format(ReceiveWeapAmmo[12],256,"SELECT Weapon13A FROM Accounts WHERE Username = '%s';",pName);
mysql_connect(host,user,db,pwd);
WeapData[playerid][weapon1] = mysql_query(ReceiveWeapModel[0]);
WeapData[playerid][weapon2] = mysql_query(ReceiveWeapModel[1]);
WeapData[playerid][weapon3] = mysql_query(ReceiveWeapModel[2]);
WeapData[playerid][weapon4] = mysql_query(ReceiveWeapModel[3]);
WeapData[playerid][weapon5] = mysql_query(ReceiveWeapModel[4]);
WeapData[playerid][weapon6] = mysql_query(ReceiveWeapModel[5]);
WeapData[playerid][weapon7] = mysql_query(ReceiveWeapModel[6]);
WeapData[playerid][weapon8] = mysql_query(ReceiveWeapModel[7]);
WeapData[playerid][weapon9] = mysql_query(ReceiveWeapModel[8]);
WeapData[playerid][weapon10] = mysql_query(ReceiveWeapModel[9]);
WeapData[playerid][weapon11] = mysql_query(ReceiveWeapModel[10]);
WeapData[playerid][weapon12] = mysql_query(ReceiveWeapModel[11]);
WeapData[playerid][weapon13] = mysql_query(ReceiveWeapModel[12]);
WeapData[playerid][weapon1ammo] = mysql_query(ReceiveWeapAmmo[0]);
WeapData[playerid][weapon2ammo] = mysql_query(ReceiveWeapAmmo[1]);
WeapData[playerid][weapon3ammo] = mysql_query(ReceiveWeapAmmo[2]);
WeapData[playerid][weapon4ammo] = mysql_query(ReceiveWeapAmmo[3]);
WeapData[playerid][weapon5ammo] = mysql_query(ReceiveWeapAmmo[4]);
WeapData[playerid][weapon6ammo] = mysql_query(ReceiveWeapAmmo[5]);
WeapData[playerid][weapon7ammo] = mysql_query(ReceiveWeapAmmo[6]);
WeapData[playerid][weapon8ammo] = mysql_query(ReceiveWeapAmmo[7]);
WeapData[playerid][weapon9ammo] = mysql_query(ReceiveWeapAmmo[8]);
WeapData[playerid][weapon10ammo] = mysql_query(ReceiveWeapAmmo[9]);
WeapData[playerid][weapon11ammo] = mysql_query(ReceiveWeapAmmo[10]);
WeapData[playerid][weapon12ammo] = mysql_query(ReceiveWeapAmmo[11]);
WeapData[playerid][weapon13ammo] = mysql_query(ReceiveWeapAmmo[12]);
mysql_close();
}
stock LoadStoredWeaponInfo(playerid)
{
LoadStoredWeapons(playerid);
GivePlayerWeapon(playerid,WeapData[playerid][weapon1],WeapData[playerid][weapon1ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon2],WeapData[playerid][weapon2ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon3],WeapData[playerid][weapon3ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon4],WeapData[playerid][weapon4ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon5],WeapData[playerid][weapon5ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon6],WeapData[playerid][weapon6ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon7],WeapData[playerid][weapon7ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon8],WeapData[playerid][weapon8ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon9],WeapData[playerid][weapon9ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon10],WeapData[playerid][weapon10ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon11],WeapData[playerid][weapon11ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon12],WeapData[playerid][weapon12ammo]);
GivePlayerWeapon(playerid,WeapData[playerid][weapon13],WeapData[playerid][weapon13ammo]);
}
public OnPlayerConnect(playerid)
{
LoadStoredWeaponInfo(playerid);
}
stock GrabWeapons(playerid)
{
GetPlayerWeaponData(playerid,0,WeapData[playerid][weapon1],WeapData[playerid][weapon1ammo]);
GetPlayerWeaponData(playerid,1,WeapData[playerid][weapon2],WeapData[playerid][weapon2ammo]);
GetPlayerWeaponData(playerid,2,WeapData[playerid][weapon3],WeapData[playerid][weapon3ammo]);
GetPlayerWeaponData(playerid,3,WeapData[playerid][weapon4],WeapData[playerid][weapon4ammo]);
GetPlayerWeaponData(playerid,4,WeapData[playerid][weapon5],WeapData[playerid][weapon5ammo]);
GetPlayerWeaponData(playerid,5,WeapData[playerid][weapon6],WeapData[playerid][weapon6ammo]);
GetPlayerWeaponData(playerid,6,WeapData[playerid][weapon7],WeapData[playerid][weapon7ammo]);
GetPlayerWeaponData(playerid,7,WeapData[playerid][weapon8],WeapData[playerid][weapon8ammo]);
GetPlayerWeaponData(playerid,8,WeapData[playerid][weapon9],WeapData[playerid][weapon9ammo]);
GetPlayerWeaponData(playerid,9,WeapData[playerid][weapon10],WeapData[playerid][weapon10ammo]);
GetPlayerWeaponData(playerid,10,WeapData[playerid][weapon11],WeapData[playerid][weapon11ammo]);
GetPlayerWeaponData(playerid,11,WeapData[playerid][weapon12],WeapData[playerid][weapon12ammo]);
GetPlayerWeaponData(playerid,12,WeapData[playerid][weapon13],WeapData[playerid][weapon13ammo]);
}
public UpdateWeapons(playerid)
{
new saveweap[13],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,sizeof(pName));
GrabWeapons(playerid);
format(saveweap[0],256,"UPDATE Accounts SET Weapon1 = %d, Weapon1A = %i WHERE Username = '%s';",WeapData[playerid][weapon1],WeapData[playerid][weapon1ammo],pName);
format(saveweap[1],256,"UPDATE Accounts SET Weapon2 = %d, Weapon2A = %i WHERE Username = '%s';",WeapData[playerid][weapon2],WeapData[playerid][weapon2ammo],pName);
format(saveweap[2],256,"UPDATE Accounts SET Weapon3 = %d, Weapon3A = %i WHERE Username = '%s';",WeapData[playerid][weapon3],WeapData[playerid][weapon3ammo],pName);
format(saveweap[3],256,"UPDATE Accounts SET Weapon4 = %d, Weapon4A = %i WHERE Username = '%s';",WeapData[playerid][weapon4],WeapData[playerid][weapon4ammo],pName);
format(saveweap[4],256,"UPDATE Accounts SET Weapon5 = %d, Weapon5A = %i WHERE Username = '%s';",WeapData[playerid][weapon5],WeapData[playerid][weapon5ammo],pName);
format(saveweap[5],256,"UPDATE Accounts SET Weapon6 = %d, Weapon6A = %i WHERE Username = '%s';",WeapData[playerid][weapon6],WeapData[playerid][weapon6ammo],pName);
format(saveweap[6],256,"UPDATE Accounts SET Weapon7 = %d, Weapon7A = %i WHERE Username = '%s';",WeapData[playerid][weapon7],WeapData[playerid][weapon7ammo],pName);
format(saveweap[7],256,"UPDATE Accounts SET Weapon8 = %d, Weapon8A = %i WHERE Username = '%s';",WeapData[playerid][weapon8],WeapData[playerid][weapon8ammo],pName);
format(saveweap[8],256,"UPDATE Accounts SET Weapon9 = %d, Weapon9A = %i WHERE Username = '%s';",WeapData[playerid][weapon9],WeapData[playerid][weapon9ammo],pName);
format(saveweap[9],256,"UPDATE Accounts SET Weapon10 = %d, Weapon10A = %i WHERE Username = '%s';",WeapData[playerid][weapon10],WeapData[playerid][weapon10ammo],pName);
format(saveweap[10],256,"UPDATE Accounts SET Weapon11 = %d, Weapon11A = %i WHERE Username = '%s';",WeapData[playerid][weapon11],WeapData[playerid][weapon11ammo],pName);
format(saveweap[11],256,"UPDATE Accounts SET Weapon12 = %d, Weapon12A = %i WHERE Username = '%s';",WeapData[playerid][weapon12],WeapData[playerid][weapon12ammo],pName);
format(saveweap[12],256,"UPDATE Accounts SET Weapon13 = %d, Weapon13A = %i WHERE Username = '%s';",WeapData[playerid][weapon13],WeapData[playerid][weapon13ammo],pName);
mysql_connect(host,user,db,pwd);
mysql_query(saveweap[0]);
mysql_query(saveweap[1]);
mysql_query(saveweap[2]);
mysql_query(saveweap[3]);
mysql_query(saveweap[4]);
mysql_query(saveweap[5]);
mysql_query(saveweap[6]);
mysql_query(saveweap[7]);
mysql_query(saveweap[8]);
mysql_query(saveweap[9]);
mysql_query(saveweap[10]);
mysql_query(saveweap[11]);
mysql_query(saveweap[12]);
mysql_close();
}
public OnPlayerDisconnect(playerid)
{
UpdateWeapons(playerid);
}
Hope you find this useful.
Re: SQL help. -
iGetty - 29.06.2012
That didn't work.
I get this:
Код:
[18:02:03] [debug] Run time error 4: "Array index out of bounds"
[18:02:03] [debug] Accessing element at index 83 past array upper bound 49
[18:02:03] [debug] AMX backtrace:
[18:02:03] [debug] #0 000c80a4 in ?? () from new.amx
[18:02:03] [debug] #1 00000073 in public SaveWeps () from new.amx
With this:
pawn Код:
public SaveWeps(playerid)
{
UpdateWeapons(playerid);
}
//UpdateWeapons code:
public UpdateWeapons(playerid)
{
new saveweap[13];
GrabWeapons(playerid);
format(saveweap[0],256,"UPDATE Accounts SET Weapon1 = %d, Weapon1A = %i WHERE Username = '%s';",WeapData[playerid][weapon1],WeapData[playerid][weapon1ammo],pName(playerid));
format(saveweap[1],256,"UPDATE Accounts SET Weapon2 = %d, Weapon2A = %i WHERE Username = '%s';",WeapData[playerid][weapon2],WeapData[playerid][weapon2ammo],pName(playerid));
format(saveweap[2],256,"UPDATE Accounts SET Weapon3 = %d, Weapon3A = %i WHERE Username = '%s';",WeapData[playerid][weapon3],WeapData[playerid][weapon3ammo],pName(playerid));
format(saveweap[3],256,"UPDATE Accounts SET Weapon4 = %d, Weapon4A = %i WHERE Username = '%s';",WeapData[playerid][weapon4],WeapData[playerid][weapon4ammo],pName(playerid));
format(saveweap[4],256,"UPDATE Accounts SET Weapon5 = %d, Weapon5A = %i WHERE Username = '%s';",WeapData[playerid][weapon5],WeapData[playerid][weapon5ammo],pName(playerid));
format(saveweap[5],256,"UPDATE Accounts SET Weapon6 = %d, Weapon6A = %i WHERE Username = '%s';",WeapData[playerid][weapon6],WeapData[playerid][weapon6ammo],pName(playerid));
format(saveweap[6],256,"UPDATE Accounts SET Weapon7 = %d, Weapon7A = %i WHERE Username = '%s';",WeapData[playerid][weapon7],WeapData[playerid][weapon7ammo],pName(playerid));
format(saveweap[7],256,"UPDATE Accounts SET Weapon8 = %d, Weapon8A = %i WHERE Username = '%s';",WeapData[playerid][weapon8],WeapData[playerid][weapon8ammo],pName(playerid));
format(saveweap[8],256,"UPDATE Accounts SET Weapon9 = %d, Weapon9A = %i WHERE Username = '%s';",WeapData[playerid][weapon9],WeapData[playerid][weapon9ammo],pName(playerid));
format(saveweap[9],256,"UPDATE Accounts SET Weapon10 = %d, Weapon10A = %i WHERE Username = '%s';",WeapData[playerid][weapon10],WeapData[playerid][weapon10ammo],pName(playerid));
format(saveweap[10],256,"UPDATE Accounts SET Weapon11 = %d, Weapon11A = %i WHERE Username = '%s';",WeapData[playerid][weapon11],WeapData[playerid][weapon11ammo],pName(playerid));
format(saveweap[11],256,"UPDATE Accounts SET Weapon12 = %d, Weapon12A = %i WHERE Username = '%s';",WeapData[playerid][weapon12],WeapData[playerid][weapon12ammo],pName(playerid));
mysql_query(saveweap[0]);
mysql_query(saveweap[1]);
mysql_query(saveweap[2]);
mysql_query(saveweap[3]);
mysql_query(saveweap[4]);
mysql_query(saveweap[5]);
mysql_query(saveweap[6]);
mysql_query(saveweap[7]);
mysql_query(saveweap[8]);
mysql_query(saveweap[9]);
mysql_query(saveweap[10]);
mysql_query(saveweap[11]);
}
// Grab Weapons code
stock GrabWeapons(playerid)
{
GetPlayerWeaponData(playerid,0,WeapData[playerid][weapon1],WeapData[playerid][weapon1ammo]);
GetPlayerWeaponData(playerid,1,WeapData[playerid][weapon2],WeapData[playerid][weapon2ammo]);
GetPlayerWeaponData(playerid,2,WeapData[playerid][weapon3],WeapData[playerid][weapon3ammo]);
GetPlayerWeaponData(playerid,3,WeapData[playerid][weapon4],WeapData[playerid][weapon4ammo]);
GetPlayerWeaponData(playerid,4,WeapData[playerid][weapon5],WeapData[playerid][weapon5ammo]);
GetPlayerWeaponData(playerid,5,WeapData[playerid][weapon6],WeapData[playerid][weapon6ammo]);
GetPlayerWeaponData(playerid,6,WeapData[playerid][weapon7],WeapData[playerid][weapon7ammo]);
GetPlayerWeaponData(playerid,7,WeapData[playerid][weapon8],WeapData[playerid][weapon8ammo]);
GetPlayerWeaponData(playerid,8,WeapData[playerid][weapon9],WeapData[playerid][weapon9ammo]);
GetPlayerWeaponData(playerid,9,WeapData[playerid][weapon10],WeapData[playerid][weapon10ammo]);
GetPlayerWeaponData(playerid,10,WeapData[playerid][weapon11],WeapData[playerid][weapon11ammo]);
GetPlayerWeaponData(playerid,11,WeapData[playerid][weapon12],WeapData[playerid][weapon12ammo]);
}
Thanks.