Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GivePlayerValidWeapon( playerid, WeaponID, Ammo )
- {
- if((PlayerInfo[playerid][pConnectTime] < 2 || PlayerInfo[playerid][pWRestricted] > 0) && WeaponID != 46 && WeaponID != 43) return 1;
- switch( WeaponID )
- {
- case 0, 1:
- {
- PlayerInfo[playerid][pGuns][ 0 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 2, 3, 4, 5, 6, 7, 8, 9:
- {
- PlayerInfo[playerid][pGuns][ 1 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 22, 23, 24:
- {
- PlayerInfo[playerid][pGuns][ 2 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 25, 26, 27:
- {
- PlayerInfo[playerid][pGuns][ 3 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 28, 29, 32:
- {
- PlayerInfo[playerid][pGuns][ 4 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 30, 31:
- {
- PlayerInfo[playerid][pGuns][ 5 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 33, 34:
- {
- PlayerInfo[playerid][pGuns][ 6 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 35, 36, 37, 38:
- {
- PlayerInfo[playerid][pGuns][ 7 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 16, 17, 18, 39, 40:
- {
- PlayerInfo[playerid][pGuns][ 8 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 41, 42, 43:
- {
- PlayerInfo[playerid][pGuns][ 9 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 10, 11, 12, 13, 14, 15:
- {
- PlayerInfo[playerid][pGuns][ 10 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- case 44, 45, 46:
- {
- PlayerInfo[playerid][pGuns][ 11 ] = WeaponID;
- GivePlayerWeapon( playerid, WeaponID, Ammo );
- }
- }
- return 1;
- // Ammunition Checks
- /*if(PlayerInfo[playerid][pGunAmmo][2] > 45)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][2], 45);
- PlayerInfo[playerid][pGunAmmo][2] = 45;
- }
- if(PlayerInfo[playerid][pGuns][3] == 25 && PlayerInfo[playerid][pGunAmmo][3] > 20)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][3], 20);
- PlayerInfo[playerid][pGunAmmo][3] = 20;
- }
- if(PlayerInfo[playerid][pGuns][3] == 26 && PlayerInfo[playerid][pGunAmmo][3] > 30)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][3], 30);
- PlayerInfo[playerid][pGunAmmo][3] = 30;
- }
- if(PlayerInfo[playerid][pGuns][3] == 27 && PlayerInfo[playerid][pGunAmmo][3] > 25)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][3], 25);
- PlayerInfo[playerid][pGunAmmo][3] = 25;
- }
- if(PlayerInfo[playerid][pGunAmmo][4] > 80)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][4], 80);
- PlayerInfo[playerid][pGunAmmo][4] = 80;
- }
- if(PlayerInfo[playerid][pGunAmmo][5] > 85)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][5], 85);
- PlayerInfo[playerid][pGunAmmo][5] = 85;
- }
- if(PlayerInfo[playerid][pGuns][6] == 33 && PlayerInfo[playerid][pGunAmmo][6] > 30)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][6], 30);
- PlayerInfo[playerid][pGunAmmo][6] = 30;
- }
- if(PlayerInfo[playerid][pGuns][6] == 34 && PlayerInfo[playerid][pGunAmmo][6] > 20)
- {
- SetPlayerAmmo(playerid, PlayerInfo[playerid][pGuns][6], 20);
- PlayerInfo[playerid][pGunAmmo][6] = 20;
- }*/
- /*new gun,tmp;
- GetPlayerWeaponData(playerid,4,gun,tmp);
- #pragma unused tmp
- if(gun)SetPlayerArmedWeapon(playerid,gun);
- else SetPlayerArmedWeapon(playerid,0);*/
- //SetPlayerArmedWeapon(playerid,0);
Advertisement
Add Comment
Please, Sign In to add comment