AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Flashing Screens (https://forums.alliedmods.net/showthread.php?t=240170)

DarkM4A1 05-10-2014 06:44

Flashing Screens
 
Can someone please tell me how to make screen flash with random colors every 5 seconds
I know i could just search but can someone explain it to me. (With example code of course :D)
I dont want just to copy-paste the code i want to know what it means

Cheers!

Backstabnoob 05-10-2014 08:28

Re: Flashing Screens
 
I don't know what you want to understand, just send the screenfade message each 5 seconds with random colors?

DarkM4A1 05-10-2014 12:53

Re: Flashing Screens
 
Quote:

Originally Posted by Backstabnoob (Post 2135902)
I don't know what you want to understand, just send the screenfade message each 5 seconds with random colors?

Example Code?

fysiks 05-10-2014 13:01

Re: Flashing Screens
 
Quote:

Originally Posted by DarkM4A1 (Post 2136013)
Example Code?

Have you searched yet?

DarkM4A1 05-10-2014 13:09

Re: Flashing Screens
 
Quote:

Originally Posted by fysiks (Post 2136018)
Have you searched yet?

Nope found nothing
Please give the link to the thread or post code here

Backstabnoob 05-10-2014 13:15

Re: Flashing Screens
 
How about you actually search then? Because the forums are full of these things.

fysiks 05-10-2014 13:18

Re: Flashing Screens
 
Always look in the Code Snippets/Tutorials section when trying to do something new.

aron9forever 05-10-2014 19:13

Re: Flashing Screens
 
I won't post the snippet because apparently everyone wants you to search for this before posting and I don't want to promote a bad habit, but I can do the explaining part
the screen fade is made via sending a message to a client via reliable or unreliable stream, and the bits you send (you will see if you search a lot of (number)s) define the transparency of the fade as well as the time it takes to fade, and three bits for the colors in the RGB format(red green blue). If you want a specific color you can search for it's RGB value online

ezio_auditore 05-11-2014 02:20

Re: Flashing Screens
 
Here You Go...
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Random ScreenFade" #define VERSION "1.0" #define AUTHOR "ezio_auditore" new ScreenFadeMsg public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         ScreenFadeMsg = get_user_msgid("ScreenFade") } public client_authorized(id) {     screenfade(id)     set_task(5.0, "client_authorized", id) } stock screenfade(index){         message_begin(MSG_ONE, ScreenFadeMsg, _, index)     write_short(2048)     write_short(2048)     write_short(0)     write_byte(random_num(0, 200))     write_byte(random_num(0, 200))     write_byte(random_num(0, 200))     write_byte(random_num(0, 200))//alpha     message_end() }

After Every five seconds... the screen fade with random colors and transparancy.

EDIT:
I have helped for this once.
Next time serach if you are told to do so

Cheers - ezio

DarkM4A1 05-12-2014 12:49

Re: Flashing Screens
 
Quote:

Originally Posted by ezio_auditore (Post 2136246)
Here You Go...
Code:
/* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #define PLUGIN "Random ScreenFade" #define VERSION "1.0" #define AUTHOR "ezio_auditore" new ScreenFadeMsg public plugin_init() { &nbsp;&nbsp;&nbsp;&nbsp;register_plugin(PLUGIN, VERSION, AUTHOR) &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;ScreenFadeMsg = get_user_msgid("ScreenFade") } public client_authorized(id) { &nbsp;&nbsp;&nbsp;&nbsp;screenfade(id) &nbsp;&nbsp;&nbsp;&nbsp;set_task(5.0, "client_authorized", id) } stock screenfade(index){ &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;message_begin(MSG_ONE, ScreenFadeMsg, _, index) &nbsp;&nbsp;&nbsp;&nbsp;write_short(2048) &nbsp;&nbsp;&nbsp;&nbsp;write_short(2048) &nbsp;&nbsp;&nbsp;&nbsp;write_short(0) &nbsp;&nbsp;&nbsp;&nbsp;write_byte(random_num(0, 200)) &nbsp;&nbsp;&nbsp;&nbsp;write_byte(random_num(0, 200)) &nbsp;&nbsp;&nbsp;&nbsp;write_byte(random_num(0, 200)) &nbsp;&nbsp;&nbsp;&nbsp;write_byte(random_num(0, 200))//alpha &nbsp;&nbsp;&nbsp;&nbsp;message_end() }


After Every five seconds... the screen fade with random colors and transparancy.

EDIT:
I have helped for this once.
Next time serach if you are told to do so

Cheers - ezio

Thanks you soooooo much I was trying to make it on my own. For first time it's worked but then i got disconneted from my server everytime with the message
Host_Error Param is not client
But your snippet works awesomeeee

Cheers!


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

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