View Full Version : How can i limit the serverfire rate with an exec function?
Copy&PasteCoder
14th November 2005, 19:16
I will limit the serverfire rate with an exec function, the range of the serverfire rate should be between 1 and 6.
i dont want a keyevent, i hate keyevents.
here's an example code, but for any reason, it draws the limited serverrate, but it does not execute it properly.
you can still adjust more then serverfire rate 6 with this code
exec function ServerFireAdjust(int iServerRate)
{
iServerRate = Min(Max(iServerRate,1),6);
AuthSay("ServerRate = " $ string(iServerRate));
}
SmokeZ
14th November 2005, 19:24
if(IsInState('BusyFiring')) sleep(whateveryouwant);
hope this works
HyPeR-X
14th November 2005, 19:35
Clamp(FRate, 1, 6);
- HyPz
Copy&PasteCoder
14th November 2005, 19:57
if(IsInState('BusyFiring')) sleep(whateveryouwant);
hope this works
Err'm, i guess that's not a great help, it's more useless spam?
Clamp(FRate, 1, 6);
- HyPz
That's a great help, from there i can start, thanks.
found this piece of code in the playercontroller.uc, if someone needs a hint
exec function FOV(float F)
{
if( (F >= 80.0) || (Level.Netmode==NM_Standalone) )
{
DefaultFOV = FClamp(F, 1, 170);
DesiredFOV = DefaultFOV;
SaveConfig();
}
}
valenti1232289
14th November 2005, 20:38
Copy&PasteCoder my ass ;)
SmokeZ
14th November 2005, 20:54
Err'm, i guess that's not a great help, it's more useless spam?
jup but works for me :P
state stopfireing
{
if(PlayerController.Pawn.Weapon.IsInState('BusyFir ing'))
{
PlayerController.Pawn.Weapon.ServerStopFiring();
sleep(0.5);
PlayerController.Pawn.Weapon.GotoState('BusyFiring ')
}
}
edit.. ah yes my eyes -_-
forget about that whatever rofl
Copy&PasteCoder
14th November 2005, 21:39
jup but works for me :P
state stopfireing
{
if(PlayerController.Pawn.Weapon.IsInState('BusyFir ing'))
{
PlayerController.Pawn.Weapon.ServerStopFiring();
sleep(0.5);
PlayerController.Pawn.Weapon.GotoState('BusyFiring ')
}
}I think you didn't understand my help question. i needed a min., max. rate adjust. nvm, fixed it and found what i needed, thanks to hypz.
for the logs, here this code is what did work for me. you can't set the fov more then 85 angle and less then 1 angle. with the old code, i could set the fov more then 85. i did @ example type in the console "fov 545454" and the console message replyed with fov is 85, that was not true, their was no limit in the set fov range.
exec function SetFovRate(float NewFov)
{
FovRate = NewFov;
FovRate = Clamp(NewFov, 1, 85);
if ((FovRate <= 1.00) || (FovRate >= 85.00))
{
return;
}
Msg("FovRate Set To = " $ string(NewFov));
}
only this line Clamp(NewFov, 1, 85); in a exec function, did not work properly for me, i still could set the fov to 644544...but with the if ((FovRate <= 1.00) || (FovRate >= 85.00))
it did work for me, now i can't set the fov angle more then 85 and less then 1, only in the range of 1 - 85.
Copy&PasteCoder my ass ;)
Most of the best bots, was created by copy and paste coders. :)
valenti1232289
14th November 2005, 22:03
nonthless, u seem to be more than c'n'p ;)
No1uKnow
14th November 2005, 22:09
i think i know who that is, might be wrong though ;)
anyways, glad to see you figured out what your looking for.
Powered by vBulletin™ Version 4.0.2 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.