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

Assign to an entity a team.


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-03-2017 , 13:59   Re: Assign to an entity a team.
Reply With Quote #11

Post your code. If it does not work, likely you are doing something wrong.
__________________
HamletEagle is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-03-2017 , 15:04   Re: Assign to an entity a team.
Reply With Quote #12

Quote:
Originally Posted by Craxor View Post
It has no effect.

In death msg:
PHP Code:
    new cTeam peviV pev_team );
    
set_peviEnt pev_team cTeam ); 
In touch_forward:
PHP Code:
        if( equalszClassnamegHealthEntity) && pevidpev_team ) == peviEntpev_team ) ) 
What is iV? iVictim??? wtf... so:
PHP Code:
set_pev(entpev_teamget_user_team(victim)); 
And:
PHP Code:
if (equal(classnameHealthEntityClassname) && get_user_team(player) == pev(entpev_team)) 
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-03-2017 , 15:25   Re: Assign to an entity a team.
Reply With Quote #13

Postetam it simple works thanks man.

Wtf is returning pev( id , pev_team ) ??? that's why wasn't working ..
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
SpannerSpammer
Member
Join Date: Mar 2006
Old 01-04-2017 , 01:44   Re: Assign to an entity a team.
Reply With Quote #14

Quote:
Originally Posted by Craxor View Post
Wtf is returning pev( id , pev_team ) ??? that's why wasn't working ..
CS doesn't use the pev->team entity variable, it uses a private data offset to store players team numbers.

EDIT: Sorry, I meant to say that CS uses a custom entity variable for team (and armortype, offset=112)
that you have to use private data offsets to access.

Alternatively you could get a player's team number in CS directly like this:
new iTeam = get_pdata_int( id, 114, 5 ) or just get_pdata_int( id, 114 )
since 5 is the default Linux offset.
__________________
[NeoTF|DEV]SpannerSpammer-[AoE]-
NeoTF Development Team.
http://steamcommunity.com/groups/neotf

Last edited by SpannerSpammer; 01-04-2017 at 17:11. Reason: Clarification
SpannerSpammer is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 01-04-2017 , 06:44   Re: Assign to an entity a team.
Reply With Quote #15

thanks Spammer
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
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 08:42.


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