Raised This Month: $51 Target: $400
 12% 

Move player from SPEC to TEAM


Post New Thread Reply   
 
Thread Tools Display Modes
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-02-2018 , 12:16   Re: Move player from SPEC to TEAM
Reply With Quote #21

Huh? You guys have issue that the hud is not displayed correctly?

Then im here. What would be cause of that issue other than the SUIT. give it to player.

entity_set_int(PlayerID, EV_INT_weapons, entity_get_int(PlayerID, EV_INT_weapons) | (1 << 31));
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
jonatat
Senior Member
Join Date: Dec 2017
Old 07-02-2018 , 12:30   Re: Move player from SPEC to TEAM
Reply With Quote #22

Quote:
Originally Posted by Ghosted View Post
Huh? You guys have issue that the hud is not displayed correctly?

Then im here. What would be cause of that issue other than the SUIT. give it to player.

entity_set_int(PlayerID, EV_INT_weapons, entity_get_int(PlayerID, EV_INT_weapons) | (1 << 31));
Looks good, but no make sense. I buy like a example: DEAGLE and if i set sv_Restartround 1 i still got deagle
jonatat is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-02-2018 , 12:39   Re: Move player from SPEC to TEAM
Reply With Quote #23

Quote:
Originally Posted by jonatat View Post
Looks good, but no make sense. I buy like a example: DEAGLE and if i set sv_Restartround 1 i still got deagle
If force player to call jointeam?

engclientcmd(PlayerID, "jointeam", Team == 2 ? "2" : "1");

& Then call respawn

[Can You Post Code Which Are You Using Right Now?]
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM

Last edited by Ghosted; 07-02-2018 at 12:42.
Ghosted is offline
jonatat
Senior Member
Join Date: Dec 2017
Old 07-02-2018 , 12:45   Re: Move player from SPEC to TEAM
Reply With Quote #24

Quote:
Originally Posted by Ghosted View Post
If force player to call jointeam?

engclientcmd(PlayerID, "jointeam", Team == 2 ? "2" : "1");

& Then call respawn

[Can You Post Code Which Are You Using Right Now?]

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

#pragma semicolon 1

#define PLUGIN     "Weird Replacement"
#define VERSION "1.0a"

#define MAX_PLAYERS 32

public plugin_init( ) 
{
    
register_pluginPLUGINVERSION"maqi" );
    
    
register_clcmd"say /move",         "Cmd_Move" );
    
register_clcmd"say_team /move",     "Cmd_Move" );
}

public 
Cmd_MoveiIndex )
{
    if( 
cs_get_user_teamiIndex ) != CS_TEAM_T && cs_get_user_teamiIndex ) != CS_TEAM_CT )
        return 
PLUGIN_CONTINUE;
        
    
Show_ReplacementMenuiIndex );
    
    return 
PLUGIN_HANDLED;
}

Show_ReplacementMenuiIndex )
{
    new 
iMenu menu_create"\rReplacement Menu""Handle_ReplacementMenu" );
     
    new 
iPlayers[MAX_PLAYERS], iNumget_playersiPlayersiNum"h" );
    
    new 
sUserID[32], sName[32];
    
    new 
iSpecCounter 0;
    for( new 
0iNumi++ )
    {
        if( 
cs_get_user_teamiPlayers[i] ) != CS_TEAM_SPECTATOR 
            continue;
        
        
get_user_nameiPlayers[i], sNamecharsmax(sName) );
        
formatexsUserIDcharsmax(sUserID), "%d"get_user_useridiPlayers[i] ) );
        
iSpecCounter++;
        
        
menu_additemiMenusNamesUserID);            
    }
    
    if( !
iSpecCounter )
        
client_printiIndexprint_chat"[%s] There aren't any spectators at the moment"PLUGIN );
    else
        
menu_displayiIndexiMenu);
}

public 
Handle_ReplacementMenuiIndexiMenuiItem )
{
    if ( 
iItem == MENU_EXIT )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    if( 
cs_get_user_teamiIndex ) != CS_TEAM_T && cs_get_user_teamiIndex ) != CS_TEAM_CT )
    {
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    new 
sUserID[32], sName[32], sTargetName[32];
    new 
useless1useless2;
    
    
menu_item_getinfoiMenuiItemuseless1sUserIDcharsmaxsUserID ), sTargetNamecharsmaxsTargetName ), useless2 );

    new 
iTarget find_player"k"str_to_numsUserID ) );
    
    if( !
iTarget || !is_user_connectediTarget ) || cs_get_user_teamiTarget ) != CS_TEAM_SPECTATOR || iTarget == iIndex )
    {
        
client_printiIndexprint_chat"[%s] There was an error finding a selected player!"PLUGIN );
        
menu_destroyiMenu );
        return 
PLUGIN_HANDLED;
    }
    
    
cs_set_user_teamiTargetcs_get_user_teamiIndex ) );
entity_set_int(iTargetEV_INT_weaponsentity_get_int(iTargetEV_INT_weapons) | (<< 31));
    
server_cmd"kick #%d ^"You sucesfully replaced yourself!^""get_user_useridiIndex ) );
    
    
get_user_nameiIndexsNamecharsmax(sName) );
    
client_printiIndexprint_chat"[%s] %s was switched with %s"PLUGINsNamesTargetName );
    
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;

Thanks for helping me guys!
jonatat is offline
maqi
Senior Member
Join Date: Apr 2017
Location: Serbia
Old 07-02-2018 , 13:01   Re: Move player from SPEC to TEAM
Reply With Quote #25

I still have no idea why that is happening, I don't play cs all that much, but Ghosted had a good idea,

Change:
Code:
cs_set_user_team( iTarget, cs_get_user_team( iIndex ) );
--->
Code:
engclient_cmd( iTarget, "jointeam", cs_get_user_team( iIndex ) == CS_TEAM_T ? "1" : "2");
Also delete this line if its not working

Code:
entity_set_int(iTarget, EV_INT_weapons, entity_get_int(iTarget, EV_INT_weapons) | (1 << 31));
__________________
stuff

Last edited by maqi; 07-02-2018 at 13:01.
maqi is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-03-2018 , 03:01   Re: Move player from SPEC to TEAM
Reply With Quote #26

This happen because event on player first join best solution is to transfer him by executing jointeam & joinclass commands.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
jonatat
Senior Member
Join Date: Dec 2017
Old 07-03-2018 , 04:18   Re: Move player from SPEC to TEAM
Reply With Quote #27

Thanks guys i will try it!
jonatat is offline
jonatat
Senior Member
Join Date: Dec 2017
Old 07-03-2018 , 05:34   Re: Move player from SPEC to TEAM
Reply With Quote #28

Working like a charm. But i need manualy select class. Can i add something like that maybe?

PHP Code:
engclient_cmdiTarget"jointeam"cs_get_user_teamiIndex ) == CS_TEAM_T "1" "2");
engclient_cmdiTarget"joinclass""1"); 
?

Last edited by jonatat; 07-03-2018 at 05:34.
jonatat is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 07-03-2018 , 06:18   Re: Move player from SPEC to TEAM
Reply With Quote #29

Quote:
Originally Posted by jonatat View Post
Working like a charm. But i need manualy select class. Can i add something like that maybe?

PHP Code:
engclient_cmdiTarget"jointeam"cs_get_user_teamiIndex ) == CS_TEAM_T "1" "2");
engclient_cmdiTarget"joinclass""1"); 
?
Then i think u must call joinclass without paramter ("1"); ("5" = random);
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 07-03-2018 , 06:28   Re: Move player from SPEC to TEAM
Reply With Quote #30

PHP Code:
setUserTeam(idszTeam[2])
{
    
engclient_cmd(id"jointeam"szTeam)
    
engclient_cmd(id"joinclass""5")

iceeedr is offline
Send a message via Skype™ to iceeedr
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 09:39.


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