Raised This Month: $32 Target: $400
 8% 

Solved PlayerSpawn Pre problems


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-24-2020 , 16:23   PlayerSpawn Pre problems
Reply With Quote #1

Hello, I have a small problem with no solution so far, I registered playerspawn (ham) as pre and after checking the conditions I return SUPERCEDE the function.

The problem is that the player goes into "free camera" mode and I would like the camera to conform to the standard, which is to get killed with the spec camera on the team's players, I tried with set_view, but it seems that this was not the solution, any ideas?

PHP Code:
public PlayerSpawnPre(id)
{
        if(
condition)
        {
                return 
HAM_SUPERCEDE
        
}
        return 
HAM_IGNORED

__________________


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:52.
iceeedr is offline
Send a message via Skype™ to iceeedr
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-25-2020 , 03:55   Re: PlayerSpawn Pre problems
Reply With Quote #2

Do you want to prevent people from spawning on new round? If not, why are you blocking Spawn?
__________________
HamletEagle is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 06-25-2020 , 08:46   Re: PlayerSpawn Pre problems
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
Do you want to prevent people from spawning on new round? If not, why are you blocking Spawn?
Exactly! I want that round (if the requirements of the if condition are met) he doesn't spawn.
__________________


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/
iceeedr is offline
Send a message via Skype™ to iceeedr
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-25-2020 , 10:18   Re: PlayerSpawn Pre problems
Reply With Quote #4

Hm, I get the point, I will try to find a way to overcome this issue.
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
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 - 71 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 #6

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


Thread Tools
Display Modes

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:54.


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