AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved pev_groupinfo thing (https://forums.alliedmods.net/showthread.php?t=312056)

JocAnis 11-14-2018 12:34

pev_groupinfo thing
 
hello. im making an invisible entity at the same origin (and mins+maxs) as an existing in the map (doors, and that doors became SOLID_NOT )
what is the problem?
i want to make it, when player1 uses button which triggers that door -> make it non-solid to player1 (but remain solid to everyother players)...so in that case im using: pev_groupinfo by id
but its not working well...its changing solidiy to all players not to only one...can anyone help?

using this:
PHP Code:

set_peventpev_groupinfopeventpev_groupinfo ) | id 

later making 4.0 delay to reset that entity to the same player:
Code:

set_pev( ent , pev_groupinfo, pev( ent, pev_groupinfo ) & ~id )
its all happening, but not for one player but to all players

NiHiLaNTh 11-14-2018 16:34

Re: pev_groupinfo thing
 
I believe that instead of "| id and & ~id" you must use something like this
Code:

set_pev( ent, pev_groupinfo, pev( ent, pev_groupinfo ) | ( 1<<(id & 31) )
Same idea for resetting the entity.

JocAnis 11-14-2018 16:53

Re: pev_groupinfo thing
 
hmm i have 0 knowledge about bitsums, so i have seen it here: https://forums.alliedmods.net/showpo...2&postcount=14 (and even one more link which explained how to unreset/reset)

i would be really happy if that's working..gonna test soon

JocAnis 11-14-2018 18:00

Re: pev_groupinfo thing
 
its fixed now...Kusfield and i went with this adventure, with many combinations of bits, and finally came to solution, when you have more entities:

PHP Code:

//on players spawn:
set_pevidpev_groupinfo0xFFFFFFFF )

//when creating entity:
set_peventpev_groupinfo1<<current_ent )
//g_ent[ current_ent++ ] blabla

//set solid_not to that one entity for player1: Must be reversed bit than the entity's 
set_pevidpev_groupinfo, ~(1<<CURRENT_ENT_BIT) )

//to make it solid again for player1:
set_pevidpev_groupinfo0xFFFFFFFF 


NiHiLaNTh 11-16-2018 02:30

Re: pev_groupinfo thing
 
What is CURRENT_ENT_BIT?

JocAnis 11-16-2018 08:29

Re: pev_groupinfo thing
 
you must somehow catch that entity's bit, created with:

PHP Code:

//when creating entity:
set_peventpev_groupinfo1<<current_ent )
//g_ent[ current_ent++ ] blabla 


klippy 11-16-2018 08:41

Re: pev_groupinfo thing
 
IF ent1.groupinfo != 0 AND ent2.groupinfo != 0 AND ent1.groupinfo & ent2.groupinfo == 0 ==> ent1 and ent2 can't interact (see or collide). That's all there is to it. How you are going to use that is up to you.


All times are GMT -4. The time now is 06:48.

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