AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Need slowmotion Codes for te_spritetrail (https://forums.alliedmods.net/showthread.php?t=241437)

lover_players 06-03-2014 12:39

Need slowmotion Codes for te_spritetrail
 
Need slowmotion Codes for te_spritetrail i mean when some one buy usp i have added that i spawn sprite but i want them to be in slowmotion mean it float when it spawn but it come slow on floor

.Dare Devil. 06-03-2014 14:53

Re: Need slowmotion Codes for te_spritetrail
 
I see 2 ways.

way 1:
Change server gravity to low, lets say from 800 to 100
and then loop all players and set their pev_gravity from 1.0 to 8.0

Temp entities seems to follow server gravity so it should affect te_spritetrail

way 2:
create entities and make them float

lover_players 06-03-2014 18:30

Re: Need slowmotion Codes for te_spritetrail
 
but how

meTaLiCroSS 06-04-2014 02:04

Re: Need slowmotion Codes for te_spritetrail
 
Quote:

Originally Posted by .Dare Devil. (Post 2146340)
I see 2 ways.

way 1:
Change server gravity to low, lets say from 800 to 100
and then loop all players and set their pev_gravity from 1.0 to 8.0

Temp entities seems to follow server gravity so it should affect te_spritetrail

way 2:
create entities and make them float

They follow server gravity, you said it. So the value sent on the SVC_NEWMOVEVARS message should be altered. @Arkshine should know how to do this.

.Dare Devil. 06-04-2014 02:07

Re: Need slowmotion Codes for te_spritetrail
 
setting gravity:
PHP Code:

server_cmd("sv_gravity 100"

looping players:
PHP Code:

new players32 ], players_counta;
get_playersplayersplayers_count"a" );
for(
0players_counta++ ) set_pevplayers[a], pev_gravity8.0 


aron9forever 06-04-2014 02:36

Re: Need slowmotion Codes for te_spritetrail
 
Quote:

Originally Posted by .Dare Devil. (Post 2146516)
setting gravity:
[php]
server_cmd("sv_gravity 100")
[php]

looping players:
PHP Code:

new players32 ], players_counta;
get_playersplayersplayers_count"a" );
for(
0players_counta++ ) set_pevplayers[a], pev_gravity8.0 


don't do that, it will mess up everything like thrown weapons

edit::
much better

.Dare Devil. 06-04-2014 02:39

Re: Need slowmotion Codes for te_spritetrail
 
Quote:

Originally Posted by aron9forever (Post 2146525)
don't do that, it will mess up everything like thrown weapons

yes but this is the only way to make te_spritetrail floating in air.


new method (only this thing is needed) [ thanks @meTaLiCroSS ]
( this should only affect temp entities, weapon thrown should be same )
PHP Code:

message_beginMSG_ONESVC_NEWMOVEVARSid );
write_long(100);
write_long(get_cvar_float("sv_stopspeed"))
write_long(get_cvar_float("sv_maxspeed"))
write_long(get_cvar_float("sv_spectatormaxspeed"))
write_long(get_cvar_float("sv_accelerate"))
write_long(get_cvar_float("sv_airaccelerate"))
write_long(get_cvar_float("sv_wateraccelerate"))
write_long(get_cvar_float("sv_friction"))
write_long(get_cvar_float("edgefriction"))
write_long(get_cvar_float("sv_waterfriction"))
write_long(8.0// ent gravity
write_long(get_cvar_float("sv_bounce"))
write_long(get_cvar_float("sv_stepsize"))
write_long(get_cvar_float("sv_maxvelocity"))
write_long(get_cvar_float("sv_zmax"))
write_long(get_cvar_float("sv_wateramp"))
write_byte(get_cvar_num("mp_footsteps"))
write_long(0.0// roll angle
write_long(0.0// roll speed
write_long(get_cvar_float("sv_skycolor_r"))
write_long(get_cvar_float("sv_skycolor_g"))
write_long(get_cvar_float("sv_skycolor_b"))
write_long(get_cvar_float("sv_skyvec_x"))
write_long(get_cvar_float("sv_skyvec_y"))
write_long(get_cvar_float("sv_skyvec_z"))
get_cvar_string("sv_skyname"k32)
write_string(k)
message_end(); 

resetting:
PHP Code:

message_beginMSG_ONESVC_NEWMOVEVARSid );
write_long(get_cvar_float("sv_gravity"));
write_long(get_cvar_float("sv_stopspeed"))
write_long(get_cvar_float("sv_maxspeed"))
write_long(get_cvar_float("sv_spectatormaxspeed"))
write_long(get_cvar_float("sv_accelerate"))
write_long(get_cvar_float("sv_airaccelerate"))
write_long(get_cvar_float("sv_wateraccelerate"))
write_long(get_cvar_float("sv_friction"))
write_long(get_cvar_float("edgefriction"))
write_long(get_cvar_float("sv_waterfriction"))
write_long(1.0// ent gravity
write_long(get_cvar_float("sv_bounce"))
write_long(get_cvar_float("sv_stepsize"))
write_long(get_cvar_float("sv_maxvelocity"))
write_long(get_cvar_float("sv_zmax"))
write_long(get_cvar_float("sv_wateramp"))
write_byte(get_cvar_num("mp_footsteps"))
write_long(0.0// roll angle
write_long(0.0// roll speed
write_long(get_cvar_float("sv_skycolor_r"))
write_long(get_cvar_float("sv_skycolor_g"))
write_long(get_cvar_float("sv_skycolor_b"))
write_long(get_cvar_float("sv_skyvec_x"))
write_long(get_cvar_float("sv_skyvec_y"))
write_long(get_cvar_float("sv_skyvec_z"))
get_cvar_string("sv_skyname"k32)
write_string(k)
message_end(); 


<VeCo> 06-04-2014 03:46

Re: Need slowmotion Codes for te_spritetrail
 
8.0 means more acceleration than 1.0.
Change it to something lower, like 0.125 (if you want 100 gravity).

Arkshine 06-04-2014 03:52

Re: Need slowmotion Codes for te_spritetrail
 
This is not going to work properly as a check between mp_ cvars and movevars values is done at each frame, and if a change is dectected, a new message is sent. You need to hook when a change is detected and blocking this call, then sending your custiom message. Something like that: https://forums.alliedmods.net/showpo...2&postcount=50.


All times are GMT -4. The time now is 09:48.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.