Raised This Month: $32 Target: $400
 8% 

Last Players on Radar


Post New Thread Reply   
 
Thread Tools Display Modes
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-05-2015 , 19:24   Re: Last Players on Radar
Reply With Quote #31

There is no need to create a variable to hold get_pcvar_num & use it one time, i'm talking about
Code:
new iMaxTerorrists, iMaxCTs;
Also here :

Code:
if( iEnableTo == 1 || iEnableTo == 3 )
{	
         [...]					
}	
if( iEnableTo == 2 || iEnableTo == 3 )
{		
         [...]
}
Also,
Code:
new id, iTarget;
new i, j
Can be declared after the check.

Code:
		
if( iEnableTo == 1 || iEnableTo == 3 )
{	
         -> Here
Small things...

̷S̷h̷o̷u̷l̷d̷n̷'̷t̷ ̷y̷o̷u̷ ̷a̷d̷d̷ ̷a̷ ̷e̷v̷e̷n̷t̷ ̷f̷o̷r̷ ̷t̷h̷e̷ ̷f̷i̷r̷s̷t̷ ̷r̷o̷u̷n̷d̷?̷

Last edited by Freezo Begin; 09-06-2015 at 10:01.
Freezo Begin is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-06-2015 , 03:26   Re: Last Players on Radar
Reply With Quote #32

Quote:
There is no need to create a variable to hold get_pcvar_num & use it one time, i'm talking about
Didn't matter much, you could say this is for readability. It's not tragic. Author could change if he wants to.

Quote:
if( iEnableTo == 1 || iEnableTo == 3 )
{
[...]
}
if( iEnableTo == 2 || iEnableTo == 3 )
{
[...]
}
Don't understand what it's your point with this. If cvar is 3 it should enter in the both checks.

Quote:
new id, iTarget;
new i, j
Not really, you would have to declare them two times.

Quote:
Shouldn't you add a event for the first round?
What ? HLTV is the new round event.

@Askhanar:
Just few more thing:

1.You should reset iFakeIndex to g_iHostageCount between the for loops. See 2.
2.Your both for's have the same code, you could probably factorize it, to avoid duplicated code. Something like:
PHP Code:
UTIL_LoopPlayers(const Team[], const TeamCount, const Enemies[], const EnemiesCount)
{
    new 
iFakeIndex g_iHostageCount
    
new ijid
    
for(0TeamCounti++)
    {
        
id Team[i]
        for(
0EnemiesCountj++)
        {
            
UTIL_ShowOnRadar(idEnemies[j], ++iFakeIndex)
        }
    }

Then, in the task:
PHP Code:
if( iEnableTo == || iEnableTo == )
{    
    
UTIL_LoopPlayers(iAliveTerorristsiAliveTerorristsNumiAliveCTsiAliveCTsNum)
}
        
if( 
iEnableTo == || iEnableTo == )
{        
    
UTIL_LoopPlayers(iAliveCTsiAliveCTsNumiAliveTerorristsiAliveTerorristsNum)

__________________

Last edited by HamletEagle; 09-06-2015 at 04:36.
HamletEagle is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-06-2015 , 08:46   Re: Last Players on Radar
Reply With Quote #33

This is what happen when you(/i) have a bad english.

Anyway, the iEnable 3 should be first then he need to check iEnable 1 & then 2 there is no need to repeat the check with the operator or ||.

I mean the first start round on change map.

Last edited by Freezo Begin; 09-06-2015 at 08:47.
Freezo Begin is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-06-2015 , 09:02   Re: Last Players on Radar
Reply With Quote #34

Quote:
Anyway, the iEnable 3 should be first then he need to check iEnable 1 & then 2 there is no need to repeat the check with the operator or ||.
No. You should understand the code logic.
If 1 only T will see enemies on radar. if 2 only CT will see enemies on radar. If 3 both teams see enemies on radar. If we firstly check 3 then values 1 & 2 of the cvar will become useless, also no one won't see anything, because cvar can be either 1 or 2 or 3. Your suggestion would be good only if the check was && and not ||.

Current code works like:
-If cvar is 1 show for tero(enter only in the first check)
-If cvar is 2 show for ct.(enter only in second check)
-If cvar is 3 then show for both tero and ct(will enter in the first check -> show for tero and will enter in the second check too -> show for ct).

Abut first round, it's not needed, HLTV is well called from the first round if game started scoring. If not(only one player or all players in the same team) it won't be called from first round, but that's not an issue. In this case players won't have enemies so there is nothing to display on radar. Also g_bMessageShown is already false and needs to be reseted only next round, so HLTV being called on very first round or not doesn't really matter.
__________________

Last edited by HamletEagle; 09-06-2015 at 09:11.
HamletEagle is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 09-06-2015 , 09:58   Re: Last Players on Radar
Reply With Quote #35

Quote:
Originally Posted by HamletEagle View Post
Your suggestion would be good only if the check was && and not ||.
Lol, i'm blind.

Thanks a lot for the explanation.
Freezo Begin is offline
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 09-06-2015 , 15:38   Re: Last Players on Radar
Reply With Quote #36

Once again, all done.
__________________

My PC Themes . .
red_bull2oo6 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-07-2015 , 06:19   Re: Last Players on Radar
Reply With Quote #37

Right now you are sending HostagePos message each time, even if the player is not moving. What you could do in order to reduce the number of messages send(so the network usage) is to send this message only if player moved. For this, ideally you could check origin and oldorigin, and getting the distance between this. Also small distances does not matter from player and radar point of view. So, if the distance if bigger than let's say 72(or anything between 72 and 100) you show the message. Do this only for HostagePos message, HostageK should be always send(because it's hold time is only 1.5 seconds, unlike HostagePos which is 9999 - thanks arkshine for client code).

One last thing, in UTIL_ShowOnRadar fOrigin should be static, since it's called from a loop.
__________________

Last edited by HamletEagle; 09-07-2015 at 06:19.
HamletEagle is offline
red_bull2oo6
Senior Member
Join Date: Mar 2012
Location: Braila, Romania
Old 09-10-2015 , 18:13   Re: Last Players on Radar
Reply With Quote #38

I'ts done, sorry for being late ^^.
__________________

My PC Themes . .
red_bull2oo6 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-11-2015 , 04:27   Re: Last Players on Radar
Reply With Quote #39

Bothering you again:
1.You should likely not retrieve origin at spawn, because it will fuck up the radar. When player is spawned he should appear on radar, only after message was send one time succesfully you should check if he moved or not. Do you even test before releasing an update ?
2.fOrigin should be static.
__________________

Last edited by HamletEagle; 09-11-2015 at 04:28.
HamletEagle is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-29-2015 , 14:35   Re: Last Players on Radar
Reply With Quote #40

More than 15 days have passed and I don't see any changes from the author. Since section needs to be cleaned I'll unapprove this for now, but don't worry, your plugin can be reviewed at any time. PM a plugin approver after you made the changes.

Shame that for this two small changes I have to unapprove it.
__________________
HamletEagle 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 19:03.


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