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

Spectate


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 06-11-2007 , 20:22   Spectate
Reply With Quote #1

What: Sends you to spectate team and back to your original team.
How: say "spec" or "unspec"
Why: I needed a way to enter spectate team on my death match server without reconnecting.


For DeathMatch servers


changelog:
0.1: initial version
0.2: minor tweaks ( thanks YamiKaitou and Juba_PornBorn )
0.3: No warning,use correct CsTeam tag,no giant initializing (thanks danielkza)
0.4: prevents score change on spectate ( thanks Lee )


The algorithm is quite simple and solid (IMHO)

Code:
#include <amxmodx>
#include <cstrike>
#include <fun>
Attached Files
File Type: sma Get Plugin or Get Source (spectate.sma - 909 views - 1.0 KB)
__________________
Check out my website at http://matthewmiller.info

Last edited by Podunk; 07-07-2007 at 00:04. Reason: new version
Podunk is offline
Send a message via MSN to Podunk
regalis
Veteran Member
Join Date: Jan 2007
Old 06-11-2007 , 21:47   Re: Spectate
Reply With Quote #2

Have you tested this plugin?
I made a similar one but i failed to get it working with CSDM...
The people respawn in their old team but if they get killed they stay death..0o
Or do you use another deathmatch?

greetz regalis
__________________

Last edited by regalis; 06-12-2007 at 07:24. Reason: typo
regalis is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-12-2007 , 16:58   Re: Spectate
Reply With Quote #3

Try having your semicolons and brackets consistent. If you use semicolons, use it for the entire plugin. Also, blank lines don't affect the compiler at all, they just make the code easier to read. Also, you might want to add a task in place of your spawn to verify that they actually did get spawned.

Try replacing your spawn(id); with this
PHP Code:
set_task(0.4,"respawn",id); 
Then, add this to the file
PHP Code:
public respawn(id)
{
    if(!
is_user_alive(id))
    {
        
spawn(id);
        
set_task(0.6,"respawn",id);
        return 
PLUGIN_CONTINUE;
    }
    return 
PLUGIN_CONTINUE;

This is because there is sometimes a glitch in the HL engine that causes the player not to be spawned on the first call.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (intervening in a thread, asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 06-12-2007 , 18:06   Re: Spectate
Reply With Quote #4

been using it on my CSDM server and it works great
__________________
Check out my website at http://matthewmiller.info
Podunk is offline
Send a message via MSN to Podunk
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-12-2007 , 19:13   Re: Spectate
Reply With Quote #5

Tryed and goes perfect! Nice work! Doesn't even fails for now.
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
_Master_
Senior Member
Join Date: Dec 2006
Old 06-15-2007 , 05:36   Re: Spectate
Reply With Quote #6

So this is the "light" version of Admin Freelook ?!?
_Master_ is offline
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 06-16-2007 , 12:35   Re: Spectate
Reply With Quote #7

link?
__________________
Check out my website at http://matthewmiller.info
Podunk is offline
Send a message via MSN to Podunk
_Master_
Senior Member
Join Date: Dec 2006
Old 06-16-2007 , 16:35   Re: Spectate
Reply With Quote #8

http://forums.alliedmods.net/showthr...admin+freelook
_Master_ is offline
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 06-16-2007 , 16:40   Re: Spectate
Reply With Quote #9

no, the difference is mine will work on DM servers
__________________
Check out my website at http://matthewmiller.info
Podunk is offline
Send a message via MSN to Podunk
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-18-2007 , 23:24   Re: Spectate
Reply With Quote #10

found a bug:

sometimes you say: spec and nothing happens you die and a kill is added.

Need to add this code apart from the sugestion YamiKaitou gave you:

PHP Code:
    new deaths
    deaths 
cs_get_user_deaths(id)
    
cs_set_user_deaths(iddeaths 1)
    new 
frags
    frags 
cs_get_user_frags(id)
    
cs_set_user_frags(idfrags 1
this way when someone goes spec they dont add a death.

And this to enforce spec:

PHP Code:
cs_set_user_team(idCS_TEAM_SPECTATORCS_CT_VIP); 

Last edited by Juba_PornBorn; 07-04-2007 at 06:11.
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
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 19:58.


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