Here's another problem which has been bothering me for years, really. Let me first describe the scenario: I want players to be able to type "mutate enable". This in turn should set a boolean value to True on their client, and their client only.
Here is some code to illustrate:
Obviously this won't work, since bEnabled isn't replicated to the clients. However, if this value were replicated, it would affect the boolean value for ALL clients. So if one player was to type "mutate enable", the bool bEnabled would be True for everyone.
The question is: how can I make it so bEnabled is only set True for the client that issued the Mutate request?
More specifically: how do I set it on their client (since bEnabled is used in a simulated function)?
Here is some code to illustrate:
Code:
var bool bEnabled;
function Mutate( string Str, PlayerPawn Sender )
{
if ( Str ~= "enable" )
bEnabled=true;
}
simulated function CheckBool()
{
if(bEnabled) // do something
}
Obviously this won't work, since bEnabled isn't replicated to the clients. However, if this value were replicated, it would affect the boolean value for ALL clients. So if one player was to type "mutate enable", the bool bEnabled would be True for everyone.
The question is: how can I make it so bEnabled is only set True for the client that issued the Mutate request?
More specifically: how do I set it on their client (since bEnabled is used in a simulated function)?