Quote:
Originally Posted by Arthur Kane
It's pretty straight forward.
“ slots” is the slot ID the weapon is held in. There are 13 slots, 0 to 12. You loop through these slots and get their weapons and ammo for those slots.
Two examples are:
PHP код:
// Common use: get all weapons and store info in an array containing 13 slots
// The first value is the weapon ID, and second is the ammo
new weapons[13][2];
for (new i = 0; i <= 12; i++)
{
GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
}
“ weapons[i][0]” holds their weapon ID and “ weapons[i][1]” holds the ammo.
PHP код:
new
weapon_id, ammo, w_string[128]
;
for(new i; i < 13; i++) // 0-12;
{
GetPlayerWeaponData(playerid, i, weapon_id, ammo);
format(w_string, sizeof w_string, "Weapon ID: %i, Ammo: %i", weapon_id, ammo);
SendClientMessage(playerid, -1, w_string);
}
You understandin?
|
Kinda'. Say, how do you do that with dialogs?