16.12.2015, 13:29
Well, I've been trying to create a list of weapons and it seems that GetPlayerWeaponData limits it.
A better example would be to give player some weapons and run GetPlayerWeaponData. It returns the correct info till now. After, give the player another weapon and run GetPlayerWeaponData again. Guess what? The new weapon you just gave the player isn't returned by the function.
If there is something I did wrong, just let me know in the comments bellow. Thanks.
A better example would be to give player some weapons and run GetPlayerWeaponData. It returns the correct info till now. After, give the player another weapon and run GetPlayerWeaponData again. Guess what? The new weapon you just gave the player isn't returned by the function.
pawn Код:
CMD:test( playerid )
{
GivePlayerWeapon( playerid, 24, 300 );
GivePlayerWeapon( playerid, 25, 300 );
new
weapon_id_test[ 13 ],
weapon_ammo_test[ 13 ]
;
for ( new i = 0; i <= 12; i ++ )
{
GetPlayerWeaponData( playerid, i, weapon_id_test[ i ], weapon_ammo_test[ i ] );
printf("Weapon: %d and ammo: %d", weapon_id_test[ i ], weapon_ammo_test[ i ] );
}
GivePlayerWeapon( playerid, 31, 300 );
new
w_data[13][2];
for(new a = 0; a < 13; a++)
{
GetPlayerWeaponData(playerid, a, w_data[a][0], w_data[a][1]);
printf("Weaponry for slot %i: weapon (%i), amount (%i)", a, w_data[a][0], w_data[a][1]);
}
return 1;
}