Raised This Month: $ Target: $400
 0% 

novice requesting help on glow plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
WAR_Nuker
New Member
Join Date: Jul 2007
Old 07-11-2007 , 13:29   novice requesting help on glow plugin
Reply With Quote #1

i know scripting on a very basic level. i run a server and wanted to customize a few of the plugins i was using. some i was able to to an extent...others i couldnt figure out.

i found a glow all in one plugin. i got rid of the glowing HUD and glowing grenade features and kept the glowing and colored stream features (there might still be some snippets left from that in the code). i wanted to add more color options to the code like cyan...but i couldnt get it to work. heres the code as it stands right now:

Code:
 
/*
GAIO ( Glow All In One! ) Version 1.1 (c) Zenith77 2005
 
This plugin combines some nice little glow features such as the classic glow, "stream lines" and
the ablity to change the color of your hud!
 
=============-
Glow Shell Commands 
--Admin
amx_target_glow <target> <red> <green> <blue> -- makes target glow color
---
Client:
amx_glow <red> <green> <blue> -- makes you glow a color
--
e.g.
amx_glow 255 123 0
--
say glowoff -- stops glowing
say glowred -- glow red
say glowgreen -- glow green
say glowblue -- glow blue
say glowyellow -- you get the idea...
say glowpink
say gloworange
say glowpurple
say glowwhite
--Menu
say glowmenu
==============-
 
==============-
Stream Commands
--Admin
amx_target_stream <target> <red> <green> <blue> -- makes a stream on target
--
Client:
amx_stream <red> <green> <blue> -- creats a stream on you
say streamred -- red stream
say streamgreen -- green stream
say streamblue -- blue stream
say streamyellow -- need I say more ?
say streampink 
say streamorange
say streampurple
say streamwhite
-- Menu
say streammenu
--
=============-
Main Menu
say gaiomenu
====-
===========-
CVARS
sv_glow 1 = on | 0 = off
amx_show_glow_cmd 1 = only show admin conformation message | 2 = show conformation message to admin and client with out admin's name
| 3 = show conformatino message to admin and client with admins name 
 
==========-
===========-
UPDATES
1.0 -- Release
1.1 -- fixed amx_target_hud & amx_target_stream bugs and other coding
errors ( which were already fixed, fricking amxx studio wont
save right :/ ) + added some more cvars
1.2 -- added grenade commands ( including menu )
added white to all menus
now requires the engine module
/\/\/\/\/\To-Do
Add Stream to grenades
/\/\/\/\/\--
 
===========-
Enjoy,
Zenith77
 
==============-
Screenies:
http://img327.**************/img327/7955/glow19aj.th.jpg
http://img327.**************/img327/6240/stream8xy.jpg
http://img290.**************/img290/3296/hud3fa.th.jpg
http://img225.**************/img225/4310/nadeblue4nr.jpg
http://img225.**************/img225/9...eyellow8qp.jpg
http://img225.**************/img225/6453/menu29el.jpg
 
*/
#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fun>
#define PLUGIN "GAIO ( Glow All In One! )"
#define VERSION "1.2"
#define AUTHOR "Zenith77"
// --- Color defines ---
#define GLOW_NULL 0
#define GLOW_RED 1 // (255, 0, 0) System:( red, green, blue )
#define GLOW_GREEN 2 // (0, 255, 0)
#define GLOW_BLUE 3 // (0, 0, 255)
#define GLOW_YELLOW 4 // (255, 255, 0)
#define GLOW_PINK 5 // (255, 0, 255)
#define GLOW_ORANGE 6 // (255, 127, 0)
#define GLOW_PURPLE 7 // (170, 0, 128)
#define GLOW_WHITE 8 // (255, 255, 255)
#define GLOW_CUSTOM 9 // User set Color
#define GLOW_ADMIN 10 // ADMIN SET GLOW
// ----
// --- TASKS ---
#define TASK_REFRESH_STREAM 474848578
//---
//---- Menu ----
#define KeysglowMenu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9) // Keys: 1234590
#define KeysStreamMenu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<4)|(1<<8)|(1<<9) // Keys: 1234590
#define KeysmainMenu (1<<0)|(1<<1)|(1<<2)|(1<<3)|(1<<9) // Keys: 12340
// ----
//new g_msgFade
new g_GlowColor[33]
new g_GlowStreamColor[33]
new g_GlowStreamCustomColor[33][3]
/*
The above array is used for to store the stream color through set_task()
 
Example
g_GlowStreamCustomColor[id][0] = 255 ( red )
g_GlowStreamCustomColor[id][1] = 75 ( green )
g_GlowStreamCustomColor[id][2] = 20 ( blue )
 
*/
 
