Dateien

> > CS2D > Lua Scripts > !say equip
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch !say equip >

21 Kommentare705 b, 740 Downloads

alt !say equip

Nicok
User Off Offline

This is my first lua script.
I hope you like.

the script is say a name of a weapon (example "!aug" or "!deagle") gives the gun mentioned.

×Coins
×Money
×Gold

the names are:
!usp=USP
!glock=Glock
!deagle=Deagle
!p228=P228
!elite=elite
!fiv-sev=Five-Seven
!m3=M3
!xm1014=XM1014
!mp5=MP5
!tpm=TMP
!p90=P90
!mac=Mac 10
!ump45=UMP45
!ak=AK-47
!sg552=SG552
!m4=M4A1
!aug=AUG
!scout=Scout
!awp=AWP
!g3sg1=G3SG1
!sg550=SG550
!galil=Galil
!famas=Famas
!m249=M249
!tactical=Tactical Shield
!laser=Laser
!flame=FlameThrower
!rpg=RPG Launcher
!rocket=Rocket Launcher
!granade=Grenade Launcher
!he=HE
!flash=FlashBang
!smoke=SmokeGrenade
!flare=Flare
!defuse=Defuse Kit
!kevlar=Kevlar
!kevlar+=Kevlar+Helm
!night=Night Vision
!primary=Primary Ammo
!secundary=Secundary Ammo
!medikit=Medikit
!bendage=Bendage
!machete=Machete
!gas=Gas Grenade
!molotov=Molotov Cocktail
!wrench=Wrench
!snowball=Snowball
!air=Air Strike
!mine=Mine
!claw=Claw
!light=Light Armor
!armor=Armor
!heavy=Heavy Armor
!medic=Medic Armor
!super=Super Armor
!stealth=Stealth Suit
!chainsaw=ChainSaw
!gut=Gut Bomb
!laserm=Laser Mine
!portal=PortalGun

∗Have Fun!!!
2× editiert, zuletzt 23.06.11 19:15:26
Zugelassen von Sparty

Download Download

705 b, 740 Downloads

Kommentare

21 Kommentare
Seite
Zum Anfang Vorherige 1 2 Nächste Zum Anfang

Logge dich ein!

Du musst dich einloggen, um selber Kommentare verfassen zu können!Einloggen

alt

KOMENDANT
User Off Offline

I not understand! How it works?

WoW! I understand! 10/5!!! It's cool!
Ich mag es!
1× editiert, zuletzt 30.12.11 13:58:53

alt =D

sheeL
User Off Offline

Good script
Ich mag es!

alt

Apache uwu
User Off Offline

@nicok, optimized code.

1
2
3
4
5
6
7
8
9
10
11
wep={}                                                                                               
for i = 1,89 do                                                                                       
	wep[i]=string.lower(itemtype(i,"name"))
end

addhook("say","equip")
function equip(id,text)
	if string.sub(string.lower(text),2)==wep[i] then                                   
		parse("equip "..id.." "..i.."")                     
	end
end

alt New

Nicok
User Off Offline

This is the new !say equip. Is shorter than the last LOL.
Only says: [!] + Name [full] of the weapon. Example !rpg launcher.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
wep = {} 										
i = 0 											
while (i < 88) do 								
i = i + 1 										
wep[i] = "!"..string.lower(itemtype(i,"name")).."" 
end

addhook("say","equip")
function equip(id,text)
text = string.lower(text) 							
i = 0 											
while (i < 88) do 								
i = i + 1										
if text == wep[i] then							
parse("equip "..id.." "..i.."") 				
end
end
end

Thank you very much to user EnderCrypt
1× editiert, zuletzt 18.07.11 01:02:43

alt

Mantasz
User Off Offline

Simple, but verry good
Ich mag es!

alt

Spartan2D
User Off Offline

add this:
!AWESOME 5/5
Ich mag es!

alt wow

Itibere10
User Off Offline

nice work man! is une big work and a big inventory!
this is amazing!
Ich mag es!

alt

biohzrd
User Off Offline

i'm rate 2/5 , use please FULL names of weapons !!
what is fiv-sev?? tactical?? more simple five-seven and shield (laserm?? mb lm?)

alt

Sebax
User Off Offline

LOL,this is awesome lua,i download it.
Ich mag es!

alt

itsoxymoron
User Off Offline

Yeah,you see,..
oh niko,dont use it translator,..no se entiende ni J, lol
Ich mag es!

alt

Nicok
User Off Offline

not steal the idea for the lua script. which he had not even a sap like that.
and what he says is correct @Aizajar not resemble the luas.

forgive, but my English is bad... lol

alt

Vetle
BANNED Off Offline

Great for uber nubnubs, lol.

alt

itsoxymoron
User Off Offline

user ArChaLV

Look at the niko's code

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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
addhook("say","equip")
function equip(id,env)
if (env=="!usp") then
parse("equip "..id.." 1")
end
if (env=="!glock") then
parse("equip "..id.." 2")
end
if (env=="!deagle") then
parse("equip "..id.." 3")
end
if (env=="!p228") then
parse("equip "..id.." 4")
end
if (env=="!elite") then
parse("equip "..id.." 5")
end
if (env=="!fiv-sev") then
parse("equip "..id.." 6")
end
if (env=="!m3") then
parse("equip "..id.." 10")
end
if (env=="!xm1014") then
parse("equip "..id.." 11")
end
if (env=="!mp5") then
parse("equip "..id.." 20")
end
if (env=="!tpm") then
parse("equip "..id.." 21")
end
if (env=="!p90") then
parse("equip "..id.." 22")
end
if (env=="!mac") then
parse("equip "..id.." 23")
end
if (env=="!ump45") then
parse("equip "..id.." 24")
end
if (env=="!ak") then
parse("equip "..id.." 30")
end
if (env=="!sg552") then
parse("equip "..id.." 31")
end
if (env=="!m4") then
parse("equip "..id.." 32")
end
if (env=="!aug") then
parse("equip "..id.." 33")
end
if (env=="!scout") then
parse("equip "..id.." 34")
end
if (env=="!awp") then
parse("equip "..id.." 35")
end
if (env=="!g3sg1") then
parse("equip "..id.." 36")
end
if (env=="!sg550") then
parse("equip "..id.." 37")
end
if (env=="!galil") then
parse("equip "..id.." 38")
end
if (env=="!famas") then
parse("equip "..id.." 39")
end
if (env=="!m249") then
parse("equip "..id.." 40")
end
if (env=="!tactical") then
parse("equip "..id.." 41")
end
if (env=="!laser") then
parse("equip "..id.." 45")
end
if (env=="!flame") then
parse("equip "..id.." 46")
end
if (env=="!rpg") then
parse("equip "..id.." 47")
end
if (env=="!rocket") then
parse("equip "..id.." 48")
end
if (env=="!granade") then
parse("equip "..id.." 49")
end
if (env=="!he") then
parse("equip "..id.." 51")
end
if (env=="!flash") then
parse("equip "..id.." 52")
end
if (env=="!smoke") then
parse("equip "..id.." 53")
end
if (env=="!flare") then
parse("equip "..id.." 54")
end
if (env=="!defuse") then
parse("equip "..id.." 56")
end
if (env=="!kevlar") then
parse("equip "..id.." 57")
end
if (env=="!kevlar+") then
parse("equip "..id.." 58")
end
if (env=="!night") then
parse("equip "..id.." 59")
end
if (env=="!primary") then
parse("equip "..id.." 61")
end
if (env=="!secundary") then
parse("equip "..id.." 62")
end
if (env=="!medikit") then
parse("equip "..id.." 64")
end
if (env=="!bendage") then
parse("equip "..id.." 65")
end
if (env=="!machete") then
parse("equip "..id.." 69")
end
if (env=="!gas") then
parse("equip "..id.." 72")
end
if (env=="!molotov") then
parse("equip "..id.." 73")
end
if (env=="!wrench") then
parse("equip "..id.." 74")
end
if (env=="!snowball") then
parse("equip "..id.." 75")
end
if (env=="!air") then
parse("equip "..id.." 76")
end
if (env=="!mine") then
parse("equip "..id.." 77")
end
if (env=="!claw") then
parse("equip "..id.." 78")
end
if (env=="!light") then
parse("equip "..id.." 79")
end
if (env=="!armor") then
parse("equip "..id.." 80")
end
if (env=="!heavy") then
parse("equip "..id.." 81")
end
if (env=="!medic") then
parse("equip "..id.." 82")
end
if (env=="!super") then
parse("equip "..id.." 83")
end
if (env=="!stealth") then
parse("equip "..id.." 84")
end
if (env=="!chainsaw") then
parse("equip "..id.." 85")
end
if (env=="!gut") then
parse("equip "..id.." 86")
end
if (env=="!laserm") then
parse("equip "..id.." 87")
end
if (env=="!portal") then
parse("equip "..id.." 88")
end
end

now look

the other "stolen" script that you say

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
point.sayfuncs={}
addhook("say","point.sayfuncs.say")
function point.sayfuncs.say(p,txt)
if (txt=="!usp") then parse("equip "..p.." 1"); return 1 end
if (txt=="!glock") then parse("equip "..p.." 2"); return 1 end
if (txt=="!deagle") then parse("equip "..p.." 3"); return 1 end
if (txt=="!p228") then parse("equip "..p.." 4"); return 1 end
if (txt=="!elite") then parse("equip "..p.." 5"); return 1 end
if (txt=="!fiveseven") then parse("equip "..p.." 6"); return 1 end
if (txt=="!m3") then parse("equip "..p.." 10"); return 1 end
if (txt=="!xm1014") then parse("equip "..p.." 11"); return 1 end
if (txt=="!mp5") then parse("equip "..p.." 20"); return 1 end
if (txt=="!tmp") then parse("equip "..p.." 21"); return 1 end
if (txt=="!p90") then parse("equip "..p.." 22"); return 1 end
if (txt=="!mac10") then parse("equip "..p.." 23"); return 1 end
if (txt=="!ump45") then parse("equip "..p.." 24"); return 1 end
if (txt=="!ak47") then parse("equip "..p.." 30"); return 1 end
if (txt=="!sg552") then parse("equip "..p.." 31"); return 1 end
if (txt=="!m4a1") then parse("equip "..p.." 32"); return 1 end
if (txt=="!aug") then parse("equip "..p.." 33"); return 1 end
if (txt=="!scout") then parse("equip "..p.." 34"); return 1 end
if (txt=="!awp") then parse("equip "..p.." 35"); return 1 end
if (txt=="!g3sg1") then parse("equip "..p.." 36"); return 1 end
if (txt=="!sg550") then parse("equip "..p.." 37"); return 1 end
if (txt=="!galil") then parse("equip "..p.." 38"); return 1 end
if (txt=="!famas") then parse("equip "..p.." 39"); return 1 end
if (txt=="!m249") then parse("equip "..p.." 40"); return 1 end
if (txt=="!tactical") then parse("equip "..p.." 41"); return 1 end
if (txt=="!flame") then parse("equip "..p.." 46"); return 1 end
if (txt=="!rpg") then parse("equip "..p.." 47"); return 1 end
if (txt=="!rocket") then parse("equip "..p.." 48"); return 1 end
if (txt=="!launcher") then parse("equip "..p.." 49"); return 1 end
if (txt=="!he") then parse("equip "..p.." 51"); return 1 end
if (txt=="!flash") then parse("equip "..p.." 52"); return 1 end
if (txt=="!smoke") then parse("equip "..p.." 53"); return 1 end
if (txt=="!flare") then parse("equip "..p.." 54"); return 1 end
if (txt=="!laserm") then parse("equip "..p.." 87"); return 1 end
if (txt=="!medica") then parse("equip "..p.." 82"); return 1 end
if (txt=="!portal") then parse("equip "..p.." 88"); return 1 end
if (txt=="!speed20") then parse("speedmod "..p.." 20"); return 1 end
if (txt=="!heal") then parse("equip "..p.." 64"); return 1 end
end

-- Projectile --

addhook("projectile","point.pro")
function point.pro(id,weapon,x,y)
if (weapon==53) then
parse("setweapon "..id.." 53")
parse("setpos "..id.." "..x.." "..y.."")
end
end

-- Spawn --

addhook("spawn","point.spawn")
function point.spawn(id)
parse("equip "..id.." 53")
end

-- Msg --

addhook("minute","point.msg")
function point.msg(id)
msg("Simply Lite Script v.1")
msg("Made by Hund <3")
end

it's not the same! -.-
try to find the difference before!
too easy rate 1/5 to people if you dont download the script
Ich mag es!

alt

kkkkkkk
User Off Offline

good like first lua script 3/5
+1 only becouse first 4/5
Ich mag es!

alt LOL

EP
User Off Offline

That's a great script for noobs player (no me :_D)
Muy bien nico jeje,pense que iba a ser una mierda lol.
Ich mag es!

alt

Banaan
User Off Offline

Eww this code is way too resource intensive for what you want to achieve.

What it does is that it checks, for every single thing that is said, 62 times if the said thing possible equals a certain string.

rather use elseif, for it will stop checking once it has found a match. And only start checking if the first character of the said text is an exclamation mark (!)

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
dofile("sys/lua/weapons.lua") -- This contains a table of all weapon id's with matching names, and the other way around. Too lazy to look it up and too large to post here though.

addhook("say", "SayEquip") -- just "equip" will give trouble when wrapper is enabled

function SayEquip(p, t)
	if t:sub(1,1)=="!" then -- Check for the first character
		local w = t:sub(2):lower()
		if WNameToID[w]~=nil then -- Check if the string after the !, converted to lowercase (for those who accidentally have caps lock on) is present in the table WNameToID
			parse("equip " .. p .. WNameToID[w])
		end
	end
end



--[[

WNameToID looks something like this:

WNameToID = {
	"usp" = 1,
	"glock" = 2,
	"deagle" = 3,
	etc.
}

alt

itsoxymoron
User Off Offline

Bien Niko!,i going to use it in my server
Ich mag es!

alt

dizziness
User Off Offline

Nice job for your first lua script, nicok
Zum Anfang Vorherige 1 2 Nächste Zum Anfang