Forum
CS2D Scripts Script Addhook and FunctionScript Addhook and Function
10 replies 1
http://www.cs2d.com/help.php
Admin/mod comment
§2.1 - No needless and/or doubled posts (spam) - only post stuff that is necessary/helpful. Thanks /DCThere are several hooks. Check this page for it: http://www.cs2d.com/help.php?hookcat=all
Let's start with an easy.
1
2
2
addhook("spawn","_spawn") function _spawn(id)
addhook --add a hook to the game.
spawn --Hook name
_spawn --function name of our hook
Here is an example with spawn hook
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
addhook("spawn","_spawn") function _spawn(id) 	if player(id,"team") == 1 then --If the spawned player team is Terrorists 		parse("equip "..id.." 30")	 --He/she get Ak-47 	elseif player(id,"team") == 2 then --If the spawned player team is Counter Terrorist 		parse("equip "..id.." 32") --He/She get M4A1 	end --Close the first if. end --Close the function.
I might helped, might not.
lua-users.org/wiki/LuaTutorial
http://www.unrealsoftware.de/forum_posts.php?post=226033
if you need help with hooks
http://www.cs2d.com/help.php?hookcat=all
1
2
3
4
2
3
4
addhook("HookName","HookFunction") function HookFunction (value) ... end -- Function
Look this example :
1
2
3
4
5
6
2
3
4
5
6
addhook("serveraction","MyAction") function MyAction(id,ActionButton) if ActionButton == 1 then -- F2 msg2(id,"Your Message Here") -- Your Message when you press F2 end -- close function end -- close if
other example
1
2
3
4
5
6
7
2
3
4
5
6
7
addhook("say","_say') function _say(id,text) if text == "MyText" then -- Text msg2(id,"Your Message") return 1 -- don't appears in chat - return 0 appears end -- close function end -- close if
if you need help or other examples, send PM to me
#45813
edited 1×, last 10.12.12 12:48:22 am
Shawni has written
@ Jynxxx : This is just your fault, never expect something good(helpful) from Brazilian kids
@ Shawni:
I do it my way, @ Shawni: nobody called you in the conversation, all Algerians are less well than in brazil recognized.
P.S = i am not a child, you say
teens ...
@ Suprise: sorry, i'll use the next time, not like much ...
There are only 2Algerian users here ( am inculded )
Admin/mod comment
§4.5 - Stick to the point! No off-topic posts! 1