Advertisement
Guest User

CS2D: Forced lighting via Lua

a guest
Sep 15th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.45 KB | None | 0 0
  1. -- check every second
  2. -- if living player has enabled lighting then make him spectator
  3. -- sample by useigor
  4.  
  5. addhook("second","secunda")
  6. function secunda()
  7.     for _,id in pairs(player(0,"tableliving")) do
  8.         reqcld(id,3)
  9.     end
  10. end
  11.  
  12. addhook("clientdata","dataclienta")
  13. function dataclienta(id,mode,d1,d2)
  14.     if mode==3 then
  15.         if d1==1 then
  16.             parse("makespec "..id)
  17.             msg2(id,player(id,"name")..", please, disable your lighting!")
  18.         end
  19.     end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement