Raised This Month: $ Target: $400
 0% 

Solved PlayerSpawn Pre problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-25-2020 , 10:41   Re: PlayerSpawn Pre problems
Reply With Quote #1

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 - 77 views - 3.4 KB)
__________________
Contact! || Discord:
Mr_Boopsy_#2066

Last edited by supertrio17; 06-25-2020 at 10:42.
supertrio17 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-25-2020 , 10:52   Re: PlayerSpawn Pre problems
Reply With Quote #2

Quote:
Originally Posted by supertrio17 View Post
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
Thank you for your effort, but it was only necessary to change the player's spawn to 1 in TeamInfo so that the engine doesn't spawn him.

PHP Code:
set_member(idm_iNumSpawns1
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 06-25-2020 at 10:53.
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 17:10.


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