Raised This Month: $ Target: $400
 0% 

How to get a player's entityid


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
1023168216
Member
Join Date: Jun 2013
Location: Tokyo
Old 06-09-2013 , 11:13   How to get a player's entityid
Reply With Quote #1

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
1023168216 is offline
President
Member
Join Date: May 2013
Old 06-09-2013 , 13:41   Re: How to get a player's entityid
Reply With Quote #2

Quote:
Originally Posted by 1023168216 View Post
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 View Post
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);
      }


Last edited by President; 06-09-2013 at 13:42.
President is offline
1023168216
Member
Join Date: Jun 2013
Location: Tokyo
Old 06-16-2013 , 22:45   Re: How to get a player's entityid
Reply With Quote #3

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 ++
    }
}

Last edited by 1023168216; 06-16-2013 at 22:47. Reason: it doesnt show my message
1023168216 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-17-2013 , 00:53   Re: How to get a player's entityid
Reply With Quote #4

Quote:
Originally Posted by 1023168216 View Post
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?
__________________
fysiks is offline
1023168216
Member
Join Date: Jun 2013
Location: Tokyo
Old 07-19-2013 , 05:58   Re: How to get a player's entityid
Reply With Quote #5

it doesn't work,it show that the index of the bombsite is 0
Quote:
Originally Posted by fysiks View Post
What does that code have to do with a player id?
1023168216 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-09-2013 , 16:02   Re: How to get a player's entityid
Reply With Quote #6

Quote:
Originally Posted by 1023168216 View Post
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
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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