Raised This Month: $ Target: $400
 0% 

/spec Plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Psyfire
Senior Member
Join Date: Jan 2006
Old 06-06-2007 , 14:05   /spec Plugin
Reply With Quote #1

Hello,

I need a plugin where you can type /spec in the chat. Then you will be switched to spectator mode. If you are in any team, CT or T, you get +1 death btw you die. Is there any possibility to stop this? That you are able to switch from CT to spec without dying?

Is there any possibility to get the weapon back? Like when you got a AWP and you type /spec you will be switched to spec mode. And if you want to go back to your team, you type /spec again and you get your AWP back.
Psyfire is offline
kmal2t
BANNED
Join Date: Apr 2006
Old 06-06-2007 , 18:49   Re: /spec Plugin
Reply With Quote #2

just use these:
Code:
cs_get_user_deaths( index , variable) //include cstrike
cs_set_user_deaths( index, variable - 1)
get_user_weapons ( index, weapons[32], &num )
give_item ( index, const item[] ) //include fun
kmal2t is offline
Psyfire
Senior Member
Join Date: Jan 2006
Old 06-06-2007 , 19:21   Re: /spec Plugin
Reply With Quote #3

Sorry I'm not a coder. I cant use this lines of code. Can you add this to an own script that got the features from my mainpost? Would be really nice :-)
Psyfire is offline
Styles
Veteran Member
Join Date: Jul 2004
Location: California
Old 06-07-2007 , 03:19   Re: /spec Plugin
Reply With Quote #4

Heres a start.. Probally doesn't work. its 12:18 here im dead tired (midnight)

if another person could finish by 2morow that would be great.
Code:
#include <amxmodx> #include <cstrike> #include <fun> #define PLUGIN "Spec Plugin" #define VERSION "1.0" #define AUTHOR "Styles" new weapons[32], teamChanged[32], giveWeapons[32], num[32] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("say /spec", "spectator")     register_event("TeamInfo", "func_Change", "b")     register_logevent("round_start", 2, "1=Round_Start") } public spectator(id) {     if(teamChanged[id])         return PLUGIN_HANDLED     new deaths     deaths = cs_get_user_deaths(id)     cs_set_user_deaths(id, deaths - 1)     get_user_weapons(id, weapons, num[id])     cs_set_user_team(id, CS_TEAM_SPECTATOR)     teamChanged[id] = true     return PLUGIN_HANDLED } public func_Change(id) {     if(!teamChanged[id])         return PLUGIN_HANDLED     teamChanged[id] = false     if(!is_user_alive(id))     {         giveWeapons[id] = true         return PLUGIN_HANDLED     }     /* Not Done */     for(new b=0; 0 < num[id];b++)     {         give_item(id, weapons[id])     }     return PLUGIN_HANDLED } public round_start(id) {     if(!giveWeapons[id])         return PLUGIN_HANDLED     /* Not Done */     for(new b=0; 0 < num[id];b++)     {         give_item(id, weapons[id])     }     giveWeapons[id] = false         return PLUGIN_HANDLED }

Last edited by Styles; 06-07-2007 at 03:25.
Styles is offline
Send a message via AIM to Styles
Psyfire
Senior Member
Join Date: Jan 2006
Old 06-07-2007 , 05:46   Re: /spec Plugin
Reply With Quote #5

I tested it.

1. If you type /spec you wont be switched.
2. After I typed it, I was on the scoreboard on Spectator, but I could play as CT with my weapon and so on. Even nothing happened.
3. Can you add, that when you type /spec again, you will be switched to the old team? Cause this didnt work too...
Psyfire is offline
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-07-2007 , 07:41   Re: /spec Plugin
Reply With Quote #6

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

#define PLUGIN "Spec Plugin"
#define VERSION "1.0"
#define AUTHOR "Styles"

new teamChanged[32]

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    register_clcmd("say /spec", "spectator")
}

public spectator(id)
{
    if(teamChanged[id])
        return PLUGIN_HANDLED
    new deaths
    deaths = cs_get_user_deaths(id)
    cs_set_user_deaths(id, deaths - 1)
    cs_set_user_team(id, CS_TEAM_SPECTATOR)
    user_silentkill(id)
    return PLUGIN_HANDLED
}
user_silentkill(id)

Last edited by Juba_PornBorn; 06-07-2007 at 07:58.
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-07-2007 , 08:10   Re: /spec Plugin
Reply With Quote #7

This works fine...
Only the backpackammo isn't restored...if anyone want that..he should do himself

*edit* plugin is in the last post... *edit*
greetz regalis
__________________

Last edited by regalis; 06-07-2007 at 11:13.
regalis is offline
Juba_PornBorn
BANNED
Join Date: Apr 2007
Location: Caracas
Old 06-07-2007 , 08:16   Re: /spec Plugin
Reply With Quote #8

nice work regalis!
Juba_PornBorn is offline
Send a message via MSN to Juba_PornBorn
Old 06-07-2007, 08:29
regalis
This message has been deleted by regalis. Reason: blub
regalis
Veteran Member
Join Date: Jan 2007
Location: F*cking Germany
Old 06-07-2007 , 11:14   Re: /spec Plugin
Reply With Quote #10

Now its perfect
You get the weapons which you got before the say /spec command..
http://forums.alliedmods.net/showthread.php?t=56132

Have fun
__________________

Last edited by regalis; 06-07-2007 at 11:32. Reason: ops :P
regalis is offline
Reply



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 22:42.


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