Raised This Month: $ Target: $400
 0% 

[HELP]Return user to team.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
ShLuMieL
Senior Member
Join Date: Jul 2010
Old 01-02-2014 , 09:37   [HELP]Return user to team.
Reply With Quote #1

Hello to All

I made this plugin and I dont know how to do something.

Description:
If someone die it will open for him menu that asks if he want to go to spectator until next round
if yes its move him to spectator team and strip his weapons and set him invisable

and I need that will return the player to the same team he was when the round end, this is possible?
if someone know how tell me please
Thank's.

PHP Code:
/* Plugin generated by AMXX-Studio */ 

#include <amxmodx> 
#include <amxmisc> 
#include <hamsandwich> 
#include <cstrike> 
#include <fun> 
#include <fakemeta>  
#include <engine>

#define PLUGIN "Invisible Spectator" 
#define VERSION "1.0" 
#define AUTHOR "author" 

#define cm(%0)    ( sizeof(%0) - 1 )  

const m_afButtonPressed 246;  

new 
HamHook:g_iHhCBasePlayerObjectCaps;  

public 
plugin_init() { 
    
register_plugin(PLUGINVERSIONAUTHOR
    
    
// Add your code here... 
    
    
RegisterHam(Ham_Spawn"player""FwdPlayerSpawn"1); 
    
register_event("DeathMsg""EventDeathMsg""a" );
    
DisableHamForward(g_iHhCBasePlayerObjectCaps RegisterHam(Ham_ObjectCaps"player""OnCBasePlayer_ObjectCaps"false));
    
    
register_touch("weaponbox""player""");
    
register_touch("armoury_entity""player""");
    
register_touch("weapon_shield""player""");


public 
FwdPlayerSpawn(id

    if(
cs_get_user_team(id) == CS_TEAM_SPECTATOR
    {
        
set_task(0.3"REMOVESPECA"id
    } 


public 
EventDeathMsg(id)
{
    new 
killer read_data);
    new 
victim read_data);
    
    if( 
killer == victim || ! is_user_connectedkiller ) || ! is_user_connectedvictim ) )
    {
        return 
PLUGIN_HANDLED;
        
//return;
    
}
    
    
SpecVictim(victim)
    
    return 
PLUGIN_HANDLED;
}

public 
SpecVictim(id)
{
    new 
menu menu_create("\y[ \rInvisivle Spector \y] \wDo you want to go to Spector Team until this round end?""SpecVictim_Handler" );
    
menu_additem(menu"Yes"""0);
    
menu_additem(menu"No"""0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL );
    
menu_display(idmenu);
    
    return 
PLUGIN_HANDLED;
}

public 
SpecVictim_Handler(idmenuitem
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    switch(
item)
    {
        case 
0:
        {
            if (!
is_user_alive(id))
            {
                
ExecuteHam(Ham_CS_RoundRespawn,id);
                
cs_set_user_team(idCS_TEAM_SPECTATOR)
                
set_task(0.3"REMOVESPECA"id
            }
        }
    }
    
    return 
PLUGIN_HANDLED;
}

public 
REMOVESPECA(id
{
    
set_user_rendering(idkRenderFxGlowShell000kRenderTransAlpha0)
    
set_user_godmode(id1)
    
strip_user_weapons(id)
    
EnableHamForward(g_iHhCBasePlayerObjectCaps);  
}

public 
OnCBasePlayer_ObjectCaps(id)  
{  
    new 
buttons pev(idpev_button);  
    if( 
buttons IN_USE )  
    {  
        
set_pev(idpev_buttonbuttons & ~IN_USE);  
    }  
    
buttons get_pdata_int(idm_afButtonPressed);  
    if( 
buttons IN_USE )  
    {  
        
set_pdata_int(idm_afButtonPressedbuttons & ~IN_USE);  
    }  
    return 
HAM_HANDLED;  


Last edited by ShLuMieL; 01-02-2014 at 09:38.
ShLuMieL 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 10:13.


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