Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
Is it possible to freeze a player so he cannot walk, but when he's frozen he will be able to turn around, shoot etc?
I tried
Code: freezeWalk()
{
self endon( "disconnect" );
self endon( "death" );
self endon( "stop_freezing" );
origin = self getOrigin();
while( !gameflag( "prematch_done" ) )
{
self setOrigin( origin );
wait .05;
}
self notify( "stop_freezing" );
}
but it sucks because the player will be spacing all over the place
Posts: 2,509
Threads: 96
Joined: Nov 2010
Reputation:
38
06-01-2011, 21:24
(This post was last modified: 06-01-2011, 21:25 by surtek.)
(06-01-2011, 21:16)iAegle Wrote: Is it possible to freeze a player so he cannot walk, but when he's frozen he will be able to turn around, shoot etc?
cmMOD has this feature before the game starts. I think you can do that by setting running speed to 0.
Posts: 5,135
Threads: 241
Joined: Nov 2010
Reputation:
100
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
(06-01-2011, 21:24)surtek Wrote: (06-01-2011, 21:16)iAegle Wrote: Is it possible to freeze a player so he cannot walk, but when he's frozen he will be able to turn around, shoot etc?
cmMOD has this feature before the game starts. I think you can do that by setting running speed to 0.
Thanks works fine ^^
Code: freezeWalk( thing )
{
self endon( "disconnect" );
self endon( "death" );
self endon( "stop_freezing" );
self setMoveSpeedScale( 0 );
while( !gameflag( "prematch_done" ) )
wait .05;
self maps\mp\gametypes\_weapons::updateMoveSpeedScale();
self notify( "stop_freezing" );
}
Posts: 4,530
Threads: 254
Joined: Nov 2010
Reputation:
65
Code: for(;;)
{
self setVelocity((0,0,0));
wait 0.05;
}
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
(06-01-2011, 21:42)AZUMIKKEL Wrote: Code: for(;;)
{
self setVelocity((0,0,0));
wait 0.05;
}
Whats the default velocity? so when prematch is done it resets to default?
Posts: 5,135
Threads: 241
Joined: Nov 2010
Reputation:
100
(06-01-2011, 21:46)iAegle Wrote: (06-01-2011, 21:42)AZUMIKKEL Wrote: Code: for(;;)
{
self setVelocity((0,0,0));
wait 0.05;
}
Whats the default velocity? so when prematch is done it resets to default?
Velocity changes when you fall move etc..
And it's in a loop so wouldn't it just be manual when you stop the loop?
Posts: 1,830
Threads: 104
Joined: Jan 2011
Reputation:
46
(06-01-2011, 21:51)Pozzuh Wrote: (06-01-2011, 21:46)iAegle Wrote: (06-01-2011, 21:42)AZUMIKKEL Wrote: Code: for(;;)
{
self setVelocity((0,0,0));
wait 0.05;
}
Whats the default velocity? so when prematch is done it resets to default?
Velocity changes when you fall move etc..
And it's in a loop so wouldn't it just be manual when you stop the loop?
Dunno if it stops? whatever I got something else working so it doesnt matter.
Posts: 4,530
Threads: 254
Joined: Nov 2010
Reputation:
65
setVelocity is like setOrigin, it's a one-time use
|