Forum

> > CS2D > General > Tutorials
Forums overviewCS2D overviewGeneral overviewLog in to reply

English Tutorials

5 replies
To the start Previous 1 Next To the start

old Tutorials

HiddenSuprise
User Off Offline

Quote
I learn to write scripts.
Is anyone able to help me with this?

-I do not understand the type addhook for example this--

if luax==nil then luax={} end
luax.f={}

--Addhook-->>
addhook("say","luax.f.say") --say hook
addhook("sayteam","luax.f.sayteam") --sayteam hook
addhook("join","luax.f.join") --join hook
addhook("leave","luax.f.leave") --leave hook
addhook("ms100","luax.f.ms100") --100 millisecond hook
addhook("second","luax.f.second") --second hook
addhook("minute","luax.f.minute") --minute hook
addhook("always","luax.f.always") --always hook
addhook("team","luax.f.team") --team hook
addhook("spawn","luax.f.spawn") --spawn hook
addhook("startround","luax.f.startround") --startround hook
addhook("endround","luax.f.endround") --enround hook
addhook("name","luax.f.name") --name hook
addhook("mapchange","luax.f.mapchange") --mapchange hook
addhook("parse","luax.f.parse") --parse hook
addhook("serveraction","luax.f.serveraction") --serveraction hook
addhook("trigger","luax.f.trigger") --trigger hook
addhook("triggerentity","luax.f.triggerentity") --triggerentity hook
addhook("buy","luax.f.buy") --buy hook
addhook("walkover","luax.f.walkover") --walkover hook
addhook("collect","luax.f.collect") --collect hook
addhook("drop","luax.f.drop") --drop hook
addhook("select","luax.f.select") --select hook
addhook("reload","luax.f.reload") --reload hook
addhook("attack","luax.f.attack") --attack hook
addhook("attack2","luax.f.attack2") --attack2 hook
addhook("projectile","luax.f.projectile") --projectile hook
addhook("move","luax.f.move") --move hook
addhook("hit","luax.f.hit") --hit hook
addhook("kill","luax.f.kill") --kill hook
addhook("die","luax.f.die") --die hook
addhook("use","luax.f.use") --use hook
addhook("radio","luax.f.radio") --radio hook
addhook("spray","luax.f.spray") --spray hook
addhook("vote","luax.f.vote") --vote hook
addhook("buildattempt","luax.f.buildattempt") --buildattempt hook
addhook("build","luax.f.build") --build hook
addhook("menu","luax.f.menu") --menu hook
addhook("log","luax.f.log") --log hook

old Re: Tutorials

ohaz
User Off Offline

Quote
addhook adds a function for an event.
Quote
addhook("say","luax.f.say") --say hook

this line tells CS2D to run the function luax.f.say when someone says something.
To learn lua you can use my (not finished) tutorial:
LuaTut (*click me*)

old Re: Tutorials

neriuxa32
User Off Offline

Quote
Umm... Can anyone teach me to script? I want a time script if its posible

old Re: Tutorials

CmDark
User Off Offline

Quote
lol my script just adds all hooks
so when you wanna add that function
you can just do it

adding all those hooks don't affect anything

so you can cancel off them if you dun want it
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview