AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   AddToFullPack set_es() for player team? (https://forums.alliedmods.net/showthread.php?t=87693)

Owyn 03-15-2009 11:25

AddToFullPack set_es() for player team?
 
how can i change player team with set_es() so i can addtofullpack?

TheRadiance 03-15-2009 11:31

Re: AddToFullPack set_es() for player team?
 
It's very interesting for me to, because i'm noob in fakemeta :)
Waiting for an answer of more professional scripter :)

xPaw 03-15-2009 12:12

Re: AddToFullPack set_es() for player team?
 
Quote:

HOST - Receiver
ENT - Sender
so you can do like
PHP Code:

if( get_user_team(ent) == ) {
    
// ...



ConnorMcLeod 03-15-2009 12:18

Re: AddToFullPack set_es() for player team?
 
Not sure it would work on cs, but you can try to set ES_Team

Owyn 03-15-2009 12:32

Re: AddToFullPack set_es() for player team?
 
Quote:

Originally Posted by ConnorMcLeod (Post 781177)
Not sure it would work on cs, but you can try to set ES_Team

set_es(es_handle, ES_Team, "1");


looks like working but server still sends correct information about player team =\

MeRcyLeZZ 03-16-2009 23:18

Re: AddToFullPack set_es() for player team?
 
Quote:

Originally Posted by .Owyn.
looks like working but server still sends correct information about player team =\

If you want this for CS, you should instead send a TeamInfo message like this:
Code:
message_begin( MSG_BROADCAST, get_user_msgid("TeamInfo") ) write_byte( 5 ) // player index write_string( "CT" ) // team: "UNASSIGNED", "TERRORIST", "CT", or "SPECTATOR" message_end( )

Note that the actual player's team will not be changed. For that you have to set the corresponding offset ( set_pdata_int( id, 114, team ) ).

Also, you can use the destination MSG_ALL if you want the team message to be reliable (i.e. always arrive to clients). Be careful about sending too many reliable messages at once though: you can easily overflow clients or even crash the server!


All times are GMT -4. The time now is 08:50.

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