Post by fartarjaya on Oct 12, 2014 17:47:35 GMT 5.5
1.hud scripts
2. Public Lua
3. say Hook Menu ...
4.Shop Lua..
5. Super Hero Mode...
--[[
Hudscript example by Fartarjaya
]]--
addhook("move" , "tm")
function tm(id)
parse('hudtxt2 '..id..' 0 "©255000000Player name: '..player(id,"name")..'" 16 116 0') -- Показать имя игрока
parse('hudtxt2 '..id..' 1 "©255000000X Tile: '..player(id,"tilex")..'" 16 148 0') -- Координаты игрока по тайлу (Х)
parse('hudtxt2 '..id..' 2 "©255000000Y Tile: '..player(id,"tiley")..'" 16 164 0') -- Координаты игрока по тайлу (Y)
parse('hudtxt2 '..id..' 3 "©255000000Health: '..player(id,"health")..'" 16 196 0') -- Здоровье игрока
parse('hudtxt2 '..id..' 4 "©255000000SpeedMod: '..player(id,"speedmod")..'" 16 212 0') -- Скорость
end
addhook("attack" , "sy")
function sy(id)
parse('hudtxt2 '..id..' 5 "©255255255Score: '..player(id,"score")..'" 225 455 0')
parse('hudtxt2 '..id..' 6 "©255255255Team: '..player(id,"team")..'" 305 455 0')
end
addhook("spawn" , "spa")
function spa()
parse('hudtxt2 '..id..' 0 "©255000000Player name: '..player(id,"name")..'" 16 116 0')
parse('hudtxt2 '..id..' 1 "©255000000X Tile: '..player(id,"tilex")..'" 16 148 0')
parse('hudtxt2 '..id..' 2 "©255000000Y Tile: '..player(id,"tiley")..'" 16 164 0')
parse('hudtxt2 '..id..' 3 "©255000000Health: '..player(id,"health")..'" 16 196 0')
parse('hudtxt2 '..id..' 4 "©255000000SpeedMod: '..player(id,"speedmod")..'" 16 212 0')
parse('hudtxt2 '..id..' 5 "©255255255Score: '..player(id,"score")..'" 225 455 0')
parse('hudtxt2 '..id..' 6 "©255255255Team: '..player(id,"team")..'" 305 455 0')
end
2. Public Lua
--[[
Public example by Fartarjaya
]]--
addhook("join" , "join_1") -- Добавляем хук
function join_1(id) -- Присваиваем функцию "join_1" к хуку "join"
msg2(id,©255255255# # # # # # # # #")
msg2(id,"©000255000Welcome "..player(id,"name").." to our server!")
msg2(id,"©000255000It is Public Server - Have Fun, Guy!!!")
msg2(id,"©255255255# # # # # # # # #")
end
addhook("startround" , "start")
function start()
parse("sv_sound \"fun/prepare.wav\"")
msg("©000255000Prepare to Fight!@C")
msg("©255000000T wins: "..game("score_t").."@C")
msg("©000000255CT wins: "..game("score_ct").."@C")
end
addhook("bombplant" , "bomb")
function bomb(id)
msg("©255255255# # # # # # # # #")
msg("©255255255"..player(id,"name").." plant the bomb!")
msg("©255255255# # # # # # # # #")
freeimage(id)
id1=image("gfx/sprites/wave.bmp",1,1,200+id)
imagecolor(id1,255,0,0)
end
addhook("kill" , "kill_1")
function kill_1(killer,victim)
msg("©255000000"..player(killer,"name").." kill "..player(victim,"name"))
parse("sv_sound \"player/die1.wav\"")
end
addhook("bombexplode" , "bombex")
function bombex(id)
msg("©255255255# # # # # # # # #")
msg("©000255255BOMB EXPLODE!")
msg("©000255255"..player(id,"name").." get 16000$")
msg("©255255255# # # # # # # # #")
parse("setmoney "..id.." 16000")
end
addhook("endround" , "er")
function er()
parse("sv_sound \"fun/thats_the_way.wav\"")
end
3. say Hook Menu ...
--[[
Sayhook example by Fartarjaya
]]--
addhook("say" , "say_1")
function say_1(id,message)
if (message=="!lazer") then parse("equip "..id.." 45") -- Если набран текст "!lazer", то получить лазер ;)
end
if (message=="!heal") then parse("sethealth"..id.." 100") -- Если набран текст "!heal", то вылечится до 100 HP
end
if (message=="!mypos") then msg2(id,"©255255255X:"..player(id,"tilex").." | Y:"..player(id,"tiley")) -- Если набран текст "!mypos", то показать свои координаты по тайлам
end
if (message=="!image") then -- Если набран текст "!image", то...
freeimage(id)
id=image("gfx/flare3.bmp",1,1,200+id) -- ...наложить картинку на игрока
imagealpha(id,0.5)
imageblend(id,1)
end
end
4.Shop Lua..
--[[
Shop example by Fartarjaya
]]--
addhook("serveraction" , "sa")
function sa(id,action)
if action==1 then
menu(id,"Main Menu,Buy weapon,Buy Equipment")
end
end
addhook("menu" , "menu_1")
function menu_1(id, title, button)
if (title=="Main Menu") then
if button==1 then
menu(id,"Buy weapon,Deagle|650$,M3|1700$,AK47|2500$")
end
if button==2 then
menu(id,"Buy Equipment,Medikit|300$,Kevlar|650$")
end
end
if (title=="Buy weapon") then
if button==1 then
if (player(id,"money")>=650) then
parse("equip "..id.." 3 ")
parse("setmoney "..id.." "..player(id,"money")-650)
parse("setweapon "..id.." 3 ")
msg2(id,"©000255000You buy a Desert Eagle for 650$ !!!")
else
msg2(id,"©000255000Not enough money !")
end
end
if button==2 then
if (player(id,"money")>=1700) then
parse("equip "..id.." 10 ")
parse("setmoney "..id.." "..player(id,"money")-1700)
parse("setweapon "..id.." 10 ")
msg2(id,"©000255000You buy a M3 for 1700$ !!!")
else
msg2(id,"©000255000Not enough money !")
end
end
if button==3 then
if (player(id,"money")>=2500) then
parse("equip "..id.." 30 ")
parse("setmoney "..id.." "..player(id,"money")-2500)
parse("setweapon "..id.." 30 ")
msg2(id,"©000255000You buy a AK-47 for 2500$ !!!")
else
msg2(id,"©000255000Not enough money !")
end
end
end
if (title=="Buy Equipment") then
if button==1 then
if (player(id,"money")>=300) then
parse("equip "..id.." 64 ")
parse("setmoney "..id.." "..player(id,"money")-300)
msg2(id,"©000255000You buy a Medikit for 300$ !!!")
else
msg2(id,"©000255000Not enough money !")
end
end
if button==2 then
if (player(id,"money")>=650) then
parse("equip "..id.." 57 ")
parse("setmoney "..id.." "..player(id,"money")-650)
msg2(id,"©000255000You buy a Kevlar for 650$ !!!")
else
msg2(id,"©000255000Not enough money !")
end
end
end
end
5. Super Hero Mode...
--[[
SuperHero Mod example by Fartarjaya
]]--
addhook("menu" , "speed1") -- Добавляем хук
function speed1(id, title, button) -- Присваиваем функцию "speed1" к хуку "menu"
if (title=="SpeedMod menu") then
if button==1 then -- Если нажата 1 кнопка, то...
parse("speedmod "..id.." 0") -- Изменить скорость игрока (0-стандарт)
end -- Закрываем оператор if
if button==2 then
parse("speedmod "..id.." 15")
end
if button==3 then
parse("speedmod "..id.." 25")
end
if button==4 then
parse("speedmod "..id.." 50")
end
if button==5 then
parse("speedmod "..id.." 100")
end
end
end -- Закрываем функцию speed1
addhook("serveraction" , "f2")
function f2(id,action)
menu(id,"SpeedMod menu,0|Standart,15|Very Low,25|Normal,50|Fast,100|Very Fast") -- Создаём меню
end -- Закрываем функцию "f2"
addhook("serveraction" , "f3")
function f3(id,action)
if action==2 then
parse("equip "..id.." 45")
parse("equip "..id.." 47")
parse("equip "..id.." 46")
parse("equip "..id.." 88")
parse("equip "..id.." 83")
parse("equip "..id.." 41")
msg2(id,"©255255255HeroWeapons picked!")
end
end
addhook("team" , "tm_1")
function tm_1(id,team)
freeimage(id)
id=image("gfx/hud_arrow.bmp",1,1,200+id)
imagealpha(id1,0.6)
if team==1 then -- Если игрок играет за террористов, то...
imagecolor(id,255,0,0) -- ...поменять цвет на красный
else -- Иначе...
imagecolor(id,0,0,255) -- ...игрок играет за мусоров и поменять цвет на синий
end
end