02.01.2015, 14:39
I'm trying to load player's weapons, but I'm not sure how to assign the field to a variable so that I could use it in GivePlayerWeapon..
Can anybody please show me an example?
Can anybody please show me an example?
pawn Код:
format(Query, sizeof(Query), "SELECT weapons, ammo FROM weapons WHERE id = %d", PlayerInfo[playerid][DBID]);
mysql_query(Query);
mysql_store_result();
if(mysql_num_rows())
{
for(new i, j = mysql_num_rows(); i < j; i++)
{
mysql_fetch_field_num(i, "weapons");
mysql_fetch_field_num(i, "ammo");
if(!(0 <= PlayerInfo[playerid][Weapons] <= 46)) continue;
GivePlayerWeapon(playerid, PlayerInfo[playerid][Weapons], PlayerInfo[playerid][Ammo]);
}
}