AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Spawn Protection (https://forums.alliedmods.net/showthread.php?t=1886)

Peli 05-11-2004 20:50

Spawn Protection
 
3 Attachment(s)
NEWS
*6 December 2005* Re-Releasing Version 7.0
*4 December 2005* Thanks to VEN and Avalanche, the plugin should work fine now.
*28 December 2005* Thanks to Podunk there is a new cvar for controlling shell thickness.
*16 April 06* Thanks to SubStream for testing, the plugin now works.

TO-DO LIST
  • (Public Testing) Adding a new feature: Players can select what color they would like to glow during Spawn Protection Time. :)

PLUGIN STATUS
Version 7.0 Compiles fine, Tested - works fine.

PLUGIN
Code:

 
  CREDITS :
      Thanks to Xeroblood, JJkiller, KingPin for helping me make
      this plugin and Firestorm for helping adding a lot of things

  INSTALLING :
      Download .SMA to Scripting folder, run compiler, copy the
      file from Compiled folder and paste in Plugins folder, add the plugin name
      in the Amxx plugins.ini ie : spawnprotection.amxx

  DESCRIPTION :
      Protects players when the spawn from being killed

  CHANGELOG :
      Version 1.0 - First Release
      Version 2.0 - Fixed godmode cvar problems
      Version 3.0 - Added message time control cvar
      Version 4.0 - Fixed errors
      Version 5.0 - Added message control cvar
      Version 6.0 - Fixed errors - THANKS VEN!
      Version 7.0 - Cleaned up plugin and fixed errors - THANKS
                          AVALANCHE, VEN and SubStream
      Version 8.0 - Testing


kingpin 05-11-2004 21:07

GJ Peli :) hope to see more of the same good work from you. will test it out in about ten minutes.

Peli 05-11-2004 21:11

Thanks. A couple bugs with the cvar but it works when you set it to 1. I'll try to add more fun stuff if possible to newer versions in the future. :)

QwertyAccess 05-11-2004 21:44

:roll: Great Job 8)

Fireace22 05-11-2004 22:20

looks great, would it be possible to make it 5 seconds tho?

Peli 05-11-2004 22:42

Yes , open the .sma and change this :
Code:
set_task(10.0,"god_off")
To :
Code:
set_task(5.0,"god_off")
You can change it to whatever number you want as long as you add .0 to the end save the file and your done. :)

Fireace22 05-11-2004 22:47

ok sweet, thnx :D

devicenull 05-11-2004 23:28

Suggestion:
Change that number in there to a #define
so do this
#define GOD_TIME 5.0
...
set_task(GOD_TIME,"god_off")
This way you can put the define at the top, and not have to dig through code ;)

Peli 05-11-2004 23:29

Thank you I will edit that.

Ingram 05-11-2004 23:57

Code:

set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, GOD_TIME, 0.5, 1.5, 4 )
there too, but i'm sure u already did that

gj

Nick 05-12-2004 02:48

Does the spawn plugin work on all maps?
and by the way great job on your first plugin :)

Peli 05-12-2004 17:11

Yea it works on all maps I think , and thanks Nick. :)

Nick 05-12-2004 20:49

Cool Im for sure going to have your plugin on my server :)
I hope this gets approved

Peli 05-12-2004 20:50

Hehe , thank you for supporting my plugin. :)

Nick 05-12-2004 20:52

Any plans for another plugin Peli?

Peli 05-12-2004 20:53

Yes , very good idea I know everyone will like it too. It will take hard work and for me to go to a new level of scripting but I'm willing to do it. :)

Nick 05-12-2004 20:55

whats it going to be?

Peli 05-12-2004 20:58

Will let people bind a key to a command where they press it when they are in danger and the glow blocks the damage for a little amount of time. :)

Nick 05-12-2004 21:00

wow cool, I hope you get it done, Have you already started?

Peli 05-12-2004 21:01

Yea but I need a little help on some stuff so I'm asking a couple of people.

Nick 05-12-2004 21:03

Alright good luck man

kingpin 05-12-2004 22:05

a point of reference is from warcraft III FT oneof the hero's has onkey godmode for X seconds and adding glow to that shouldnt be hard :)

Fireace22 05-12-2004 22:10

how do u edit sma files... :( bc i cant just open it in notepad like a ini.... could u tell me how or just make another 1 with 5 seconds and post it <3

Peli 05-12-2004 22:29

Click open instead of save when you are downloading the sma.

Fireace22 05-12-2004 22:56

u guys r to smart for fire :oops:

Peli 05-12-2004 23:59

Look , I am not smarter than you. Just go to the plugin you want to edit from the Plugins section. Now once your in that plugins topic , scroll down to the attachment and click on "DOWNLOAD SMA" and click OPEN instead of SAVE. Then it will open the sma and you can edit it and save it.

Fireace22 05-13-2004 02:08

Quote:

Originally Posted by Peli
Look , I am not smarter than you. Just go to the plugin you want to edit from the Plugins section. Now once your in that plugins topic , scroll down to the attachment and click on "DOWNLOAD SMA" and click OPEN instead of SAVE. Then it will open the sma and you can edit it and save it.

lol u could of just said thnx, np :lol:

kingpin 05-13-2004 07:31

I use Scite for all my text editing needs. i.e. cfg sma ini etc. since this shows the text in the right context etc.

McD 05-14-2004 08:37

Nice! :wink:

Fireace22 05-14-2004 08:57

L 05/14/2004 - 04:50:51: [AMXX] Run time error 22 on line 0 (plugin "spawnprotection.amx")

and here is the code... im guessing i screwed it up when trying to make it 5 seconds


Code:

/*    Credits : Thanks to Xeroblood , JJkiller and KingPin for helping
*  making this plugin.
*
*      Installing : Download .SMA to Scripting folder , run compiler , copy the
*  file from Compiled folder and paste in Plugins folder , add the plugin name
*  in the Amxx plugins.ini ie) : spawnprotection.amx.
*
*      Use : After you install it , join the game and type this in the console :
*  Amx_god 1 and a message like this , "SPAWN PROTECTION IS ENABLED" will
*  appear in read in the middle of the screen for ten seconds giving all
*  players godmode.
*/

#define GOD_TIME 5.0
#include <amxmodx>
#include <fun>


public plugin_init()
{
    register_plugin("Spawn Protection","0.1","Peli")
    register_cvar("amx_god","1")
    register_event("ResetHUD","god_on","b")
}
public god_on()
{
    if (!(get_cvar_num("amx_god") == 1))
        return PLUGIN_HANDLED
       
    new players[32], numberofplayers
    get_players(players,numberofplayers)
    for (new i=1;i<=numberofplayers;i++)
        set_user_godmode(i,1)
     
    set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0, 0.5, 1.5, 4 )
    show_hudmessage(0, "SPAWN PROTECTION IS ENABLED")
   
    set_task(5.0,"god_off")
    return PLUGIN_HANDLED
}

public god_off(id)
{
    new players[32], numberofplayers
    get_players(players,numberofplayers)
    for (new i=1;i<=numberofplayers;i++)
        set_user_godmode(i,0)
    return PLUGIN_CONTINUE
}


kingpin 05-14-2004 09:03

the define has to be incorporated into the code to so the server knows what "#define GOD_TIME" is. just use the
Code:
set_task(5.0,"god_off")
for now then either peli can throw in the define or if peli wants I will throw in a cvar like amx_godtime or something.

Fireace22 05-14-2004 09:06

alright i wil take off the define and try it

still nothing, and nothing is even showing up in logs now

kingpin 05-14-2004 09:36

so ur plugin just stoped working altogather now?

Fireace22 05-14-2004 09:44

o here a log showed up lol

L 05/14/2004 - 07:08:56: [AMXX] Run time error 22 on line 0 (plugin "spawnprotection.amx")

still the same thing :evil:

kingpin 05-14-2004 09:51

well sorry but i gotta goto work so will look back later guess u gotta use the 10 secs from peli for now, im sure hell check in later and help u out too :)

Fireace22 05-14-2004 09:53

hehe ok the 10 seconds it is :D

Ingram 05-14-2004 16:11

try without using the #define altogether, leave the set_task line, but change

Code:

set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0, 0.5, 1.5, 4 )
to
Code:

set_hudmessage( 255, 0, 0, -1.0, -1.0, 0, 6.0, 5.0, 0.5, 1.5, 4 )
That will change the amount of time the message shows for, otherwise u will think spawn protection is on for 10 seconds, while it really isn't

Fireace22 05-14-2004 19:25

and then change the 10.0 god off to 5.0

right?

Ingram 05-14-2004 19:32

yeah, i thought u already changed that

Ingram 05-14-2004 19:33

peli, hows that new plugin coming?


All times are GMT -4. The time now is 10:10.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.