Hello guys. My guns use a custom reload function, it is working perfectly.
The reload function is an exec function trigerred by key “R”. However I need that the bot also reload the weapon, because the weapons are used by both player and bots.
For the bot I made a simple function that will make the gun automatically reload whenever it reaches ammocount of 1, it works, however I don’t know how to check if the weapon is being held by player or bot, because I want the auto reload function only for bots, as for the player he needs to press “R”.
This is a part of my code
//function to fire gun and play animation/////////////////////////
simulated function FireAmmunition()
{
//this variables will be used to access player controller
local Playercontroller localplayer;
//this will check if ammo reached zero to automatically reload weapon
if ( AmmoCount <= 1 && UTPawn(Owner) != UTPlayerController(localplayer) )
{
//this will call the simulated reload function
Super.AutoReload();
}
However it does not work, I receive the compiling error message: "Error, Operator ‘!=’: Comparison will always suceed"
Any help???