Created
May 2, 2012 05:18
-
-
Save FloooD/2574024 to your computer and use it in GitHub Desktop.
unreleased cs2d scripts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-------------------------------- | |
--2DDM - port of CSDM by FlooD-- | |
-------------------------------- | |
parse("sv_gamemode 2") | |
parse("mp_infammo 1") | |
parse("mp_freezetime 0") | |
dm_preset={} | |
dm_preset[1]="2DDM: Equip,New Weapons,Previous Setup,2+Don't show menu again" | |
dm_preset[2]="2DDM: Secondary Weapons,USP,Glock,Deagle,P228,Elite,Five Seven" | |
dm_preset[3]="2DDM: Primary Weapons 1/3,M4A1,AK47,AUG,SG552,Galil,Famas,Scout,,More" | |
dm_preset[4]="2DDM: Primary Weapons 2/3,AWP,SG550,M249,G3SG1,UMP 45,MP5 Navy,M3,Back,More" | |
dm_preset[5]="2DDM: Primary Weapons 3/3,XM1014,TMP,Mac 10,P90,,,,Back," | |
dm_toid={} | |
dm_toid[3]={32,30,33,31,38,39,34} | |
dm_toid[4]={35,37,40,36,24,20,10} | |
dm_toid[5]={11,21,23,22} | |
dm_disabled={} -- 0-equip menu enabled, 1-equip menu disabled | |
dm_prev={} | |
for i=1,32 do | |
dm_disabled[i]=0 | |
dm_prev[i]={0,0} | |
end | |
function dm_equipprev(id) | |
if dm_prev[id][1]>0 then | |
parse("equip "..id.." "..dm_prev[id][1]) | |
end | |
if dm_prev[id][2]>0 then | |
parse("equip "..id.." "..dm_prev[id][2]) | |
end | |
end | |
addhook("buy","dm_buy") | |
addhook("leave","dm_leave") | |
addhook("spawn","dm_spawn") | |
addhook("say","dm_say") | |
addhook("menu","dm_menu") | |
addhook("drop","dm_drop") | |
function dm_buy(id,wpn) | |
return 1 | |
end | |
function dm_leave(id) | |
dm_disabled[id]=0 | |
dm_prev[id]={0,0} | |
end | |
function dm_spawn(id) | |
parse("strip "..id) | |
if dm_disabled[id]==0 then | |
menu(id,dm_preset[1]) | |
else | |
dm_equipprev(id) | |
end | |
end | |
function dm_say(id,text) | |
if text=="guns" then | |
if dm_disabled[id]==1 then | |
msg2(id,"[2DDM] Your equip menu has been re-enabled.") | |
dm_disabled[id]=0 | |
menu(id,dm_preset[type]) | |
else | |
msg2(id,"[2DDM] Your equip menu is already enabled.") | |
end | |
end | |
end | |
function dm_drop(id,iid) | |
timer(0,"parse","removeitem "..iid) | |
end | |
function dm_menu(id,title,button) | |
if title=="2DDM: Equip" then | |
if button==1 then | |
menu(id,dm_preset[2]) | |
elseif button==2 then | |
dm_equipprev(id) | |
elseif button==3 then | |
dm_equipprev(id) | |
msg2(id,'[2DDM] Type "guns" in chat to re-enable your equip menu') | |
dm_disabled[id]=1 | |
elseif button==0 then | |
menu(id,dm_preset[1]) | |
end | |
elseif title=="2DDM: Secondary Weapons" then | |
if button>0 then | |
parse("equip "..id.." "..button) | |
dm_prev[id][1]=button | |
menu(id,dm_preset[3]) | |
else | |
parse("equip "..id.." 1") | |
dm_prev[id][1]=1 | |
end | |
elseif title=="2DDM: Primary Weapons 1/3" then | |
wpn=dm_toid[3][button] | |
if wpn then | |
parse("equip "..id.." "..wpn) | |
dm_prev[id][2]=wpn | |
elseif button==9 then | |
menu(id,dm_preset[4]) | |
elseif button==0 then | |
dm_prev[id][2]=0 | |
end | |
elseif title=="2DDM: Primary Weapons 2/3" then | |
wpn=dm_toid[4][button] | |
if wpn then | |
parse("equip "..id.." "..wpn) | |
dm_prev[id][2]=wpn | |
elseif button==8 then | |
menu(id,dm_preset[3]) | |
elseif button==9 then | |
menu(id,dm_preset[5]) | |
elseif button==0 then | |
dm_prev[id][2]=0 | |
end | |
elseif title=="2DDM: Primary Weapons 3/3" then | |
wpn=dm_toid[5][button] | |
if wpn then | |
parse("equip "..id.." "..wpn) | |
dm_prev[id][2]=wpn | |
elseif button==8 then | |
menu(id,dm_preset[4]) | |
elseif button==0 then | |
dm_prev[id][2]=0 | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--keeps at least one player in server | |
parse("bot_remove_all") | |
parse("bot_add") | |
addhook("join", "autobot_join") | |
function autobot_join() | |
if #player(0,"table") == 3 then | |
timer(30, "parse", "bot_remove") | |
end | |
end | |
addhook("leave","autobot_leave") | |
function autobot_leave() | |
if #player(0, "table") == 2 then | |
parse("bot_remove") | |
parse("bot_add") | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--emulates cs2d 0104's diagonal strafe bug | |
--credits to NasH for original idea and script. | |
px = {} | |
py = {} | |
addhook("spawn", "diag_spawn") | |
function diag_spawn(id) | |
px[id] = player(id, "x") | |
py[id] = player(id, "y") | |
end | |
addhook("move", "diag_move") | |
function diag_move(id) | |
local x, y = player(id, "x"), player(id, "y") | |
if x == px[id] or y == py[id] then | |
parse("speedmod "..id.." -2") | |
else | |
parse("speedmod "..id.." 9") | |
end | |
px[id], py[id] = x, y | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment