Raised This Month: $7 Target: $400
 1% 

Spec Switch


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose       
many
Member
Join Date: Jul 2007
Location: Russian, Moscow
Old 12-13-2007 , 09:32   Spec Switch
Reply With Quote #1

Hello.
This plugin allow to go Spectator and back.
Type /spec if you want to go Spectator
Type /back to return from Spectator to your comand.
When you type /back you should not wait for the end of a round it respawn you immediately.
The death does not increase and Kill does not diminish.
It is good for CSDM
P.S. If you found bug please write it here
Add Cvar:
amx_specmode 0 or 1
0 - enable use to all, 1 - enable use only ADMINs
Attached Files
File Type: sma Get Plugin or Get Source (Spec_Switch.sma - 8930 views - 3.0 KB)

Last edited by many; 04-15-2008 at 10:56. Reason: Add Cvar
many is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 12-13-2007 , 09:36   Re: Spec Switch
Reply With Quote #2

Code:
new CsTeams:zTeam new zDeath

Those variables should be 33 arrays
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
many
Member
Join Date: Jul 2007
Location: Russian, Moscow
Old 12-13-2007 , 09:58   Re: Spec Switch
Reply With Quote #3

Thanx. Updated
many is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 12-16-2007 , 20:47   Re: Spec Switch
Reply With Quote #4

isnt this included with amx_super?
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
many
Member
Join Date: Jul 2007
Location: Russian, Moscow
Old 12-17-2007 , 07:38   Re: Spec Switch
Reply With Quote #5

I dont know. I did'nt use this plugin
many is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 12-17-2007 , 11:30   Re: Spec Switch
Reply With Quote #6

ah ok, but amx_super is all in one plugin. and that is included in. u shud get it (^,^)
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
many
Member
Join Date: Jul 2007
Location: Russian, Moscow
Old 12-17-2007 , 16:02   Re: Spec Switch
Reply With Quote #7

in amx_super u need wait end of round
here u respawn automatical
many is offline
Battousai-sama
Veteran Member
Join Date: Jul 2007
Old 12-17-2007 , 16:10   Re: Spec Switch
Reply With Quote #8

ah, dunno bout that.
__________________
Battousai-sama is offline
Send a message via MSN to Battousai-sama
Daniel1337
New Member
Join Date: Dec 2007
Old 12-21-2007 , 13:03   Re: Spec Switch
Reply With Quote #9

Start of error session.
L 12/21/2007 - 18:03:24: Info (map "aim_ak-colt2k3") (file "addons/amxmodx/logs/error_20071221.log")
L 12/21/2007 - 18:03:24: Function "unspec" was not found
L 12/21/2007 - 18:03:24: [AMXX] Displaying debug trace (plugin "Spec_Switch.amxx")
L 12/21/2007 - 18:03:24: [AMXX] Run time error 19: function not found
L 12/21/2007 - 18:03:24: [AMXX] [0] Spec_Switch.sma::plugin_init (line 19)

pls help!

AMXX v1.8.0.3660

sma:
#define PLUGIN "Spec Switch"
#define VERSION "0.0.5"
#define AUTHOR "many"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say spec", "spec")
register_clcmd("say_team spec", "spec")
register_clcmd("say unspec", "unspec")
register_clcmd("say_team unspec", "unspec")
}

and

public rule(id){
client_print(id,print_chat,"Type spec if you want to go Spectator")
client_print(id,print_chat,"Type unspec to return from Spectator")
}

EDIT: I found the error:

i changed

public back(id)

in

public unspec(id)

Last edited by Daniel1337; 12-21-2007 at 13:18.
Daniel1337 is offline
vl@d
Senior Member
Join Date: Dec 2006
Location: Romania
Old 12-21-2007 , 13:41   Re: Spec Switch
Reply With Quote #10

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <fun>

#define PLUGIN "Spec Switch"
#define VERSION "0.0.5"
#define AUTHOR "many"

new CsTeams:zTeam[33]
new 
zDeath[33]

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_clcmd("say /spec""spec")
    
register_clcmd("say_team /spec""spec")
    
register_clcmd("say /back""back")
    
register_clcmd("say_team /back""back")
}

public 
client_putinserver(id)
    
set_task(20.0,"rule",id)


public 
spec(id
{
    
zDeath[id] = cs_get_user_deaths(id)
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR) return 1;
    else
    
zTeam[id] = cs_get_user_team(id)
    
cs_set_user_team(idCS_TEAM_SPECTATOR)
    
user_kill(id1)
    return 
0;
}

public 
back(id
{
    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR)
    
cs_set_user_team(idzTeam[id])
    
cs_set_user_deaths(idzDeath[id])
    
set_task(0.2,"respawn",id)
    
set_task(0.4,"respawn",id)
}

public 
rule(id)
{
    
client_print(id,print_chat,"Type /spec if you want to go Spectator")
    
client_print(id,print_chat,"Type /back to return from Spectator")
}

public 
respawn(id)
{
    
cs_user_spawn(id)
    if (
cs_get_user_team(id) == CS_TEAM_T)
    {
        
give_item(id,"weapon_knife")
        
give_item(id,"weapon_glock18")
        
give_item(id,"ammo_9mm")
    }
    if (
cs_get_user_team(id) == CS_TEAM_CT)
    {
        
give_item(id,"weapon_knife")
        
give_item(id,"weapon_usp")
        
give_item(id,"ammo_45acp")
        
give_item(id,"ammo_45acp")
    }
    return 
0;

__________________


I hate Spammers....
vl@d is offline
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 03:12.


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