// Menu
new g_MenuPos[33]
//---
// Sprite
new g_LaserSprite
// -----
 
 
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
 
register_menucmd(register_menuid("glowMenu"), KeysglowMenu, "PressedglowMenu")
register_cvar("sv_glow", "1" )
register_cvar("amx_glow_show_cmd", "1") // 0, 1, or 2
 
// --- Glow Shell Commands --- 
 
register_concmd("amx_target_glow", "cmdGlowTarget", ADMIN_KICK, "<target> <red> <green> <blue> Makes target glow color!" )
 
register_clcmd("amx_glow", "cmdGlow", ADMIN_ALL, "<red> <green> <blue> makes you glow a custom color!" )
register_clcmd("say glowoff", "cmdGlowStop", ADMIN_ALL, "stops glowing!" )
register_clcmd("say glowred", "cmdGlowRed", ADMIN_ALL, "makes you glow red!" )
register_clcmd("say glowgreen", "cmdGlowGreen", ADMIN_ALL, "makes you glow green!" )
register_clcmd("say glowblue", "cmdGlowBlue", ADMIN_ALL, "makes you glow blue!" )
register_clcmd("say glowyellow", "cmdGlowYellow", ADMIN_ALL, "makes you glow yellow!" )
register_clcmd("say glowpink", "cmdGlowPink", ADMIN_ALL, "makes you glow pink!")
register_clcmd("say gloworange", "cmdGlowOrange", ADMIN_ALL, "makes you glow orange!" )
register_clcmd("say glowpurple", "cmdGlowPurple", ADMIN_ALL, "makes you glow purple!" )
register_clcmd("say glowwhite", "cmdGlowWhite", ADMIN_ALL, "makes you glow white!" )
register_clcmd("say glowmenu", "cmdGlowMenu", ADMIN_ALL, "shows glow menu!" )
 
// Menu
register_menucmd(register_menuid("glowMenu"), KeysglowMenu, "PressedglowMenu")
//--
 
// ------
 
// ---------- Steam Commands ---------
 
register_concmd("amx_target_stream", "cmdStreamTarget", ADMIN_KICK, "<target> <red> <green> <blue> makes a stream on target!" )
 
register_clcmd("amx_stream", "cmdStream", ADMIN_ALL, "<red> <green> <blue> makes a stream!" )
register_clcmd("say streamoff", "cmdStreamStop", ADMIN_ALL, "stops stream!" )
register_clcmd("say streamred", "cmdStreamRed", ADMIN_ALL, "makes a red stream!" )
register_clcmd("say streamgreen", "cmdStreamGreen", ADMIN_ALL, "makes a green stream!" )
register_clcmd("say streamblue", "cmdStreamBlue", ADMIN_ALL, "makes a blue stream!" )
register_clcmd("say streamyellow", "cmdStreamYellow", ADMIN_ALL, "makes a yellow stream!" )
register_clcmd("say streampink", "cmdStreamPink", ADMIN_ALL, "makes a pink stream!" )
register_clcmd("say streamorange", "cmdStreamOrange", ADMIN_ALL, "makes an orange stream!" )
register_clcmd("say streampurple", "cmdStreamPurple", ADMIN_ALL, "makes a purple stream!" )
register_clcmd("say streamwhite", "cmdStreamWhite", ADMIN_ALL, "makes a white stream!") 
register_clcmd("say streammenu", "cmdStreamMenu", ADMIN_ALL, "shows stream menu!" )
 
// Menu
register_menucmd(register_menuid("streamMenu"), KeysStreamMenu, "PressedstreamMenu")
// --
 
//------------
 
 
// ----- Main Menu -----
 
register_clcmd("say gaiomenu", "cmdMainMenu", ADMIN_ALL, "shows the main GAIO menu!" )
 
register_menucmd(register_menuid("mainMenu"), KeysmainMenu, "PressedmainMenu")
 
 
// ----
 
 
// --- Events & Messages ---
 
register_event("DeathMsg", "eventDeath", "a" )
 
register_event("ScreenFade", "eventFade", "b" )
 
register_event("SendAudio","eventGrenade","bc","2=%!MRAD_FIREINHOLE")
 
 
 
//g_msgFade = get_user_msgid("ScreenFade")
 
// --- 
 
 
}
public plugin_precache() {
 
g_LaserSprite = precache_model("sprites/laserbeam.spr")
 
}
 
public client_connect(id) {
 
g_GlowColor[id] = GLOW_NULL
g_GlowStreamColor[id] = GLOW_NULL
 
new i
 
for( i = 0; i < 2; i++ ) {
 
g_GlowStreamCustomColor[id][i] = 0
 
}
 
}
 
public eventDeath() {
 
new id
 
id = read_data(1)
 
if(g_GlowStreamColor[id] != GLOW_NULL ) {
 
g_GlowStreamColor[id] = GLOW_NULL
 
new i
 
for( i = 0; i < 2; i++) {
 
g_GlowStreamCustomColor[id][i] = 0
}
 
remove_task(TASK_REFRESH_STREAM+id)
 
funcStream(id, 0, 0, 0) // get rid of the stream now...
}
}
 
// --- Glow Shell Commands ---
public cmdGlowTarget(id, level, cid) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_console, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !cmd_access(id, level, cid, 5) ) return PLUGIN_HANDLED
 
new arg1[33], arg2[33], arg3[33], arg4[33] /* Target, Red, Green, Blue */
new target
new szTargetName[32]
new szName[32]
new iRed
new iGreen
new iBlue
 
 
read_argv(1, arg1, 32) // Target
read_argv(2, arg2, 32) // Red
read_argv(3, arg3, 32) // Green
read_argv(4, arg4, 32) // Blue
 
target = cmd_target(id, arg1, 2)
 
if( !is_user_alive(target)) {
 
client_print(id, print_console, "[AMXX] Your target must be alive in order for them to glow!" )
 
return PLUGIN_HANDLED
}
 
iRed = str_to_num(arg2)
iGreen = str_to_num(arg3)
iBlue = str_to_num(arg4)
 
get_user_name(id, szName, 31)
get_user_name(target, szTargetName, 31)
 
switch(get_cvar_num("amx_glow_show_cmd")) {
 
case 1: client_print(id, print_console, "[AMXX] You made %s Glow %d(red) %d(green) %d(blue) !", szTargetName, iRed, iGreen, iBlue )
 
case 2: {
 
client_print(id, print_console, "[AMXX] You made %s Glow %d(red) %d(green) %d(blue) !", szTargetName, iRed, iGreen, iBlue )
 
client_print(id, print_chat, "[AMXX] An admin made you glow %d(red) %d(green) %d(blue)!", iRed, iGreen, iBlue)
}
 
case 3: {
 
client_print(id, print_console, "[AMXX] You made %s Glow %d(red) %d(green) %d(blue) !", szTargetName, iRed, iGreen, iBlue )
 
client_print(target, print_chat, "[AMXX] Admin ^"%s^" made you glow %d(red) %d(green) %d(blue)!", szName, iRed, iGreen, iBlue)
 
}
}
 
set_user_rendering(target, kRenderFxGlowShell, iRed, iGreen, iBlue, kRenderFxNone, 25)
 
g_GlowColor[target] = GLOW_ADMIN
 
return PLUGIN_HANDLED
}
public cmdGlow(id, level, cid) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !cmd_access(id, level, cid, 4) ) return PLUGIN_HANDLED
 
new arg1[33], arg2[33], arg3[33]
new iRed
new iGreen
new iBlue
 
read_argv(2, arg1, 32)
read_argv(3, arg2, 32)
read_argv(4, arg3, 32)
 
iRed = str_to_num(arg1)
iGreen = str_to_num(arg2)
iBlue = str_to_num(arg3)
 
client_print(id, print_chat, "[AMXX] You are now glowing %d(red) %d(green) %d(blue)!", iRed, iGreen, iBlue )
 
g_GlowColor[id] = GLOW_CUSTOM
 
set_user_rendering(id, kRenderFxGlowShell, iRed, iGreen, iBlue, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
public cmdGlowStop(id) {
 
if( !get_cvar_num("sv_glow") && g_GlowColor[id] == GLOW_NULL) { // Maybe an admin turned it off while they were glowing ?
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_NULL ) {
 
client_print(id, print_chat, "[AMXX] You are not glowing a color!")
 
return PLUGIN_HANDLED
}
 
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 0, kRenderNormal, 26)
 
client_print(id, print_chat, "[AMXX] You have Stopped glowing!" )
 
g_GlowColor[id] = GLOW_NULL
 
return PLUGIN_HANDLED
}
public cmdGlowRed(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_RED ) {
 
client_print(id, print_chat, "[AMXX] You are already glowing red!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing red!" )
 
g_GlowColor[id] = GLOW_RED
 
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 0, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
public cmdGlowGreen(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_GREEN ) {
 
client_print(id, print_chat, "[AMXX] You are already glowing green!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing green!" )
 
g_GlowColor[id] = GLOW_GREEN
 
set_user_rendering(id, kRenderFxGlowShell, 0, 255, 0, kRenderNormal, 26)
 
return PLUGIN_HANDLED
 
}
public cmdGlowBlue(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_BLUE) {
 
client_print(id, print_chat, "[AMXX] You are already glowing blue!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing blue!" )
 
g_GlowColor[id] = GLOW_BLUE
 
set_user_rendering(id, kRenderFxGlowShell, 0, 0, 255, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
public cmdGlowYellow(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_YELLOW ) {
 
client_print(id, print_chat, "[AMXX] You are already glowing yellow!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing yellow!" )
 
g_GlowColor[id] = GLOW_YELLOW
 
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 0, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
public cmdGlowPink(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_PINK ) {
 
client_print(id, print_chat, "[AMXX] You are already glowing pink!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing pink!" )
 
g_GlowColor[id] = GLOW_PINK
 
set_user_rendering(id, kRenderFxGlowShell, 255, 0, 255, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
public cmdGlowOrange(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_ORANGE ) {
 
client_print(id, print_chat, "[AMXX] You are already glowing yellow!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing orange!" )
 
g_GlowColor[id] = GLOW_ORANGE
 
set_user_rendering(id, kRenderFxGlowShell, 255, 127, 0, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
public cmdGlowPurple(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_PURPLE) {
 
client_print(id, print_chat, "[AMXX] You are already glowing purple!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing purple!" )
 
g_GlowColor[id] = GLOW_PURPLE
 
set_user_rendering(id, kRenderFxGlowShell, 170, 0, 128, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
public cmdGlowWhite(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to glow!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowColor[id] == GLOW_WHITE) {
 
client_print(id, print_chat, "[AMXX] You are already glowing white!" )
 
return PLUGIN_HANDLED
}
 
client_print(id, print_chat, "[AMXX] You are now glowing white!" )
 
g_GlowColor[id] = GLOW_WHITE
 
set_user_rendering(id, kRenderFxGlowShell, 255, 255, 255, kRenderNormal, 26)
 
return PLUGIN_HANDLED
}
 
public cmdGlowMenu(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
 
ShowglowMenu(id, g_MenuPos[id] = 0 )
 
return PLUGIN_HANDLED
 
}
// --- END GLOW SHELL COMMANDS ! ---
 
 
 
 
 
// --- STREAM COMMANDS ---
public cmdStreamTarget(id, level, cid) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_console, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !cmd_access(id, level, cid, 5) ) return PLUGIN_HANDLED
 
 
 
new arg1[33], arg2[33], arg3[33], arg4[33] /* Target, Red, Green, Blue */
new target
new szTargetName[32]
new szName[32]
new iRed
new iGreen
new iBlue
 
 
read_argv(1, arg1, 32) // Target
read_argv(2, arg2, 32) // Red
read_argv(3, arg3, 32) // Green
read_argv(4, arg4, 32) // Blue
 
target = cmd_target(id, arg1, 2)
 
if( !is_user_alive(target)) {
 
client_print(id, print_console, "[AMXX] Your target must be alive in order for them to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[target] != GLOW_NULL ) {
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
iRed = str_to_num(arg2)
iGreen = str_to_num(arg3)
iBlue = str_to_num(arg4)
 
get_user_name(id, szName, 31)
get_user_name(target, szTargetName, 31)
 
switch(get_cvar_num("amx_glow_show_cmd")) {
 
case 1: client_print(id, print_console, "[AMXX] You made a %d(red) %d(green) %d(blue) stream on %s !", iRed, iGreen, iBlue, szTargetName )
 
case 2: {
 
client_print(id, print_console, "[AMXX] You made a %d(red) %d(green) %d(blue) stream on %s!", iRed, iGreen, iBlue, szTargetName)
 
client_print(id, print_chat, "[AMXX] An admin made a %d(red) %d(green) %d(blue) stream on you!", iRed, iGreen, iBlue)
}
 
case 3: {
 
client_print(id, print_console, "[AMXX] You made %s Glow %d(red) %d(green) %d(blue) !", szTargetName, iRed, iGreen, iBlue )
 
client_print(target, print_chat, "[AMXX] Admin ^"%s^" made a %d(red) %d(green) %d(blue) stream on you!", szName, iRed, iGreen, iBlue)
 
}
}
 
funcStream(target, iRed, iGreen, iBlue)
 
g_GlowStreamColor[target] = GLOW_ADMIN
 
 
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+target, _, _,"b")
 
return PLUGIN_HANDLED
 
}
public cmdStream(id, level, cid) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !cmd_access(id, level, cid, 4) ) return PLUGIN_HANDLED
 
if( g_GlowStreamColor[id] != GLOW_NULL ) {
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
new arg1[33], arg2[33], arg3[33]
new iRed
new iGreen
new iBlue
 
read_argv(2, arg1, 32)
read_argv(3, arg2, 32)
read_argv(4, arg3, 32)
 
iRed = str_to_num(arg1)
iGreen = str_to_num(arg2)
iBlue = str_to_num(arg3)
 
client_print(id, print_chat, "[AMXX] You made a %d(red) %d(green) %d(blue) stream on you!", iRed, iGreen, iBlue )
 
funcStream(id, iRed, iGreen, iBlue)
 
g_GlowStreamColor[id] = GLOW_CUSTOM
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
 
return PLUGIN_HANDLED
}
public cmdStreamStop(id) {
 
if( !get_cvar_num("sv_glow") && g_GlowStreamColor[id] == GLOW_NULL) { // Maybe an admin turned it off while they were glowing ?
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
remove_task(TASK_REFRESH_STREAM+id)
 
client_print(id, print_chat, "[AMXX] Stream removed!" )
 
new i
 
for( i = 0; i < 2; i++) {
 
g_GlowStreamCustomColor[id][i] = 0
}
 
g_GlowStreamColor[id] = GLOW_NULL
 
return PLUGIN_HANDLED
 
}
public cmdStreamRed(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_RED) {
 
client_print(id, print_chat, "[AMXX] You are already have a red stream!" )
 
return PLUGIN_HANDLED
}
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a red stream!" )
 
funcStream(id, 255, 0, 0)
 
g_GlowStreamColor[id] = GLOW_RED
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
}
public cmdStreamGreen(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_GREEN) {
 
client_print(id, print_chat, "[AMXX] You are already have a green stream!" )
 
return PLUGIN_HANDLED
}
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a green stream!" )
 
funcStream(id, 0, 255, 0)
 
g_GlowStreamColor[id] = GLOW_GREEN
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
}
public cmdStreamBlue(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_BLUE) {
 
client_print(id, print_chat, "[AMXX] You are already have a blue stream!" )
 
return PLUGIN_HANDLED
}
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a blue stream!" )
 
funcStream(id, 0, 0, 255)
 
g_GlowStreamColor[id] = GLOW_BLUE
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
}
public cmdStreamYellow(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_YELLOW) {
 
client_print(id, print_chat, "[AMXX] You are already have a yellow stream!" )
 
return PLUGIN_HANDLED
}
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a yellow stream!" )
 
funcStream(id, 255, 255, 0)
 
g_GlowStreamColor[id] = GLOW_YELLOW
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
}
public cmdStreamPink(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_PINK) {
 
client_print(id, print_chat, "[AMXX] You are already have a pink stream!" )
 
return PLUGIN_HANDLED
}
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a pink stream!" )
 
funcStream(id, 255, 0, 255)
 
g_GlowStreamColor[id] = GLOW_PINK
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
 
}
public cmdStreamOrange(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_ORANGE) {
 
client_print(id, print_chat, "[AMXX] You are already have a orange stream!" )
 
return PLUGIN_HANDLED
}
 
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a orange stream!" )
 
funcStream(id, 255, 127, 0)
 
g_GlowStreamColor[id] = GLOW_ORANGE
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
 
}
public cmdStreamPurple(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_PURPLE) {
 
client_print(id, print_chat, "[AMXX] You are already have a purple stream!" )
 
return PLUGIN_HANDLED
}
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a purple stream!" )
 
funcStream(id, 170, 0, 128)
 
g_GlowStreamColor[id] = GLOW_PURPLE
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
 
}
public cmdStreamWhite(id) {
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
if( !is_user_alive(id)) {
 
client_print(id, print_chat, "[AMXX] You must be alive in order to have a stream!" )
 
return PLUGIN_HANDLED
}
 
if( g_GlowStreamColor[id] == GLOW_WHITE) {
 
client_print(id, print_chat, "[AMXX] You are already have a WHITE stream!" )
 
return PLUGIN_HANDLED
}
 
 
if( g_GlowStreamColor[id] != GLOW_NULL) { // Make sure that he is glowing a color
// so we know that the task exists....
 
remove_task(TASK_REFRESH_STREAM+id)
 
}
 
client_print(id, print_chat, "[AMXX] You now have a white stream!" )
 
funcStream(id, 255, 255, 255)
 
g_GlowStreamColor[id] = GLOW_WHITE
 
set_task(1.5, "refreshStream", TASK_REFRESH_STREAM+id, _, _,"b")
 
return PLUGIN_HANDLED
 
}
public cmdStreamMenu(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
ShowstreamMenu(id, g_MenuPos[id] = 0 )
 
return PLUGIN_HANDLED
 
}
 
public refreshStream(id) {
 
id -= TASK_REFRESH_STREAM
 
if( !get_cvar_num("sv_glow") ) {
 
remove_task(TASK_REFRESH_STREAM+id)
 
return PLUGIN_HANDLED
 
}
 
message_begin(MSG_BROADCAST, SVC_TEMPENTITY) 
write_byte(22) // TE_BEAMFOLLOW 22 
write_short(id) // short (entity:attachment to follow)
write_short(g_LaserSprite) // short (sprite index)
write_byte(15) // byte (life in 0.1's) 
write_byte(8) // byte (line width in 0.1's) 
write_byte(g_GlowStreamCustomColor[id][0])// byte (color)
write_byte(g_GlowStreamCustomColor[id][1])// byte (color) 
write_byte(g_GlowStreamCustomColor[id][2])// byte (color)
write_byte(100) // byte (brightness)
message_end()
 
 
 
return PLUGIN_HANDLED
 
}
 
public funcStream(id, iRed, iGreen, iBlue) {
 
message_begin(MSG_BROADCAST, SVC_TEMPENTITY) 
write_byte(22) // TE_BEAMFOLLOW 22 
write_short(id) // short (entity:attachment to follow)
write_short(g_LaserSprite) // short (sprite index)
write_byte(get_cvar_num("amx_stream_length") ) // byte (life in 0.1's) 
write_byte(8) // byte (line width in 0.1's) 
write_byte(iRed) // byte (color)
write_byte(iGreen) // byte (color) 
write_byte(iBlue) // byte (color)
write_byte(100) // byte (brightness)
message_end()
 
g_GlowStreamCustomColor[id][0] = iRed
g_GlowStreamCustomColor[id][1] = iGreen
g_GlowStreamCustomColor[id][2] = iBlue
 
}
 
 
// -------- End Stream -----
 
 
// ----- Main Menu -----
public cmdMainMenu(id) {
 
 
if( !get_cvar_num("sv_glow") ) {
 
client_print(id, print_chat, "[AMXX] Sorry, GAIO (Glow All in One) is disabled!")
 
return PLUGIN_HANDLED
}
 
ShowmainMenu(id)
 
return PLUGIN_HANDLED
}
 
 
 
 
//Menus -------------
 
public ShowglowMenu(id, pos) {
 
switch(pos) {
 
case 0: show_menu(id, KeysglowMenu, "\yGlow Menu^n^n\w1. Stop Glow^n2. Red^n3. Green^n4. Blue^n^n9. Next^n0. Exit", -1, "glowMenu") // Display menu
case 1: show_menu(id, KeysglowMenu, "\yGlow Menu^n^n\w1. White^n2. Orange^n3. Purple^n4. Pink^n5. Yellow^n^n9. Back", -1, "glowMenu")
}
}
 
public PressedglowMenu(id, key) {
/* Menu:
* Stream Menu
* 
* <COLORS>
*
*/
 
switch (key) {
case 0: { // 1
 
switch(g_MenuPos[id]) {
 
case 0: cmdGlowStop(id)
case 1: cmdGlowWhite(id)
 
}
}
 
case 1: { // 2
 
switch(g_MenuPos[id]) {
 
case 0: cmdGlowRed(id)
case 1: cmdGlowOrange(id)
}
 
}
case 2: { // 3
 
switch(g_MenuPos[id]) {
 
case 0: cmdGlowGreen(id)
case 1: cmdGlowPurple(id)
}
 
}
case 3: { // 4
 
switch(g_MenuPos[id]) {
 
case 0: cmdGlowBlue(id)
case 1: cmdGlowPink(id)
}
 
}
case 4: { 
 
switch(g_MenuPos[id]) {
 
 
case 1: cmdGlowYellow(id)
}
 
}
 
case 8: {
 
switch(g_MenuPos[id]) {
 
case 0: g_MenuPos[id] = 1
case 1: g_MenuPos[id] = 0
}
 
ShowglowMenu(id, g_MenuPos[id])
}
 
case 9: { 
 
switch(g_MenuPos[id]) {
 
case 0: return PLUGIN_HANDLED 
}
 
}
}
 
return PLUGIN_HANDLED
}
// ----------------
public ShowstreamMenu(id, pos) {
 
switch(pos) {
 
case 0: show_menu(id, KeysStreamMenu, "\yStream Menu^n^n\w1. Stop Stream^n2. Red^n3. Green^n4. Blue^n^n9. Next^n0. Exit", -1, "streamMenu") // Display menu
case 1: show_menu(id, KeysStreamMenu, "\yStream Menu^n^n\w1. White^n2. Orange^n3. Purple^n4. Pink^n5. Yellow^n^n9. Back", -1, "streamMenu")
}
}
 
public PressedstreamMenu(id, key) {
/* Menu:
* Stream Menu
* 
* <COLORS>
*
*/
 
switch (key) {
case 0: { // 1
switch(g_MenuPos[id] ) {
 
case 0: cmdStreamStop(id)
case 1: cmdStreamWhite(id)
 
}
}
 
case 1: { // 2
 
switch(g_MenuPos[id]) {
 
case 0: cmdStreamRed(id)
case 1: cmdStreamOrange(id)
}
 
}
case 2: { // 3
 
switch(g_MenuPos[id]) {
 
case 0: cmdStreamGreen(id)
case 1: cmdStreamPurple(id)
}
 
}
case 3: { // 4
 
switch(g_MenuPos[id]) {
 
case 0: cmdStreamBlue(id)
case 1: cmdStreamPink(id)
}
 
}
case 4: { 
 
switch(g_MenuPos[id]) {
 
case 1: cmdStreamYellow(id)
}
 
}
 
case 8: {
 
switch(g_MenuPos[id]) {
 
case 0: g_MenuPos[id] = 1
case 1: g_MenuPos[id] = 0
}
 
ShowstreamMenu(id, g_MenuPos[id])
}
 
case 9: { 
 
switch(g_MenuPos[id]) {
 
case 0: return PLUGIN_HANDLED 
}
 
}
}
 
return PLUGIN_HANDLED
}
// ----------------
public ShowmainMenu(id) {
 
 
show_menu(id, KeysmainMenu, "\yGAIO Menu^n^n\w1. Glow Menu^n2. Stream Menu^n3. Hud Menu^n4. Grenade Menu^n^n0. Exit", -1, "mainMenu") // Display menu
 
 
}
 
public PressedmainMenu(id, key) {
/* Menu:
* GAIO Menu
*
* 1. Glow Menu
* 2. Stream Menu
*
*
* 0. Exit
/
 
switch (key) {
case 0: { // 1
 
ShowglowMenu(id, g_MenuPos[id] = 0 )
 
}
 
case 1: { // 2
 
ShowstreamMenu(id, g_MenuPos[id] = 0 )
 
}
 
case 9: { 
 
return PLUGIN_HANDLED
 
}
}
 
return PLUGIN_HANDLED
}
any help is appreciated

Last edited by WAR_Nuker; 07-11-2007 at 16:31.
WAR_Nuker is offline
 



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 21:32.


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