Posts: 484
Threads: 49
Joined: Feb 2011
pawn Code:
new weaponid,ammo;
for (new i=0; i<12; i++)
{
GetPlayerWeaponData(playerid, c, weaponid, ammo);
}
How to summ all ammo data?
Posts: 1,418
Threads: 63
Joined: Dec 2010
Reputation:
0
All ammunition of all current weapons?
Posts: 484
Threads: 49
Joined: Feb 2011
I want to summ all ammo data, ammo from slot 1, slot2.....
edit:
Quote:
Originally Posted by [GF]Sasino97
All ammunition of all current weapons?
|
Yes
Posts: 673
Threads: 45
Joined: May 2010
Reputation:
0
create new verriable and sumary it ?
like var+=ammo;
Posts: 673
Threads: 45
Joined: May 2010
Reputation:
0
no! create a new var llike new var;
and after GetWeaponData use var+=ammo;
Posts: 1,564
Threads: 98
Joined: Apr 2011
Reputation:
0
He wanted the ammo, with that code i posted should give him all the ammo of every weapon in the variables. If you want to give the weapons, just use GivePlayerWeapon(); with the variables
Posts: 484
Threads: 49
Joined: Feb 2011
@Wesley221 I want to summ ammo from all weapons in one variable.
Posts: 673
Threads: 45
Joined: May 2010
Reputation:
0
look my post i said you how to sumary
Posts: 1,564
Threads: 98
Joined: Apr 2011
Reputation:
0
What do you mean with 'summ', i dont really get that. And it isnt possible to store EVERY ammo data in ONE variable. Store it like i did, then you can do "GivePlayerWeapon(playerid, weaponid[4], ammo[4]);"
That will give him the weapon that was in his 4th slot, and give him the ammo he had in the 4th slot.
Posts: 484
Threads: 49
Joined: Feb 2011
I want to know how many ammo someone have, form all of his weapons....
M4A1 = 30
Grenade = 10
allammo = 30+10 = 40
Posts: 673
Threads: 45
Joined: May 2010
Reputation:
0
look my post on page 1 i said how
and westley you can!
Posts: 1,564
Threads: 98
Joined: Apr 2011
Reputation:
0
But you still need the ammo[MAX_PLAYERS][12], to store each ammo amounts of each weapons.
Posts: 484
Threads: 49
Joined: Feb 2011
@Tigerkiller && @Wesley221 tnx a lot
+rep
@Wesley221 i dont need to store them, i just need to know how many ammos player have, i'm making AC....