Save ammo and then set it
#8

pawn Код:
new bullets[MAX_PLAYERS][12];
new weapons[MAX_PLAYERS][12];
GetPlayerWeaponData(playerid,1,weapons[playerid][0],bullets[playerid][0]);
GetPlayerWeaponData(playerid,2,weapons[playerid][1],bullets[playerid][1]);
GetPlayerWeaponData(playerid,3,weapons[playerid][2],bullets[playerid][2]);
GetPlayerWeaponData(playerid,4,weapons[playerid][3],bullets[playerid][3]);
GetPlayerWeaponData(playerid,5,weapons[playerid][4],bullets[playerid][4]);
GetPlayerWeaponData(playerid,6,weapons[playerid][5],bullets[playerid][5]);
GetPlayerWeaponData(playerid,7,weapons[playerid][6],bullets[playerid][6]);
GetPlayerWeaponData(playerid,8,weapons[playerid][7],bullets[playerid][7]);
GetPlayerWeaponData(playerid,9,weapons[playerid][8],bullets[playerid][8]);
GetPlayerWeaponData(playerid,10,weapons[playerid][9],bullets[playerid][9]);
GetPlayerWeaponData(playerid,11,weapons[playerid][10],bullets[playerid][10]);
GetPlayerWeaponData(playerid,12,weapons[playerid][11],bullets[playerid][11]);

//Gets the player's weapons for each slot and the ammo of it.
//You would need to also define the playerid for the weapons+bullets if you wanted to give the player these weapons at a later time
then to give the saved weapons:
pawn Код:
if(weapons[playerid][0]!=0)GivePlayerWeapon(playerid,weapons[playerid][0],bullets[playerid][0]);
if(weapons[playerid][1]!=0)GivePlayerWeapon(playerid,weapons[playerid][1],bullets[playerid][1]);
if(weapons[playerid][2]!=0)GivePlayerWeapon(playerid,weapons[playerid][2],bullets[playerid][2]);
if(weapons[playerid][3]!=0)GivePlayerWeapon(playerid,weapons[playerid][3],bullets[playerid][3]);
if(weapons[playerid][4]!=0)GivePlayerWeapon(playerid,weapons[playerid][4],bullets[playerid][4]);
if(weapons[playerid][5]!=0)GivePlayerWeapon(playerid,weapons[playerid][5],bullets[playerid][5]);
if(weapons[playerid][6]!=0)GivePlayerWeapon(playerid,weapons[playerid][6],bullets[playerid][6]);
if(weapons[playerid][7]!=0)GivePlayerWeapon(playerid,weapons[playerid][7],bullets[playerid][7]);
if(weapons[playerid][8]!=0)GivePlayerWeapon(playerid,weapons[playerid][8],bullets[playerid][8]);
if(weapons[playerid][9]!=0)GivePlayerWeapon(playerid,weapons[playerid][9],bullets[playerid][9]);
if(weapons[playerid][10]!=0)GivePlayerWeapon(playerid,weapons[playerid][10],bullets[playerid][10]);
if(weapons[playerid][11]!=0)GivePlayerWeapon(playerid,weapons[playerid][11],bullets[playerid][11]);
Reply


Messages In This Thread
Save ammo and then set it - by SpiderPork - 10.05.2009, 17:45
Re: Save ammo and then set it - by BlackFoX - 10.05.2009, 19:39
Re: Save ammo and then set it - by SpiderPork - 11.05.2009, 16:00
Re: Save ammo and then set it - by matrix_smq - 11.05.2009, 16:12
Re: Save ammo and then set it - by SpiderPork - 11.05.2009, 16:40
Re: Save ammo and then set it - by Derksen123 - 05.06.2009, 21:35
Re: Save ammo and then set it - by lol2112 - 05.06.2009, 21:38
Re: Save ammo and then set it - by Badger(new) - 05.06.2009, 21:54
Re: Save ammo and then set it - by Gappy - 14.06.2009, 10:06
Re: Save ammo and then set it - by SpiderPork - 14.06.2009, 10:10

Forum Jump:


Users browsing this thread: 4 Guest(s)