Raised This Month: $51 Target: $400
 12% 

[HELP]When getting player entity ID


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Infractem
Member
Join Date: Dec 2016
Old 12-27-2016 , 19:26   [HELP]When getting player entity ID
Reply With Quote #1

What would be the entity ID of each player on the enemy team?

PHP Code:
radar_continue(id)
{
    new 
numplayers[32], PlayerCoords[3]
    
get_players(playersnum"gh")
    for(new 
a=0a<numa++)
    {
        new 
players[a]       
        if(!
is_user_alive(i) || get_user_team(i) == get_user_team(id)) 
            continue;
        
        {    
            
get_user_origin(iPlayerCoords
Infractem is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-27-2016 , 22:52   Re: [HELP]When getting player entity ID
Reply With Quote #2

The value of players[a] i.e. i when get_user_team(i) != get_user_team(id)

Also note that the variable i should not be created inside the loop. It should be created before the loop.
__________________

Last edited by fysiks; 12-27-2016 at 22:54.
fysiks is offline
Infractem
Member
Join Date: Dec 2016
Old 12-28-2016 , 04:35   Re: [HELP]When getting player entity ID
Reply With Quote #3

That means enemy team would be read as player[a], player[b], player[c] and so on? The thing is I want to get each user origin of each player on the enemy team and I don't know how to use get_user_origin to get me a unique origin for each player

Last edited by Infractem; 12-28-2016 at 04:36.
Infractem is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-28-2016 , 13:14   Re: [HELP]When getting player entity ID
Reply With Quote #4

Quote:
Originally Posted by Infractem View Post
That means enemy team would be read as player[a], player[b], player[c] and so on?
No. 'a' is a variable.
__________________
fysiks is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 12-28-2016 , 14:08   Re: [HELP]When getting player entity ID
Reply With Quote #5

you made a loop with 'a' as the iterator, Players[] is the array stored from 0 to 32, when you make a loop you 'touch' each index until the condition is end

Players[0]
Players[1]
Players[2]
until the condition from loop is ending

that condition:
for(new a=0; a<num; a++)

"num" is the number of players founded, so if "a' is less than Num( wich should be 16 players founded , a++ ( increment "a' Until we acomplish the condition )
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
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 12:23.


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