AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   How to get a player's entityid (https://forums.alliedmods.net/showthread.php?t=217941)

1023168216 06-09-2013 11:13

How to get a player's entityid
 
if i have a Bot player's index,how can i get the player' entity id by his index???
Another problem:
new Float:vec[3]
Then how can i get the map special area's origin?for example:bomb area's origin

President 06-09-2013 13:41

Re: How to get a player's entityid
 
Quote:

Originally Posted by 1023168216 (Post 1967443)
if i have a Bot player's index,how can i get the player' entity id by his index???

What?

Quote:

Originally Posted by 1023168216 (Post 1967443)
Another problem:
new Float:vec[3]
Then how can i get the map special area's origin?for example:bomb area's origin

PHP Code:

#include <engine>
public Find_Bomb_Area_Origins()
{
      new 
ent = -1;
      while((
ent find_ent_by_class(ent"func_bombsite")))
      {
            new 
Float:vec[3];
            
entity_get_vector(entEV_VEC_originvec);
      }



YamiKaitou 06-09-2013 16:02

Re: How to get a player's entityid
 
Quote:

Originally Posted by 1023168216 (Post 1967443)
if i have a Bot player's index,how can i get the player' entity id by his index???

A Player's Index is their Entity ID

1023168216 06-16-2013 22:45

Re: How to get a player's entityid
 
but "entity_get_vector" cant get its origin:
Code:

public get_origin(id) {
    new Float:vec[3], numofbombsite = 0
    new ent_bombsite = find_ent( -1, "func_bomb_target" )
    while ( ent_bombsite > 0 ) {
          entity_get_vector( ent_bombsite, EV_VEC_origin, vec )
          client_print(id, print_chat, "func_bomb_target:%d, %f %f %f", ent_bombsite, vec[0], vec[1], vec[2])
          ent_bombsite = find_ent( ent_bombsite, "func_bomb_target" )
          numofbombsite ++
    }
}


fysiks 06-17-2013 00:53

Re: How to get a player's entityid
 
Quote:

Originally Posted by 1023168216 (Post 1971764)
but "entity_get_vector" cant get its origin:
Code:

public get_origin(id) {
    new Float:vec[3], numofbombsite = 0
    new ent_bombsite = find_ent( -1, "func_bomb_target" )
    while ( ent_bombsite > 0 ) {
          entity_get_vector( ent_bombsite, EV_VEC_origin, vec )
          client_print(id, print_chat, "func_bomb_target:%d, %f %f %f", ent_bombsite, vec[0], vec[1], vec[2])
          ent_bombsite = find_ent( ent_bombsite, "func_bomb_target" )
          numofbombsite ++
    }
}


What does that code have to do with a player id?

1023168216 07-19-2013 05:58

Re: How to get a player's entityid
 
it doesn't work,it show that the index of the bombsite is 0
Quote:

Originally Posted by fysiks (Post 1971803)
What does that code have to do with a player id?



All times are GMT -4. The time now is 16:19.

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