get an entity´s position


(LION) #1

hey i got a little question:
i want to go through all clients and check a few things and if they pass the check then get their position


for (k = 0; k < level.numConnectedClients;k++) {		
 gclient_t *ftleader = &level.clients[level.sortedClients[k]];				
 if ( ( ftleader != client) && (ftleader->sess.sessionTeam == client->sess.sessionTeam) &&
                            (ftleader->ps.stats[STAT_PLAYER_CLASS] == PC_COVERTOPS) ) {
     VectorCopy(ftleader->ps.origin,ftleader_pos); //vec3_t
				
			}
}

could this work?


(Jaquboss) #2

eh?
i don’t get what you really need, but this will copy all cvops of client’s team ( except him ) to ftleader_pos
and it will be overwritten by the last one
maybe you should say more about thing you want


(LION) #3

jep ok
what i want is following:

look if theres one client which is in players team, not the player and a covert ops
if there is one spawn at his position…thats roughly what i want


(LION) #4

does anyone have an idea??