Thread: [Solved] PlayerSpawn Pre problems
View Single Post
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-25-2020 , 10:41   Re: PlayerSpawn Pre problems
Reply With Quote #5

You can try this, but I have no idea if it will work, so don't judge me.
PHP Code:
#include <amxmodx>
#include <fakemeta>

#if cellbits == 32
    #define OFFSET_TEAM 114
#else
    #define OFFSET_TEAM 139
#endif

const m_iTeam 114;
new 
g_Team[33]

public 
plugin_init()
{
    
RegisterHam(Ham_Spawn"player""PlayerSpawnPre"1);
}

public 
PlayerSpawnPre(id)
{
        if(
condition)
        {
            return 
HAM_SUPERCEDE
            g_Team
[id] = get_user_team(id)
            switch(
g_Team[id])
            {
                case 
1:
                {
                    
set_pdata_int(idOFFSET_TEAMTEAM_T);
                }
                case 
2:
                {
                    
set_pdata_int(idOFFSET_TEAMTEAM_CT);
                }
            }
        }
        return 
HAM_IGNORED
}

#if AMXX_VERSION_NUM < 190
public client_disconnect(id)
#else
public client_disconnected(id)
#endif
{
    
g_Team[id] = 0

Edit:
I got the idea from admin_freelook.sma here
Attached Files
File Type: sma Get Plugin or Get Source (admin_freelook.sma - 74 views - 3.4 KB)
__________________
Contact! || Discord:
Mr_Boopsy_#2066

Last edited by supertrio17; 06-25-2020 at 10:42.
supertrio17 is offline