AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Need help with cs_get_user_team (https://forums.alliedmods.net/showthread.php?t=311836)

rtpg6 11-04-2018 10:47

Need help with cs_get_user_team
 
Hello, i want to do the granades pickup only for T but when im doing that its good but i have logs

Code:

L 11/04/2018 - 16:44:17: [AMXX]    [0] csnadedrops.sma::pfn_touch (line 176)
L 11/04/2018 - 16:44:17: [CSTRIKE] Player out of range (149)
L 11/04/2018 - 16:44:17: [AMXX] Displaying debug trace (plugin "csnadedrops.amxx")
L 11/04/2018 - 16:44:17: [AMXX] Run time error 10: native error (native "cs_get_user_team")
L 11/04/2018 - 16:44:17: [AMXX]    [0] csnadedrops.sma::pfn_touch (line 176)

Can someone help me with that??
Line 175
Code:

public pfn_touch(ptr,ptd)

OciXCrom 11-04-2018 14:22

Re: Need help with cs_get_user_team
 
Check if the user is connected before retreiving his team.

rtpg6 11-05-2018 05:53

Re: Need help with cs_get_user_team
 
Quote:

Originally Posted by OciXCrom (Post 2622599)
Check if the user is connected before retreiving his team.

Still this same or i do something wrong

iceeedr 11-05-2018 08:26

Re: Need help with cs_get_user_team
 
???
Code:

if (!is_user_alive(ptd), cs_get_user_team(ptd) == 1)
change to
Code:

if (!is_user_alive(ptd) || cs_get_user_team(ptd) == CS_TEAM_T)

rtpg6 11-05-2018 13:24

Re: Need help with cs_get_user_team
 
Quote:

Originally Posted by iceeedr (Post 2622735)
???
Code:

if (!is_user_alive(ptd), cs_get_user_team(ptd) == 1)
change to
Code:

if (!is_user_alive(ptd) || cs_get_user_team(ptd) == CS_TEAM_T)

Thanks man

Bugsy 11-05-2018 18:02

Re: Need help with cs_get_user_team
 
You want to do something if a player is terrorist, right.

Use this
PHP Code:

if ( is_user_aliveptd ) && cs_get_user_teamptd ) == CS_TEAM_T )
{



What iceeedr gave you says this, which makes no sense:
If ( player is dead OR is terrorist )

iceeedr 11-05-2018 18:10

Re: Need help with cs_get_user_team
 
Sorry busy, reading again the code I focus only on the error on ",", my mistake.


All times are GMT -4. The time now is 01:15.

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