Author Topic: Anti-Chimney Spam  (Read 8207 times)

0 Members and 1 Guest are viewing this topic.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Anti-Chimney Spam
« on: November 26, 2005, 11:13:48 PM »
This plugin does not use ULX. (Don't see why we cant put normal scripts here too)

I was just practicing lua (gotten quite good now) and this is the result:

A script that:
  • Announces whomever spawns a chimney in red (center of screen)
  • Returns player to spawn (and notifies them)
  • Plays alarm sound
  • Blocks the spawning of the chimney

Copy and paste into a LUA file and put in gmod9/lua.
Type lua_openscript (nameoffile).lua and your set.

Code: [Select]
function eventPlayerSpawnProp(userid,propspa)
if propspa == "models/props_animated_breakable/Smokestack.mdl" then
_PluginMsg(userid, "You have been returned to the spawnpoint","lol",10,255,0,0,255,10);
_ScreenText(0, _PlayerInfo(userid, "name") .. " tried to spawn a chimney!",  -1,0.2,   255,0,0,255,  1,3, 6, 0, 1);
_PlayerRespawn(userid)
_EntEmitSound(userid,"ambient/alarms/klaxon1.wav")
_EntEmitSound(userid,"ambient/alarms/klaxon1.wav")
CONCOMMAND("chimney_script", GDsay);
return false;
else
return true;
end
end

function GDsay(userid)
_ScreenText(0, "Chimney Script by Golden-Death",  -1,0.2,   0,0,255,255,  1,3, 6, 0, 1);
end

How you can help:

Please tell me if you can verify that the red text that announces the player who spawned the chimney properly names the player, and shows up on every ones screens

Bugs/To Do:
Find a way to temporarily disable, in the offchance anyone really must have a chimney.




Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Anti-Chimney Spam
« Reply #1 on: November 27, 2005, 06:54:23 AM »
Code: [Select]
function eventPlayerSpawnProp(userid,propspa)
if propspa == "models/props_animated_breakable/Smokestack.mdl" then
_PluginMsg(userid, "You have been returned to the spawnpoint","lol",10,255,0,0,255,10);
_ScreenText(0, _PlayerInfo(userid, "name") .. " tried to spawn a chimney!",  -1,0.2,   255,0,0,255,  1,3, 6, 0, 1);
_PlayerRespawn(userid)
_EntEmitSound(userid,"ambient/alarms/klaxon1.wav")
_EntEmitSound(userid,"ambient/alarms/klaxon1.wav")
if ULX_CONCOMMAND ~= nil then
ULX_CONCOMMAND("chimney_script", GDsay);
else
CONCOMMAND("chimney_script", GDsay);
end
return false;
else
return true;
end
end

function GDsay(userid)
_ScreenText(0, "Chimney Script by Golden-Death",  -1,0.2,   0,0,255,255,  1,3, 6, 0, 1);
end

Improved  ;)
Experiencing God's grace one day at a time.

Offline Golden-Death

  • Hero Member
  • *****
  • Posts: 751
  • Karma: 0
  • Honored Lua Scripter
    • BlueFire
Re: Anti-Chimney Spam
« Reply #2 on: December 03, 2005, 07:33:09 PM »


Offline darkdeath

  • Jr. Member
  • **
  • Posts: 55
  • Karma: 2
Re: Anti-Chimney Spam
« Reply #3 on: February 08, 2006, 07:53:00 AM »
how can i make it also for the containers ? ...
becouse if i do that and do exacly the same but then the other mdl's it wont work :(...
so plz can u help me... ? ::)

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6213
  • Karma: 394
  • Project Lead
Re: Anti-Chimney Spam
« Reply #4 on: February 08, 2006, 02:11:56 PM »
This plugin was made obsolete by ULX's prop limiter
Experiencing God's grace one day at a time.