Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock ValidWeapon(playerid, type, weapon, ammo)
- {
- if(type == 0)
- {
- if(weapon == 0 || weapon == 1)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 0, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][0] != weapon)
- {
- Informacion[playerid][pAmmo][0] = 0;
- Informacion[playerid][pArma][0] = weapon;
- Informacion[playerid][pAmmo][0] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][0]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][0] = weapon;
- Informacion[playerid][pAmmo][0] += ammo;
- }
- }
- if(weapon == 2 || weapon == 3 || weapon == 4 || weapon == 5 || weapon == 6 || weapon == 7 || weapon == 8 || weapon == 9)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 1, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][1] != weapon)
- {
- Informacion[playerid][pAmmo][1] = 0;
- Informacion[playerid][pArma][1] = weapon;
- Informacion[playerid][pAmmo][1] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][1]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][1] = weapon;
- Informacion[playerid][pAmmo][1] += ammo;
- }
- }
- if(weapon == 22 || weapon == 23 || weapon == 24)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 2, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][2] != weapon)
- {
- Informacion[playerid][pAmmo][2] = 0;
- Informacion[playerid][pArma][2] = weapon;
- Informacion[playerid][pAmmo][2] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][2]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][2] = weapon;
- Informacion[playerid][pAmmo][2] += ammo;
- }
- }
- if(weapon == 25 || weapon == 26 || weapon == 27)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 3, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][3] != weapon)
- {
- Informacion[playerid][pAmmo][3] = 0;
- Informacion[playerid][pArma][3] = weapon;
- Informacion[playerid][pAmmo][3] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][3]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][3] = weapon;
- Informacion[playerid][pAmmo][3] += ammo;
- }
- }
- if(weapon == 27 || weapon == 28 || weapon == 32)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 4, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][4] != weapon)
- {
- Informacion[playerid][pAmmo][4] = 0;
- Informacion[playerid][pArma][4] = weapon;
- Informacion[playerid][pAmmo][4] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][4]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][4] = weapon;
- Informacion[playerid][pAmmo][4] += ammo;
- }
- }
- if(weapon == 30 || weapon == 31)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 5, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][5] != weapon)
- {
- Informacion[playerid][pAmmo][5] = 0;
- Informacion[playerid][pArma][5] = weapon;
- Informacion[playerid][pAmmo][5] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][5]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][5] = weapon;
- Informacion[playerid][pAmmo][5] += ammo;
- }
- }
- if(weapon == 33 || weapon == 34)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 6, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][6] != weapon)
- {
- Informacion[playerid][pAmmo][6] = 0;
- Informacion[playerid][pArma][6] = weapon;
- Informacion[playerid][pAmmo][6] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][6]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][6] = weapon;
- Informacion[playerid][pAmmo][6] += ammo;
- }
- }
- if(weapon == 35 || weapon == 36 || weapon == 37|| weapon == 38)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 7, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][7] != weapon)
- {
- Informacion[playerid][pAmmo][7] = 0;
- Informacion[playerid][pArma][7] = weapon;
- Informacion[playerid][pAmmo][7] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][7]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][7] = weapon;
- Informacion[playerid][pAmmo][7] += ammo;
- }
- }
- if(weapon == 16 || weapon == 17 || weapon == 18 || weapon == 39)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 8, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][8] != weapon)
- {
- Informacion[playerid][pAmmo][8] = 0;
- Informacion[playerid][pArma][8] = weapon;
- Informacion[playerid][pAmmo][8] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][8]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][8] = weapon;
- Informacion[playerid][pAmmo][8] += ammo;
- }
- }
- if(weapon == 41 || weapon == 42 || weapon == 43)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 9, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][9] != weapon)
- {
- Informacion[playerid][pAmmo][9] = 0;
- Informacion[playerid][pArma][9] = weapon;
- Informacion[playerid][pAmmo][9] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][9]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][9] = weapon;
- Informacion[playerid][pAmmo][9] += ammo;
- }
- }
- if(weapon == 10 || weapon == 11 || weapon == 12 || weapon == 13 || weapon == 14 || weapon == 15)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 10, weapons, ammos);
- if(ammo+ammos >= 9999 && weapon == weapons) return 2;
- if(Informacion[playerid][pArma][10] != weapon)
- {
- Informacion[playerid][pAmmo][10] = 0;
- Informacion[playerid][pArma][10] = weapon;
- Informacion[playerid][pAmmo][10] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][10]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][10] = weapon;
- Informacion[playerid][pAmmo][10] += ammo;
- }
- }
- if(weapon == 45 || weapon == 46)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 11, weapons, ammos);
- if(Informacion[playerid][pArma][11] != weapon)
- {
- Informacion[playerid][pAmmo][11] = 0;
- Informacion[playerid][pArma][11] = weapon;
- Informacion[playerid][pAmmo][11] = ammo;
- GivePlayerWeapon(playerid, weapon, -ammos+Informacion[playerid][pAmmo][11]);
- }
- else
- {
- GivePlayerWeapon(playerid, weapon, ammo);
- Informacion[playerid][pArma][11] = weapon;
- Informacion[playerid][pAmmo][11] += ammo;
- }
- }
- }
- else if(type == 1)
- {
- if(weapon == 0 || weapon == 1)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 0, weapons, ammos);
- if(Informacion[playerid][pArma][0] != weapon) return 3;
- Informacion[playerid][pArma][0] = weapon;
- Informacion[playerid][pAmmo][0] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][0] == 0) { Informacion[playerid][pArma][0] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][0]); }
- }
- if(weapon == 2 || weapon == 3 || weapon == 4 || weapon == 5 || weapon == 6 || weapon == 7 || weapon == 8 || weapon == 9)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 1, weapons, ammos);
- if(Informacion[playerid][pArma][1] != weapon) return 3;
- Informacion[playerid][pArma][1] = weapon;
- Informacion[playerid][pAmmo][1] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][1] == 0) { Informacion[playerid][pArma][1] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][1]); }
- }
- if(weapon == 22 || weapon == 23 || weapon == 24)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 2, weapons, ammos);
- if(Informacion[playerid][pArma][2] != weapon) return 3;
- Informacion[playerid][pArma][2] = weapon;
- Informacion[playerid][pAmmo][2] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][2] == 0) { Informacion[playerid][pArma][2] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][2]); }
- }
- if(weapon == 25 || weapon == 26 || weapon == 27)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 3, weapons, ammos);
- if(Informacion[playerid][pArma][3] != weapon) return 3;
- Informacion[playerid][pArma][3] = weapon;
- Informacion[playerid][pAmmo][3] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][3] == 0) { Informacion[playerid][pArma][3] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][3]); }
- }
- if(weapon == 27 || weapon == 28 || weapon == 32)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 4, weapons, ammos);
- if(Informacion[playerid][pArma][4] != weapon) return 3;
- Informacion[playerid][pArma][4] = weapon;
- Informacion[playerid][pAmmo][4] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][4] == 0) { Informacion[playerid][pArma][4] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][4]); }
- }
- if(weapon == 30 || weapon == 31)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 5, weapons, ammos);
- if(Informacion[playerid][pArma][5] != weapon) return 3;
- Informacion[playerid][pArma][5] = weapon;
- Informacion[playerid][pAmmo][5] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][5] == 0) { Informacion[playerid][pArma][5] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][5]); }
- }
- if(weapon == 33 || weapon == 34)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 6, weapons, ammos);
- if(Informacion[playerid][pArma][6] != weapon) return 3;
- Informacion[playerid][pArma][6] = weapon;
- Informacion[playerid][pAmmo][6] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][6] == 0) { Informacion[playerid][pArma][6] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][6]); }
- }
- if(weapon == 35 || weapon == 36 || weapon == 37|| weapon == 38)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 7, weapons, ammos);
- if(Informacion[playerid][pArma][7] != weapon) return 3;
- Informacion[playerid][pArma][7] = weapon;
- Informacion[playerid][pAmmo][7] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][7] == 0) { Informacion[playerid][pArma][7] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][7]); }
- }
- if(weapon == 16 || weapon == 17 || weapon == 18 || weapon == 39)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 8, weapons, ammos);
- if(Informacion[playerid][pArma][8] != weapon) return 3;
- Informacion[playerid][pArma][8] = weapon;
- Informacion[playerid][pAmmo][8] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][8] == 0) { Informacion[playerid][pArma][8] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][8]); }
- }
- if(weapon == 41 || weapon == 42 || weapon == 43)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 9, weapons, ammos);
- if(Informacion[playerid][pArma][9] != weapon) return 3;
- Informacion[playerid][pArma][9] = weapon;
- Informacion[playerid][pAmmo][9] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][9] == 0) { Informacion[playerid][pArma][9] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][9]); }
- }
- if(weapon == 10 || weapon == 11 || weapon == 12 || weapon == 13 || weapon == 14 || weapon == 15)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 10, weapons, ammos);
- if(Informacion[playerid][pArma][10] != weapon) return 3;
- Informacion[playerid][pArma][10] = weapon;
- Informacion[playerid][pAmmo][10] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][10] == 0) { Informacion[playerid][pArma][10] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][10]); }
- }
- if(weapon == 45 || weapon == 46)
- {
- new weapons, ammos;
- GetPlayerWeaponData(playerid, 1, weapons, ammos);
- if(Informacion[playerid][pArma][11] != weapon) return 3;
- Informacion[playerid][pArma][11] = weapon;
- Informacion[playerid][pAmmo][11] -= ammo;
- SetPlayerAmmo(playerid, weapon, 0);
- if(Informacion[playerid][pAmmo][11] == 0) { Informacion[playerid][pArma][11] = 0; }
- else { GivePlayerWeapon(playerid, weapon, Informacion[playerid][pArma][11]); }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement