Forum

> > CS2D > Scripts > Punish Mod
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Punish Mod

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Punish Mod

sheeL
User Spielt CS2D

Zitieren
Hello, I wanted a little help with a simple script
that makes me a headache o.
I do know the moon
but with hook bothering me
I usually use program
but the net is bad aki
a little help here

1
2
3
4
5
6
addhook("say","punish")
function speed(id,env)

if (env=="!punish 1") then
parse("speedmod 1 0")
end

qual meu erro?

(I'm not noob, and not since "yesterday", I am even complicated xD)

Sorry my inglissh"

alt Re: Punish Mod

DarkLight66
User Off Offline

Zitieren
I guess you translated from portuguese since LUA means moon in portuguese...

ontopic:

1
2
3
4
5
6
addhook("say","punish")
function speed(id,env)
	if (env=="!punish 1") then
		parse("speedmod 1 0")
	end
end -- You needed to add an extra end

That would only work if you want to "punish" the guy with id 1 tought...

alt Re: Punish Mod

SilentDash
User Off Offline

Zitieren
hook name and function name must be the same. like this
1
2
3
4
5
6
addhook("say","punish")
function punish(id,env)

if (env=="!punish 1") then
parse("speedmod 1 0")
end

alt Hehehe

EP
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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

addhook("say","lol")
function lol(id,txt)
local p = totable(txt)
local cmd = tostring(p[1]) --Make !punish a real command :D
if player(id,"team") == 2 then --Counter Terrorist
if cmd == "!punish" then --Command
local pl = tonumber(p[2]) --The id of the player
parse("speedmod "..pl.." -100")
return 1
end
end
end
How to use it: You have to write the command and the ID of the punished player, example : !punish 1 (It will punish the id 1, you must be CT to use this command) < (You can change the CT for T :D, Just change the 2 for the 1 in this Line --if player(id,"team") == 2 then--
2× editiert, zuletzt 06.12.11 00:48:41
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht