Raised This Month: $51 Target: $400
 12% 

AMX LightningAdmins


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands        Approver:   twistedeuphoria (82)
CubicVirtuoso
Senior Member
Join Date: Sep 2004
Location: Canada
Old 08-12-2005 , 18:36   AMX LightningAdmins
Reply With Quote #1

AMX_LightningAdmin a requested admin announcing plugin

By: CubicVirtuoso
August 2005

Requested by: warlock

Warlock wanted a plugin that would load a custom admin list full of steamids and annouce when that player joined the server. Also he wanted it so that when they joined the server (or spawned in a round of CS) they would get struck by lightning much like the effect in my own plugin PopeLightning. So I decided to help him out since I already had half of it written.

Create a txt file in your configs folder called adminslist.txt Each line in adminslist.txt should be a SteamID useing ";" comments out lines so they are ignored by the plugin

This plugin uses my popelightning effects so you can check them out by checking out the pope lightning screenshots:

Screenshots

Enjoy!

Note: I could potentially fix up the plugin so it reads your users.ini instead of another text file. If enough people want me to do this then I will. However I was just following the rules set out by the requester.

Suggestions Comments welcome

NOTE NOTE: I need someone to test if this works on CS Round restarts. I have tested it on other mods but not CS. Someone please tell me if it does the same effect in CS when the round restarts. Thanks.

Code:
#include <amxmodx> // Amx mod include definitions #include <fun> // Fun Module #include <amxmisc> // Useful functions #include <engine> // Engine Plugin new PLUGIN[]="LightningAdmin" new AUTHOR[]="CubicVirtuoso" new VERSION[]="1.02"

UPDATE Version 1.02: Fixed for reset round
Attached Files
File Type: sma Get Plugin or Get Source (amx_lightningadmins.sma - 3094 views - 7.3 KB)
__________________
Sig Under Construction.
CubicVirtuoso is offline
Send a message via ICQ to CubicVirtuoso Send a message via AIM to CubicVirtuoso Send a message via MSN to CubicVirtuoso Send a message via Yahoo to CubicVirtuoso
Bento
SourceMod Donor
Join Date: May 2005
Location: The Netherlands
Old 08-12-2005 , 19:26  
Reply With Quote #2

Please post

Code:
    precache_sound("ambience/sparks.wav") // Sparks sound for lightning     precache_sound("ambience/port_suckin1.wav") // Thunder     SpriteSmoke = precache_model("sprites/steam1.spr") // Smoke sprite     SpriteLightning = precache_model("sprites/lgtning.spr") // Lightning sprite     precache_model("sprites/xspark2.spr") // Spark sprite

those sprites and sounds


[EDIT] the plugin isnt working...
__________________
Bento is offline
warlock
Senior Member
Join Date: Jan 2005
Old 08-12-2005 , 20:53  
Reply With Quote #3

Meh, its not working? Im gonna test it anyways, brb with edit;
and btw, thanks for even doing/trying todo it, means alot!
__________________
Kind regards,
warlock
warlock is offline
warlock
Senior Member
Join Date: Jan 2005
Old 08-12-2005 , 20:59  
Reply With Quote #4

Nope, this is not working
__________________
Kind regards,
warlock
warlock is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-12-2005 , 21:01  
Reply With Quote #5

I'm pretty sure this won't work. You do the lightning effects immediately on client_putinserver. That's when they can see the MOTD. Other than that this looks amazing

If you can fix that, karma++ (unless I'm wrong, and you can post and laugh at me)
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
warlock
Senior Member
Join Date: Jan 2005
Old 08-12-2005 , 21:55  
Reply With Quote #6

Hawk, then you fix it?
__________________
Kind regards,
warlock
warlock is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-12-2005 , 22:00  
Reply With Quote #7

Umm... I'm not sure... if the delay is the only problem, and the text when people joins works, then try this:

Code:
/* AMX_LightningAdmin      a requested admin announcing plugin          By: CubicVirtuoso    August 2005          Requested by: warlock        Warlock wanted a plugin that would load a custom admin list full of steamids and annouce when that player    joined the server. Also he wanted it so that when they joined the server (or spawned in a round of CS) they    would get struck by lightning much like the effect in my own plugin PopeLightning. So I decided to help him    out since I already had half of it written.        Create a txt file in your configs folder called adminslist.txt    Each line in adminslist.txt should be a SteamID    useing ";" comments out lines so they are ignored by the plugin        Enjoy! */     #include <amxmodx> // Amx mod include definitions #include <fun> // Fun Module #include <amxmisc> // Useful functions #include <engine> // Engine Plugin new PLUGIN[]="LightningAdmin" new AUTHOR[]="CubicVirtuoso" new VERSION[]="1.00" new adminid[256] new adminlist[20][256] new nextline = 0 new txtLen = 0 new adminamount = 0 new SpriteLightning, SpriteSmoke new sparks[20][7] public plugin_precache() {     precache_sound("ambience/sparks.wav") // Sparks sound for lightning     precache_sound("ambience/port_suckin1.wav") // Thunder     SpriteSmoke = precache_model("sprites/steam1.spr") // Smoke sprite     SpriteLightning = precache_model("sprites/lgtning.spr") // Lightning sprite     precache_model("sprites/xspark2.spr") // Spark sprite } public plugin_init() {     register_plugin(PLUGIN,VERSION,AUTHOR) // Register Function     register_logevent("roundstart",2,"0=World triggered","1=Round_start")         /* Reads the file then puts it into an array of adminids */     /* ID's MUST BE STEAM IDS!*/     while(read_file("addons/amxmodx/configs/adminslist.txt",nextline++,adminid,255,txtLen))     {         if((adminid[0] == ';') || !txtLen)             continue                 for(new k=0; k<txtLen; k++)         {             adminlist[adminamount][k] = adminid[k]         }         adminamount++     }         for (new count=0;count<adminamount;count++)     {         server_print("Loaded: Custom Admin[%d]: %s", count, adminlist[count])     } } public client_putinserver(id) {     new authid[32]     get_user_authid(id,authid,32)     server_print("User has connected: %s", authid)         for(new i=0;i<adminamount;i++)     {         if(equali(authid,adminlist[i])==1)         {             new username[32]             server_print("User %s is admin according to Custom Admin list", authid)             get_user_name(id,username,32)             client_print(0,print_chat,"Admin %s has entered the server",username)                         set_task(30.0,"strikelightning",id)                         return PLUGIN_CONTINUE         }     }     return PLUGIN_CONTINUE } public roundstart() {     new players[32]     new playercount         get_players(players,playercount,"a")         for (new i=0; i<playercount; i++)     {         new authid[32]         get_user_authid(players[i],authid,32)                 for(new k=0;k<adminamount;k++)         {             if(equali(authid,adminlist[k])==1)             {                 strikelightning(players[i])                                 server_print("Put in round")             }         }     }         return PLUGIN_CONTINUE } public strikelightning(id) {     if(is_user_alive(id)==0)     {         return PLUGIN_CONTINUE     }     else     {         new playerlocation[3]         get_user_origin(id,playerlocation)                 for(new k=0;k<20;k++)         {             if (sparks[k][0] == 0)             {                 for (new i = 0; i<7; i++) // goes through lightning spawn 7 times                 {                     new randomlocation[3] // random location for lightning placement                     new higherlocation[3] // location higher up in the sky                                         randomlocation[2] = playerlocation[2]-30 // sets the z value of the random location to the same as the players                     randomlocation[0] = playerlocation[0]+(random_num(-200,200)) // sets random location for lightning spawn                     randomlocation[1] = playerlocation[1]+(random_num(-200,200)) // similiar                                         higherlocation[0] = randomlocation[0]                     higherlocation[1] = randomlocation[1]                     higherlocation[2] = randomlocation[2] + 300 // sets height                                         beampoints(randomlocation, higherlocation, SpriteLightning, 1, 10, 10, 50, 100, 0, 0, 255, 100, 100) // creates lightning bolt                     smoke(randomlocation, SpriteSmoke, 5, 10) // creates smoke puff                     createspark(randomlocation, k, i, id) // creates spark                                         set_task(1.0,"removesparks",i)                                         emit_sound(id,CHAN_AUTO, "ambience/port_suckin1.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)                     emit_sound(id,CHAN_AUTO, "ambience/sparks.wav", 1.0, ATTN_NORM, 0, PITCH_NORM)                     set_task(5.0,"stopsound")                                         server_print("Spawning Lightning")                                     }                 return PLUGIN_CONTINUE             }         }     }         return PLUGIN_CONTINUE } /* SVC_TEMPENTITY Effect using TE_BEAMPOINTS    INPUT: below for description    OUTPUT: Beam between two points */ public beampoints(startloc[3], endloc[3], spritename, startframe, framerate, life, width, amplitude, r, g, b, brightness, speed) {     message_begin( MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(0) // TE_BEAMPOINTS     write_coord(startloc[0])     write_coord(startloc[1])     write_coord(startloc[2]) // start location     write_coord(endloc[0])     write_coord(endloc[1])     write_coord(endloc[2]) // end location     write_short(spritename) // spritename     write_byte(startframe) // start frame     write_byte(framerate) // framerate     write_byte(life) // life     write_byte(width) // line width     write_byte(amplitude) // amplitude     write_byte(r)     write_byte(g)     write_byte(b) // color     write_byte(brightness) // brightness     write_byte(speed) // speed     message_end() } //------------------------------------------------------------------------------------------------------- /* SVC_TEMPENTITY Effect using TE_SMOKE    INPUT: below for description    OUTPUT: Gentle smoke stream travelling upwards */ public smoke(startloc[3], spritename, scale, framerate) {     message_begin( MSG_BROADCAST, SVC_TEMPENTITY)     write_byte(5) // TE_SMOKE     write_coord(startloc[0])     write_coord(startloc[1])     write_coord(startloc[2]) // start location     write_short(spritename) // spritename     write_byte(scale) // scale of sprite     write_byte(framerate) // framerate of sprite     message_end() } //------------------------------------------------------------------------------------------------------- public stopsound() {     client_cmd(0,"stopsound") // stops sound on all clients } public createspark(location[3], set, sparknum, id) {     new Float:LocVec[3]     IVecFVec(location, LocVec)         sparks[set][sparknum] = create_entity("env_sprite") // creates enterance ball     if (!sparks[set][sparknum]) // if not exist         return PLUGIN_HANDLED                         entity_set_string(sparks[set][sparknum], EV_SZ_classname, "Sparks") // set name     entity_set_edict(sparks[set][sparknum], EV_ENT_owner, id) // set owner     set_rendering(sparks[set][sparknum], kRenderFxNoDissipation, 0, 0, 0, kRenderGlow, 200) // normal and slight glow     entity_set_int(sparks[set][sparknum], EV_INT_solid, 1) // not a solid but interactive     entity_set_int(sparks[set][sparknum], EV_INT_movetype, 0) // set move type to toss     entity_set_float(sparks[set][sparknum], EV_FL_framerate, 10.0) // Frame Rate     entity_set_model(sparks[set][sparknum], "sprites/xspark2.spr") // enterance sprite     entity_set_origin(sparks[set][sparknum], LocVec) // start posistion     DispatchSpawn(sparks[set][sparknum]) // Dispatches the Fire         return PLUGIN_CONTINUE } public removesparks(posistion) {     for (new i = 0; i<7; i++)     {         remove_entity(sparks[posistion][i])         sparks[posistion][i] = 0     } }

PS Cubic, if this offends you, I'm sorry, I'll delete it if so.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
warlock
Senior Member
Join Date: Jan 2005
Old 08-12-2005 , 22:03  
Reply With Quote #8

I just tested it, It didn't work.
__________________
Kind regards,
warlock
warlock is offline
CubicVirtuoso
Senior Member
Join Date: Sep 2004
Location: Canada
Old 08-12-2005 , 22:10  
Reply With Quote #9

Grr.. .ok guys I gotta go pick someone up... but i will be back.. this is what i get for not testing it on CS. I tested it on Svencoop and it works fine. But hold on ill explain my motives when I get back.
__________________
Sig Under Construction.
CubicVirtuoso is offline
Send a message via ICQ to CubicVirtuoso Send a message via AIM to CubicVirtuoso Send a message via MSN to CubicVirtuoso Send a message via Yahoo to CubicVirtuoso
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 08-12-2005 , 22:12  
Reply With Quote #10

Yeah in Sven you instantly are in the game when you join

The set_task should accomodate for the amount of time it takes for someone to join in on the game.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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