AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Using slowmotion without sv_cheat 1 (https://forums.alliedmods.net/showthread.php?t=258751)

TheDS1337 02-23-2015 15:04

Using slowmotion without sv_cheat 1
 
Hello guys,

I hope that I'm in the right section, well my question is if it's possible to use host_timescale without sv_cheat 1 ? so that we can make the slow motion work in coop mission maps online =] thanks!

Michalplyoutube 02-23-2015 15:42

Re: Using slowmotion without sv_cheat 1
 
No its not posible it will not work or break the gameplay.

Oshizu 02-23-2015 15:52

Re: Using slowmotion without sv_cheat 1
 
You could perhaps take a look at Freak Fortress 2 Plugin and see how they deal with host_timescale there or slow motion :D

Wliu 02-23-2015 16:00

Re: Using slowmotion without sv_cheat 1
 
...sort of. Quick pseudo-code:
Code:
cvarTimeScale=FindConVar("host_timescale"); //Create a command here like sm_timescale so players/admins can set host_timescale to what they want //In your callback for the command you created... char timescale[4]; GetCmdArg(1, timescale, sizeof(timescale)); SetConVarFloat(cvarTimeScale, StringToInt(timescale));  //You might want to make sure timescale isn't 0 here

You may need to set each client's cheat value when you do that-I'm not too sure. If so...
Code:
stock void UpdateClientCheatValue(int client, int value) {     if(client>0 && client<=MaxClients && IsClientInGame(client) && IsPlayerAlive(client) && !IsFakeClient(client))     {         char cheatValue[2];         IntToString(value, cheatValue, sizeof(cheatValue));         SendConVarValue(client, cvarCheats, cheatValue);     } }
Something like that *should* work.

EDIT: This uses new-style syntax so you'll need a 1.7 compiler to compile this.

Mathias. 02-23-2015 17:42

Re: Using slowmotion without sv_cheat 1
 
You can remove the cheats value out of it for the duration of the slow motion, query player host_timescale and kick them if they try to change it while in slowmotion

Neuro Toxin 02-23-2015 17:45

Re: Using slowmotion without sv_cheat 1
 
Not sure what game your using.

However timescale only effects sounds in csgo. It doesn't slow down gameplay.

You can set it using sm_cvar in console to confirm.

Also be careful as you can crash your server and clients if set to high or low.

Mathias. 02-23-2015 18:01

Re: Using slowmotion without sv_cheat 1
 
it does slowdown the gameplay, everything.

Wliu 02-23-2015 18:18

Re: Using slowmotion without sv_cheat 1
 
Quote:

Originally Posted by Neuro Toxin (Post 2265824)
Not sure what game your using.

However timescale only effects sounds in csgo. It doesn't slow down gameplay.

You can set it using sm_cvar in console to confirm.

Also be careful as you can crash your server and clients if set to high or low.

I'm coming from TF2 in which it slows down *everything*, as Black-Rabbit said.

Darkness_ 02-23-2015 18:33

Re: Using slowmotion without sv_cheat 1
 
This could work

PHP Code:

public slowMo() {
    for (new 
1<= MaxClientsi++) {
        if (!
IsClientInGame(i)) 
            continue;
        
SendConVarValue(iFindConVar("host_timescale"), "0.5");
    }
    
SetConVarInt(FindConVar("host_timescale"), "0.5");


Maybe run the SendConVarValue on a timer to make sure client dont change the value somehow

TheDS1337 03-09-2015 07:18

Re: Using slowmotion without sv_cheat 1
 
Thanks all for the responds, it seems that the only way is to set sv_cheat 1 during the slow motion and set it back to 0 when the slow motion ends (using a timer like you guys said).

The game mode it's not really a mod tbh it's just some funny maps (coop missions) I found them in workshop but it seems that they won't work in dedicated servers after asking the maps creator.


All times are GMT -4. The time now is 08:50.

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