Forum

> > CS2D > Scripts > How to make auto vip??
Forums overviewCS2D overview Scripts overviewLog in to reply

English How to make auto vip??

9 replies
To the start Previous 1 Next To the start

old Re: How to make auto vip??

Louie
User Off Offline

Quote
1. Make a variable(Name it Time_Played or something)
2. Check all players, check if a player isn't a spectator.
3. If so then every minute(or second if you want) it will add +1 to the variable in step 1
4. If the variable is equal to 1 Day(1440 minutes) then
5. The player gets VIP √

old Re: How to make auto vip??

Dousea
User Off Offline

Quote
I'm going to be nice here.
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
timeplayed = {}

for _, hook in ipairs({"join", "minute",}) do
	addhook(hook, hook .. "hook")
end

function joinhook(id)
	local usgn = player(id, "usgn")
	
	if (usgn > 0 --[[and <your code to check if the player is not a V.I.P.>]]) then
		timeplayed[usgn] = timeplayed[usgn] or 0
	end
end

function minutehook()
	for _, id in ipairs(player(0, "tableliving")) do
		local usgn = player(id, "usgn")
		
		if (timeplayed[usgn]) then
			timeplayed[usgn] = timeplayed[usgn] + 1
			
			if (timeplayed[usgn] >= 1440) then
				timeplayed[usgn] = nil
				
				-- <your V.I.P. code here>
			end
		end
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview