class YourController extends R6PlayerController;
exec function PrimaryWeapon()
{
if ( (m_pawn != none) && (m_pawn.IsAlive()) && (Pawn.EngineWeapon != none) && (Pawn.EngineWeapon == m_pawn.m_WeaponsCarried[0]) )
{
if ( (m_pawn.m_WeaponsCarried[0].m_iNbBulletsInWeapon == 0) && (R6Weapons(m_pawn.m_WeaponsCarried[0]).m_iCurrentNbOfClips > 0) )
{
ServerPlayRecordedMsg("Status ID_MSG44", PRMV_WeaponDry);
if ( R6Pawn(Pawn).m_bReloadingWeapon )
return;
else
ReloadWeapon();
}
}
else
SwitchWeapon(1);
}
exec function SecondaryWeapon()
{
if ( (m_pawn != none) && (m_pawn.IsAlive()) && (Pawn.EngineWeapon != none) && (Pawn.EngineWeapon == m_pawn.m_WeaponsCarried[1]) )
{
if ( (m_pawn.m_WeaponsCarried[1].m_iNbBulletsInWeapon == 0) && (R6Weapons(m_pawn.m_WeaponsCarried[1]).m_iCurrentNbOfClips > 0) )
{
ServerPlayRecordedMsg("Status ID_MSG44", PRMV_WeaponDry);
if ( R6Pawn(Pawn).m_bReloadingWeapon )
return;
else
ReloadWeapon();
}
}
else
SwitchWeapon(2);
}
Here is a simple code what reloading weapon with sending a voice message. By this code, I send a "Reloading. / Weapon's dry!" voice message when my weapon is empty and if I press PrimaryFire key. * default setting is 1 key.
Posted by HTP_Teq on - Basic Server Side Coding
Multiplayer only.