existential crisis in csqc
Posted: Tue Jun 05, 2018 7:09 am
Since the stats are limited in darkplaces I decided to use entities to replace that information I need in csqc.
so
1-i spawn a temp entity in ssqc with some data and i send it to csqc
2- I use that data to display images in player GUI
2- the entity is deleted in csqc and ssqc
this works very well, but as you will immediately notice the problem: that data is used by all players!! Then I felt like an idiot when I saw that in multiplayer all the players were shown messages on the screen.
In csqc_updateview i have
And the "draw2d" is what does the work (the work of display images in screen). I thought about assigning an owner to that entity, but this is possible? i mean
1-the entity spawns in ssqc with a player as "owner" and is sent to csqc
2- ONLY the player-owner of the entity can use that data
It is possible?
What I want to do, basically it is to use entities in csqc but that only affect one player, the original owner in ssqc of those entities.
thank you very much
so
1-i spawn a temp entity in ssqc with some data and i send it to csqc
2- I use that data to display images in player GUI
2- the entity is deleted in csqc and ssqc
this works very well, but as you will immediately notice the problem: that data is used by all players!! Then I felt like an idiot when I saw that in multiplayer all the players were shown messages on the screen.
In csqc_updateview i have
Code: Select all
entity e;
e = self;
for(self = world; (self = nextent(self)); )
if(self.draw2d)
self.draw2d();
self = e;
1-the entity spawns in ssqc with a player as "owner" and is sent to csqc
2- ONLY the player-owner of the entity can use that data
It is possible?
What I want to do, basically it is to use entities in csqc but that only affect one player, the original owner in ssqc of those entities.
thank you very much