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

Invalid player 2-3


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 12-13-2020 , 14:40   Invalid player 2-3
Reply With Quote #1

Hi i have debug a plugin and it's make invalid player 2 / 3 this is the part of script line 23
line 23 is if( cs_get_user_team( Team ) == 1 )
Code:
public DeathMsg( )
{
	new Victim = read_data( 2 )
	new Team = cs_get_user_team( Victim )
	if( !bb_is_build_phase( ) && !bb_is_prep_phase( ) )
	{
		if( Team != 0 ){
			if( cs_get_user_team( Team ) == 1 )
				DeleteBlock( 1, Victim, Team )
		else DeleteBlock( 2, Victim, 0 )
		}
	}
}
Code:
[CSTRIKE] Invalid player 2
[AMXX] Displaying debug trace (plugin "testing")
[AMXX] Run time error 10: native error (native "cs_get_user_team")
maybe it need check if user connected/disconected?
eNNkds is offline
Send a message via Skype™ to eNNkds
thEsp
BANNED
Join Date: Aug 2017
Old 12-13-2020 , 14:48   Re: Invalid player 2-3
Reply With Quote #2

Quote:
Returns the client's team and optionally the model id.


You have to check whatever you need directly with the stored variable Team.

Last edited by thEsp; 12-13-2020 at 14:49. Reason: Restore to previous version.
thEsp is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-13-2020 , 15:37   Re: Invalid player 2-3
Reply With Quote #3

Check if the client is connected before using the function.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 12-13-2020 , 15:46   Re: Invalid player 2-3
Reply With Quote #4

You had Team where Victim should have gone. Since Team = cs_get_user_team( Victim ), use it.
Code:
public DeathMsg( ) {     new Victim = read_data( 2 )     new Team = cs_get_user_team( Victim )     if( !bb_is_build_phase( ) && !bb_is_prep_phase( ) && Team != 0 )     {         if( Team == 1 )             DeleteBlock( 1, Victim, Team )         else             DeleteBlock( 2, Victim, 0 )     } }
__________________

Last edited by DJEarthQuake; 12-13-2020 at 15:59. Reason: Elaborate
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 12-13-2020 , 16:01   Re: Invalid player 2-3
Reply With Quote #5

new CsTeams:Team
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 12-13-2020 , 16:12   Re: Invalid player 2-3
Reply With Quote #6

Now i get it. it's working for the moment no logs thank you!
eNNkds is offline
Send a message via Skype™ to eNNkds
eNNkds
Member
Join Date: Sep 2012
Location: Romania
Old 12-23-2020 , 14:29   Re: Invalid player 2-3
Reply With Quote #7

some times have delete it wrong.

its for basebuilder mod 6.5
T can't build.
need adjust when ct kill a t , some time delete for ct without die

need to check if T attacker and Ct is victim = deleteblock or if CT victim and revive at T team =deleteblock
eNNkds is offline
Send a message via Skype™ to eNNkds
lexzor
Veteran Member
Join Date: Nov 2020
Old 12-23-2020 , 21:37   Re: Invalid player 2-3
Reply With Quote #8

PHP Code:
public DeathMsg( )
{
    new 
Victim read_data)
    new 
CsTeams:Team cs_get_user_teamVictim )

    if( !
bb_is_build_phase( ) && !bb_is_prep_phase( ) && Team != )

    {
        if( !
is_user_alive(Victim) ) return PLUGIN_HANDLED
        
if( Team == CS_TEAM_T )
            
DeleteBlock1VictimTeam )
        else
            
DeleteBlock2Victim)
    }


Last edited by lexzor; 12-23-2020 at 21:38.
lexzor is offline
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:26.


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