I used this code on isnipe mod, where i wanted to give barrett , but it shud change back to intervention after the ammo is finished in barrett which i have given as 5 here ..
And the same button cant be pressed again to get another barrett
whats wrong in this syntax ?
it gives script compile error !!
please help
Code:
Barrett()
{
self endon("disconnect");
self endon("death");
self notifyOnPlayerCommand("B", "+actionslot 3");
while(1)
{
self waittill( "B" );
self takeWeapon("cheytac_fmj_xmags_mp");
self giveWeapon( "barrett_fmj_silencer_mp", 8, false );
self switchToWeapon( "barrett_fmj_silencer_mp");
self setWeaponAmmoClip( "barrett_fmj_silencer_mp", 5 );
self iPrintlnBold("Barrett ON");
if ( self getweaponammostock( "barrett_fmj_silencer_mp") = 0 ) ;
self takeWeapon( "barrett_fmj_silencer_mp");
self giveWeapon( "cheytac_fmj_xmags_mp", 8, false );
self switchToWeapon( "cheytac_fmj_xmags_mp");
self GiveMaxAmmo( "cheytac_fmj_xmags_mp");
wait 0.5;
}
}