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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
function totable(t,match)
local cmd = {}
if not match then match = "[^%s]+" end
for word in string.gmatch(t, match) do
table.insert(cmd, word)
end
return cmd
end
function initArray(m)
	local array = {}
	for i = 1, m do
		array[i]=0
	end
	return array
end
givework=initArray(32)
addhook("minute","WorkPay") --PAYMENTS PER MINUTE
function WorkPay()
msg("©150150150PAYDAY!!!")
local id = 0
	while (id<32) do
		id = id+1
		if player(id, "exists") then
			--WORKER
			if givework[id]==1 then
				msg2(id,"©200200200You receive $1000!")
				parse("setmoney "..id.." "..player(id,"money")+1000)
			end
			--MINER
			if givework[id]==2 then
				msg2(id,"©200200200You receive $2000!")
				parse("setmoney "..id.." "..player(id,"money")+2000)
			end
			--BARMAN
			if givework[id]==3 then
				msg2(id,"©200200200You receive $3000!")
				parse("setmoney "..id.." "..player(id,"money")+3000)
			end
			--SOLDIER
			if givework[id]==4 then
				msg2(id,"©200200200You receive $4000!")
				parse("setmoney "..id.." "..player(id,"money")+4000)
			end
			--DOCTOR
			if givework[id]==5 then
				msg2(id,"©200200200You receive $5000!")
				parse("setmoney "..id.." "..player(id,"money")+5000)
			end
			--DEALER
			if givework[id]==6 then
				msg2(id,"©200200200You receive $6000!")
				parse("setmoney "..id.." "..player(id,"money")+6000)
			end
			--BANKER
			if givework[id]==7 then
				msg2(id,"©200200200You receive $7000!")
				parse("setmoney "..id.." "..player(id,"money")+7000)
			end
			if givework[id]==nil or givework[id]>7 then
				givework[id] = 0
				msg2(id,"©200200200You dont has a Job!")
			end
			if givework[id]==0 then
				msg2(id,"©200200200You dont has a Job!")
			end
		end
	end
end
addhook("say","AdminWork")
function AdminWork(id,txt)
	if (player(id,"usgn")==01234 then--IMPORTANT : INPUT YOUR USGN HERE!!!!OR YOU NAME WITH if (player(id,"name")=="YOURNAMEHERE" then
		_msg=totable(txt)
		_t1=tostring(_msg[1])
		if (_t1=="!givework") then --!givework <ID> <WORK>
			_t2=tonumber(_msg[2]) --_t1 = !givework => _t2 = <ID> => _t3 = <WORK>
			_t3=tonumber(_msg[3])
			if (_t2 ~= nil) then
				if player(_t2,"exists") then
					if (_t3 ~= nil)then
						if (_t3>=0) and (_t3<=7) then
							--NOTHING
							if (_t3==0) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." no has a Work!@C")
								msg2(_t2,"©255255255Now you no has a Work!@C")
								end
							--WORKER
							if (_t3==1) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." is now a Worker!@C")
								msg2(_t2,"©255255255Now you are a Worker!@C")
								end
							--MINER
							if (_t3==2) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." is now a MINER!@C")
								msg2(_t2,"©255255255Now you are a MINER!@C")
								end
							--BARMAN
							if (_t3==3) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." is now a BARMAN!@C")
								msg2(_t2,"©255255255Now you are a BARMAN!@C")
								end
							--SOLDIER
							if (_t3==4) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." is now a SOLDIER!@C")
								msg2(_t2,"©255255255Now you are a SOLDIER!@C")
								end
							--DOCTOR
							if (_t3==5) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." is now a DOCTOR!@C")
								msg2(_t2,"©255255255Now you are a DOCTOR!@C")
								end
							--DEALER
							if (_t3==6) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." is now a DEALER!@C")
								msg2(_t2,"©255255255Now you are a DEALER!@C")
								end
							--BANKER
							if (_t3==7) then
								givework[_t2]=_t3
								msg2(id,"©255255255"..player(_t2,"name").." is now a BANKER!@C")
								msg2(_t2,"©255255255Now you are a BANKER!@C")
								end
						else
							msg2(id,"©255255255Input the Work Number(0~7)!@C")
							end
					else
						msg2(id,"©255255255Input the Work Number(0~7)!@C")
						end
				else
					msg2(id,"©255255255".._t2.." is not a valid ID!@C")
					end
			else
				msg2(id,"©255255255You need to input the ID!@C")
				end
		return 1
		end
	end
end
addhook("join","WorkCleanJoin")
function WorkCleanJoin(id)
	givework[id] = 0
end
addhook("leave","WorkCleanLeave")
function WorkCleanLeave(id)
	givework[id] = 0
end