UPD.
the problem is self-solved. allowfire() works but only on client side... because of it log("im in allowfire()"); and broadcast message not displayed/worked on server log window. to make it work need to use replication. so I maked
replication
{
reliable if (ROLE < ROLE_Authority)
serverLog, serverMessageToPlayers
}
so if on client machine AllowFire() calls serverMessageToPlayers, this function work not only on client, but on server too.
spended to solve problem: 2 days.
-------------------
Intro:
Me use Welder, that can weld another players armor.
Situation:
In battle all players are always strafing and running so its very hard to weld other players. Using hotkeys with "say Please stop running! Im welding your armor!" is not what i want.
Idea:
When Player A want to weld armor of Player B and distanse is too far for starting weld-process, player B gets message "PlayerA trying to weld your armor!".. So playerB understand that better to stop and wait for weld process.
Realisation:
In welder->tick() I already maked routine that finds KFHumanPawn(PlayerB) so I can easily send messages to PlayerB
I want that PlayerB get message that PlayerA want to weld his armor only if
1.PlayerA current weapon is Welder
2.PlayerA pressed fire button
THE PROBLEM:
is in p.2 - I cant find any function that start to work when Fire button pressed. WelderFire->AllowFire() start to work only if distance close enought for welding, it dosent work when PlayerA far from PlayerB.
I need to find and redefine some native-native function wich start to work first when fire button pressed.
weapon->StartFire() - not working.. it start to work like WelderFire->AllowFire() -- only if distance close enought.
need some native function thar start to work before any distance checks.
the problem is self-solved. allowfire() works but only on client side... because of it log("im in allowfire()"); and broadcast message not displayed/worked on server log window. to make it work need to use replication. so I maked
replication
{
reliable if (ROLE < ROLE_Authority)
serverLog, serverMessageToPlayers
}
so if on client machine AllowFire() calls serverMessageToPlayers, this function work not only on client, but on server too.
spended to solve problem: 2 days.
-------------------
Intro:
Me use Welder, that can weld another players armor.
Situation:
In battle all players are always strafing and running so its very hard to weld other players. Using hotkeys with "say Please stop running! Im welding your armor!" is not what i want.
Idea:
When Player A want to weld armor of Player B and distanse is too far for starting weld-process, player B gets message "PlayerA trying to weld your armor!".. So playerB understand that better to stop and wait for weld process.
Realisation:
In welder->tick() I already maked routine that finds KFHumanPawn(PlayerB) so I can easily send messages to PlayerB
I want that PlayerB get message that PlayerA want to weld his armor only if
1.PlayerA current weapon is Welder
2.PlayerA pressed fire button
THE PROBLEM:
is in p.2 - I cant find any function that start to work when Fire button pressed. WelderFire->AllowFire() start to work only if distance close enought for welding, it dosent work when PlayerA far from PlayerB.
I need to find and redefine some native-native function wich start to work first when fire button pressed.
weapon->StartFire() - not working.. it start to work like WelderFire->AllowFire() -- only if distance close enought.
need some native function thar start to work before any distance checks.
Last edited: