05.06.2009, 21:54
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
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]);