Here i only created functions to sell weapons to players, send money and to show weapons, but the send money and sell weapons is not working, it returns: "attempt to compare number with string", and now???
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
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
addhook("sayteam","mk3.utils.sayteam")
function mk3.utils.sayteam(id,message)
	if(message=="!comandos") then
		parse("sv_msg2 "..id.." ©255000000|~~~| LISTA DE COMANDOS: |~~~|")
		parse("sv_msg2 "..id.." ©255255255[COMANDO] [O QUE FAZ]")
--		parse("sv_msg2 "..id.." ©255255255!sms [id] [mensagem] - Envia mensagem pessoal para jogador (máximo de 30 letras).")
		parse("sv_msg2 "..id.." ©255255255!pagar [id] [quantia] - Da a quantia desejada ao jogador.")
--		parse("sv_msg2 "..id.." ©255255255!credito [quantia] - Troca dinheiro normal por créditos ($1000 > 1CR)")
		parse("sv_msg2 "..id.." ©255255255!vender [id] [arma] [preço] - Vende arma ao jogador, baseado no id da arma (!armas).")
	elseif(message=="!armas") then
		parse("sv_msg2 "..id.." ©255000000|~~~| Lista DE ARMAS E SEUS ID: |~~~|")
		parse("sv_msg2 "..id.." ©255255255[ID] [ARMA]")
		parse("sv_msg2 "..id.." ©255255255[1] [USP]")
		parse("sv_msg2 "..id.." ©255255255[3] [Desert Eagle]")
		parse("sv_msg2 "..id.." ©255255255[10] [M3]")
		parse("sv_msg2 "..id.." ©255255255[11] [XM1014]")
		parse("sv_msg2 "..id.." ©255255255[20] [MP5]")
		parse("sv_msg2 "..id.." ©255255255[21] [TMP]")
		parse("sv_msg2 "..id.." ©255255255[30] [AK-47]")
		parse("sv_msg2 "..id.." ©255255255[31] [SG552]")
		parse("sv_msg2 "..id.." ©255255255[35] [AWP]")
		parse("sv_msg2 "..id.." ©255255255[33] [AUG]")
		parse("sv_msg2 "..id.." ©255255255[32] [M4A1]")
		parse("sv_msg2 "..id.." ©255255255[40] [M249]")
	elseif(string.sub(message, 1, 7)=="!vender") then
		posx = player(id, "tilex")
		posy = player(id, "tiley")
		if(posx>=5) then
		if(posy>=40) then
		if(posx<=13) then
		if(posy<=43) then
--			if(id!=id) then
				if(string.sub(message, 9,10) >= 10) then
					para = string.sub(message, 9, 10)
					if(string.sub(message, 12, 13) >= 10) then
						arma = string.sub(message, 12, 13)
						preco = string.sub(message, 15, 20)
					else
						arma = string.sub(message, 12, 12)
						preco = string.sub(message, 14, 19)
					end
				else
					para = string.sub(message, 9, 9)
					if(string.sub(message, 11, 12) >= 10) then
						arma = string.sub(message, 11, 12)
						preco = string.sub(message, 14, 19)
					else
						arma = string.sub(message, 11, 11)
						preco = string.sub(message, 13, 18)
					end	
				end
				parse("equip "..para.." "..arma)
				parse("setmoney "..para.." "..player(para,"money") - preco)
				parse("setmoney "..id.." "..player(id,"money") + preco)
--			else
--				parse("msg2 "..id.." ©255000000ERRO: Você não pode vender para você mesmo!")
--			end
		end
		end
		end
		end
	elseif(string.sub(message, 1, 6)=="!pagar") then
		if(string.sub(message, 8, 9)>10) then
			para = string.sub(message, 8, 9)
			quantia = string.sub(message, 11, 16)
		else
			para = string.sub(message, 8, 8)
			quantia = string.sub(message, 12, 17)
		end
		parse("setmoney "..para.." "..player(para,"money") + quantia)
		parse("setmoney "..id.." "..player(id, "money") - quantia)
		parse("msg2 "..para.." O jogador "..player(id,"name").." te deu $"..quantia..".")
	else
		parse("sv_msg2 "..id.." ©255000000ERRO: Comando Inválido! O chat de time foi substituído onde você pode colocar comandos.")
	end
	return 1
end
Lua Scripts/Questions/Help


Offline