Forum

> > CS2D > Scripts > Pause lua, possible?
Forums overviewCS2D overview Scripts overviewLog in to reply

English Pause lua, possible?

8 replies
To the start Previous 1 Next To the start

old Pause lua, possible?

united
User Off Offline

Quote
Is it possible to make a LUA script that literally pauses the game making it impossible to shoot, hurt, get hurt, throw nades, build and freeze the round time ?

I've used the search function and found this but it only pauses the player who says '!pause'. It would be nice to have a script in which any player said '!p' and all the game and players would pause, allowing you to only talk. Then 75% of the players should say '!up' and the game would continue.

It's not really useful for public servers but for a mixteam or a clanwar it's good for when one person needs to answer the phone or the door or maybe go to the bathroom.

old Re: Pause lua, possible?

DC
Admin Off Offline

Quote
yeah. a real pause function is not possible with Lua.

you can can only "freeze" some parts of the game, but not everything.

old Re: Pause lua, possible?

Apache uwu
User Off Offline

Quote
Possible, however client side is still client side.

I've seen people bypass speedmod -50 with cheats, and lag bypass setweapon.

Besides I doubt anyone would want their game to suddenly freeze.

old Re: Pause lua, possible?

Starkkz
Moderator Off Offline

Quote
I think it is possible, but only for the server. Try this:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function string:split(b)
	local cmd = {}
	if type(self) == "string" then
	if not b then match = "[^%s]+" else match = "[^"..b.."]+" end
	for word in string.gmatch(self,match) do 
			table.insert(cmd,word) 
		end
	end
	return cmd
end

function ms()
	return os.clock() * 1000
end

pauseTimer = ms()

function PauseAction()
	while pauseTimer - ms() > 0 do
		-- Nothing to do here
	end
end

addhook("say","onSay")
function onSay(id,txt)
	local s = txt:split()
	if s[1] == "!p" then
		local time = tonumber(s[2])
		if time then
			pauseTimer = ms() + time
			PauseAction()
		end
	end
end

Use:
say !p [millisecs] to pause the game.
1000 millisecs = 1 second.

old Re: Pause lua, possible?

united
User Off Offline

Quote
user DC has written
yeah. a real pause function is not possible with Lua.

you can can only "freeze" some parts of the game, but not everything.


Is it even possible by scripting the source code? Could it be implemented ?

old Re: Pause lua, possible?

boyzinthewoodz
User Off Offline

Quote
user united has written
phone or the door or maybe go to the bathroom.


1. if i get a important phone call then i always pick it up no matter where or what im doing(shit, puke, sex...;). then i really dont care about a game.
2. i really would hate the guy who pauses the game just because he has to take a shit just because he was to dumb to go before start to play this game.

yes, there is a way to pause the game but not with a lua script.

old Re: Pause lua, possible?

loldlold123
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
pause=0

function freezespeed(id)
for _,id in ipairs(player(0,"table")) do
if pause==1 then
parse("speedmod "..id.." -50")
elseif pause==0 then
parse("speedmod "..id.." 0")
end
end
end

addhook("attack","freezeattack")
funtion freezeattack(id,wpn)
if pause==1 then
parse("equip "..id.." "..wpn.."")
end
end

addhook("hit","freezehit")
function freezehit()
if pause==1 then
return 1
end
end

usid = {34210}
addhook("say", "said")
function said (id,s)
for i = 1, #usid do
if ( s:lower() == "!pause" ) and ( player(id, "usgn") == usid[i] )  then
pause=1
freezespeed(id)
elseif ( s:lower() == "!unpause" ) and ( player(id, "usgn") == usid[i] ) then
pause=0
freezespeed(id)
break
end
end
end
end

and freeze raund time function for,use Starkzz script...
i think thats can help you...İ cant make vote system,but in your clan war admin can pause game...
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview