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

transfer team


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 02-26-2018 , 16:55   transfer team
Reply With Quote #1

Code:
public HandleTransfer(id, menu, item)
{
    if(item == MENU_EXIT)
    {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
    
    new data[6], name[64]
    new access, callback
    
    menu_item_getinfo (menu, item, access, data, 5, name, 63, callback)
    new tempid = str_to_num (data)
    
    get_user_name(id, szName, 32)
    get_user_name(tempid, szPlayerName, 32)
    
    ColorChat(0, GREY, "%s ^4%s^3 just swapped ^4%s^3!", prefix, szName, szPlayerName)
    if(cs_get_user_team(id) == CS_TEAM_T)
    {
        cs_set_user_team(id, CS_TEAM_CT)
        ExecuteHamB(Ham_CS_RoundRespawn, tempid)
    }
    else if(cs_get_user_team(id) == CS_TEAM_CT)
    {
        cs_set_user_team(id, CS_TEAM_T)
        ExecuteHamB(Ham_CS_RoundRespawn, tempid)
    }
    CmdAdminMenu(id)
    
    return PLUGIN_CONTINUE
}
ok, so thats a part of a plugin that you can change your team from admin menu.. but this works only on you, so if you are CT and use adminmenu to swap yourself, it swaps you to T, or T to CT but if you use it on others, if he is CT he will swap to CT , if he is T he will swap to T, so if you use that on others players, it swaps to same team, how could i solve this?
__________________
a simple act of caring creates an endless ripple.
Nutu_ is offline
Paltimus
Junior Member
Join Date: Feb 2018
Location: German - Bomb site A
Old 02-28-2018 , 20:28   Re: transfer team
Reply With Quote #2

i think the problem is here !

change id to tempid to swap the target ! because you like respawn the target with this
PHP Code:
 ExecuteHamB(Ham_CS_RoundRespawntempid
you need also to change this to tempid

PHP Code:
 cs_set_user_team(tempidCS_TEAM_CT
Full code ! try this ..
PHP Code:
if(cs_get_user_team(tempid) == CS_TEAM_T)
    {
        
cs_set_user_team(tempidCS_TEAM_CT)
        
ExecuteHamB(Ham_CS_RoundRespawntempid)
    }
    else if(
cs_get_user_team(tempid) == CS_TEAM_CT)
    {
        
cs_set_user_team(tempidCS_TEAM_T)
        
ExecuteHamB(Ham_CS_RoundRespawntempid
Paltimus is offline
Nutu_
AlliedModders Donor
Join Date: Mar 2016
Location: Germany
Old 03-02-2018 , 09:50   Re: transfer team
Reply With Quote #3

it works, thank you
__________________
a simple act of caring creates an endless ripple.
Nutu_ 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 06:47.


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