02.01.2012, 01:51
pawn Code:
forward GivePlayerWeaponAll(weaponid,ammo);
public GivePlayerWeaponAll(weaponid,ammo)
{
////foreach(Player, i)
for(new i; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GivePlayerAdminGun(i, weaponid);
}
}
}
stock GivePlayerAdminGun(playerid, weaponid)
{
switch (weaponid)
{
case 1:
{
aGun[playerid][0] = 1; GivePlayerWeapon(playerid, 1, 1);
}
case 2..9:
{
aGun[playerid][1] = weaponid; GivePlayerWeapon(playerid, weaponid, 1);
}
case 10..15:
{
aGun[playerid][10] = weaponid; GivePlayerWeapon(playerid, weaponid, 1);
}
case 16..18, 39:
{
aGun[playerid][8] = weaponid; GivePlayerWeapon(playerid, weaponid, 2);
}
case 21:
{
aGun[playerid][12] = 21; SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK);
}
case 22..24:
{
aGun[playerid][2] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
case 25..27:
{
aGun[playerid][3] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
case 28..29, 32:
{
aGun[playerid][4] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
case 30, 31:
{
aGun[playerid][5] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
case 33, 34:
{
aGun[playerid][6] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
case 35..38:
{
aGun[playerid][7] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
case 40:
{
aGun[playerid][12] = 40; GivePlayerWeapon(playerid, 40, 1);
}
case 41..43:
{
aGun[playerid][9] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
case 44..46:
{
aGun[playerid][11] = weaponid; GivePlayerWeapon(playerid, weaponid, 99999);
}
}
return 1;
}