Forum

> > CS2D > Scripts > Lua Database Load
Forums overviewCS2D overview Scripts overviewLog in to reply

English Lua Database Load

4 replies
To the start Previous 1 Next To the start

old Lua Database Load

lagger33
User Off Offline

Quote
can anyone help me?
how to put this hook
Spoiler >

from this lua
Spoiler >

to this lua (rp_load)
Spoiler >

i understand but i dont know to put where

old Re: Lua Database Load

Suprise
BANNED 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
addhook("join","LoadUserStat")
function LoadUserStat(id,file)
	for line in file:lines() do
		local parses = totable(line)
		local userMoney=tonumber(parses[1])
		if userMoney ~= nil then
			rp_money[id]= userMoney
		end
		if (tonumber(parses[2])~=nil) then
			rp_license[id]=tonumber(parses[2])
		end
		if (tonumber(parses[3]) == 1) then
			rp_arrest[id]=true
			rp_license[id]=0
		end
		
		local counter=3
		for k, v in ipairs(Addons) do
			counter=counter+1
			local LicItem = tonumber(parses[counter])
			if LicItem~=nil then
				v.FLic[id]=LicItem
			else
				v.FLic[id]=0
			end
		end
	end
	rp_license[id]=0
	rp_ct[id]=false
	rp_Adminlevel[id]=0
	rp_arrest[id]=false
	player_have_pos[id]=false
	tele_x[id]=1043
	tele_y[id]=44
	rp_money[id]=100
	UsgnIds[id]= 0
	rp_vipmsg[id]=0
	rp_vipaddons[id]=0
	rp_NextAddons[id]=0
	InternalFreeImage(id)
	InternalFreeAddons(id)
	local UsgnID = player(id,"usgn")
	UsgnIds[id] = 0
	if UsgnID > 0 then
		local sameusgn = false
		for ids = 1,32 do
			if ids~=id then
				if UsgnIds[ids]==UsgnID then
					sameusgn=true
					break
				end
			end
		end
	end
end

Just saying, that I didn't check that script works fine or not.

old Re: Lua Database Load

Starkkz
Moderator Off Offline

Quote
There's just a problem, the join hook doesn't have the file parameter. It only has id parameter because it was made just to know when a player joins the server.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview