Raised This Month: $59 Target: $400
 14% 

TFC Sniper Glow


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Team Fortress Classic        Category:   Gameplay        Approver:   GHW_Chronic (70)
GoGo_xD
Junior Member
Join Date: Jun 2006
Location: Paris, France
Old 06-18-2006 , 19:15   TFC Sniper Glow
Reply With Quote #1

Quote:
A lot of (pro)TFC players don't like playing with snipers. And they restrict the Sniper class with the cr_sniper command.

Instead of prohibiting this class, why don't we penalize it?
Description:
  • This plugin will add a glowing effect on all snipers in the game.
    Glowing color is the color of the team, of course.

    The attached file contains the source code of my plugin, and the AMXX compiled plugin.
CVARS:
  • tfc_sniper_glow <0/1> : this will turn ON(1) or OFF(0) the glow effect on snipers. Default is 1.
  • tfc_sniper_map_glow <0/1> : If this is enabled (1), glowing effect will not be set on snipers, during sniper maps ( all the mapnames who contains "sniper" . Ex: 2fortsniper ). Default is 1.
Source Code:

Code:
/*  * Copyright (c) 2006-2006 - Hugo LAFITTE <[email protected]>  *  *  *    TFC Sniper Glow v1.0  *  *  Ce plugin AMX MOD X spécifique au MOD Half-Life: Team Fortress Classic  *  vous permettra de désavantager les Franc-Tireurs sur votre serveur.  *  En effet ceux-ci seront colorés par le très connu effet Glow dans la  *  couleur de leur équipe. Toutes les équipes sont gérées: Bleue, Rouge,  *  Jaune et Verte. CE PLUGIN MARCHE UNIQUEMENT AVEC TEAM FORTRESS CLASSIC.  *  *  *  VERSION      :    1 . 0  *  MOD COMPATIBLE    :   TEAM FORTRESS CLASSIC  *  MODULES UTILISES  :     AMXMODX, FUN, ENGINE  *  *   *  TO-DO LIST:     *  -----------      Permettre de garder la couleur après que le joueur ait  *        utilisé un Teleporteur: lorsque l'on utilise un teleporteur  *        celui-ci ajoute un effet Glow sur votre corps durant quelques  *        minutes, et il remplace l'éventuel effet glow déjà présent avant  *        l'utilisation du teleporteur.  *  *  CVARS:  *  ------        tfc_sniper_glow <0/1> :  *  *            Vous permet d'activer ou non l'effet Glow sur les Franc-Tireurs.  *  *        tfc_sniper_map_glow <0/1>:  *         *            Si l'option est activée (1), lorsqu'une map contenant l'apellation  *            "sniper" est chargée, l'effet glow sur les Franc-Tireurs est désactivé.  *  *  *  *  *  Je remercie tout spécialement CyberGuerrier <www.cyberguerrier.info> pour son aide.           *  */

TODO in future versions:
  • When a glowing user in TFC takes a teleporter, another glowing effect is added to the user, and the primary glow effect is replaced with the new effect. So, I have to make this: I have to get the "teleporter use" event in order to replace or take off the glowing effect of the teleporter.

I hope you'll like this plugin.
That's all.
Attached Files
File Type: rar amxx_tfc_sniper_glow.rar (3.8 KB, 495 views)
__________________
I'm sorry for the bad english I can sometime use.
My TFC Server: 80.248.208.208:27015


Last edited by GHW_Chronic; 08-09-2006 at 00:38.
GoGo_xD is offline
Send a message via MSN to GoGo_xD
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-19-2006 , 00:31  
Reply With Quote #2

Change the mod to TFC.

Also take out the for loop, you obviously don't understand how to use it and its not needed.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
GoGo_xD
Junior Member
Join Date: Jun 2006
Location: Paris, France
Old 06-19-2006 , 06:55  
Reply With Quote #3

Does the function get_weaponname() will run if i don't make a loop?
I don't see where is my "error".
__________________
I'm sorry for the bad english I can sometime use.
My TFC Server: 80.248.208.208:27015

GoGo_xD is offline
Send a message via MSN to GoGo_xD
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 06-19-2006 , 07:11  
Reply With Quote #4

Engine is not needed
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
GoGo_xD
Junior Member
Join Date: Jun 2006
Location: Paris, France
Old 06-19-2006 , 07:19  
Reply With Quote #5

Quote:
Originally Posted by v3x
Engine is not needed
I'm sorry

This is because I'v decided to script the plugin with an other method, but it didn't work, so I forgot to delete the Engine include line.

That's done.
__________________
I'm sorry for the bad english I can sometime use.
My TFC Server: 80.248.208.208:27015

GoGo_xD is offline
Send a message via MSN to GoGo_xD
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-19-2006 , 09:30  
Reply With Quote #6

Quote:
Originally Posted by GoGo_xD
Does the function get_weaponname() will run if i don't make a loop?
I don't see where is my "error". :?
Let me break it down for you then

Lets see here. Your first mistake is that you make a loop and never use it.
Code:
    for(new a=0; a<get_playersnum(); ++a) //your loop has the variable 'a' and its not used anywhere.         {               get_weaponname(get_user_weapon(id,ammo,clip),wpn,31)                 if(containi(wpn, "sniperrifle") > -1)             {                 switch(get_user_team(id))                 {                     case 1:     set_user_rendering(id, kRenderFxGlowShell, color_BLU[0], color_BLU[1], color_BLU[2],  kRenderNormal, 255)                     case 2:     set_user_rendering(id, kRenderFxGlowShell, color_RED[0], color_RED[1], color_RED[2],  kRenderNormal, 255)                     case 3:     set_user_rendering(id, kRenderFxGlowShell, color_YEL[0], color_YEL[1], color_YEL[2],  kRenderNormal, 255)                     case 4:        set_user_rendering(id, kRenderFxGlowShell, color_GRE[0], color_GRE[1], color_GRE[2],  kRenderNormal, 255)                 }             }         }
So what you are doing is looping through however many players there are and setting a persons glow that many times.

There are a few other things wrong with your loop. But IT IS NOT NEEDED in this plugin and should just be removed.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
GoGo_xD
Junior Member
Join Date: Jun 2006
Location: Paris, France
Old 06-19-2006 , 09:56  
Reply With Quote #7

So, that would run?

Code:
           get_weaponname(get_user_weapon(id,ammo,clip),wpn,31)                 if(containi(wpn, "sniperrifle") > -1)             {                 switch(get_user_team(id))                 {                     case 1:     set_user_rendering(id, kRenderFxGlowShell, color_BLU[0], color_BLU[1], color_BLU[2],  kRenderNormal, 255)                     case 2:     set_user_rendering(id, kRenderFxGlowShell, color_RED[0], color_RED[1], color_RED[2],  kRenderNormal, 255)                     case 3:     set_user_rendering(id, kRenderFxGlowShell, color_YEL[0], color_YEL[1], color_YEL[2],  kRenderNormal, 255)                     case 4:        set_user_rendering(id, kRenderFxGlowShell, color_GRE[0], color_GRE[1], color_GRE[2],  kRenderNormal, 255)                 }             }
__________________
I'm sorry for the bad english I can sometime use.
My TFC Server: 80.248.208.208:27015

GoGo_xD is offline
Send a message via MSN to GoGo_xD
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 06-19-2006 , 16:19  
Reply With Quote #8

Aye.
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
GoGo_xD
Junior Member
Join Date: Jun 2006
Location: Paris, France
Old 06-20-2006 , 05:30  
Reply With Quote #9

Quote:
Originally Posted by Suicid3
Aye.
Package is now updated with new corrections.
__________________
I'm sorry for the bad english I can sometime use.
My TFC Server: 80.248.208.208:27015


Last edited by GoGo_xD; 06-24-2006 at 07:40.
GoGo_xD is offline
Send a message via MSN to GoGo_xD
GoGo_xD
Junior Member
Join Date: Jun 2006
Location: Paris, France
Old 06-24-2006 , 07:41   Re: TFC Sniper Glow
Reply With Quote #10

Will my plugin be approved?
__________________
I'm sorry for the bad english I can sometime use.
My TFC Server: 80.248.208.208:27015

GoGo_xD is offline
Send a message via MSN to GoGo_xD
Reply


Thread Tools
Display Modes

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 15:51.


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