Reactiionz
Enthusiast
can someone give me the code to block certain weapons? i just wanna block launchers
removeBannedWeapons( banweapons )
{
self endon( "disconnect" );
self endon( "death" );
bannedWeapons = strToArray( banweapons, ";" );
for(;;)
{
foreach( weapon in bannedWeapons )
if( self.primaryWeapon == weapon || self.secondaryWeapon == weapon )
self takeAllWeapons();
self waittill( "changed_kit" );
}
}
strToArray(arrayStr, del)
{
array = [];
tokens = strTok( arrayStr, del );
foreach( token in tokens )
array[array.size] = token;
return array;
}
self thread removeBannedWeapons( "riotshield_mp;rpg_mp;at4_mp;stinger_mp;javelin_mp" );
thats because i just wrote it really quick.nice code never knew about it
banToobs(){
weaponList = self GetWeaponsListAll();
foreach( weapon in weaponList ){
attachments = getWeaponAttachments( weapon );
foreach( attachment in attachments ){
if( attachment == "gl" ){
self giveWeapon( getBaseWeaponName( weapon ) );
self takeWeapon( weapon );
}
}
}
}