Raised This Month: $ Target: $400
 0% 

show the time of all players


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-14-2009 , 08:37   show the time of all players
Reply With Quote #1

PHP Code:
if (raceStarted && laps[id] + == 1)  // if race stated & users lap  = first lap
            
{
                
show_hudmessage(id"Lap: %d/%d (Time: %3.2f)"laps[id] + 1get_pcvar_num(totalLaps), hlTime lapTime[id]); // hud showed (example) : LAP : 1/5 (Time: 3.23 )
                
kir hlTime lapTime[id// kir = user time
            
}
            else if (
raceStarted && laps[id]+== 2//   else lap is the secund lap
            
{
                
show_hudmessage(id"Lap: %d/%d (Time: %3.2f)                 last lap : %3.2f"laps[id] + 1get_pcvar_num(totalLaps), hlTime lapTime[id],kir); // hud (example) : lap : 2/5(time:1:23)         time of last lap 
                
kir1 hlTime lapTime[id]  // kir 1 = user lap
                
if(kir kir1// if first laps time > secund lap
                
{
                    
bestlap kir1 // then kir 1 = best laptime
                
}
                else 
//else kir == bestlaptime ( the first lap user did the best laptime )
                
{
                    
bestlap kir
                
}
            }
            else if (
raceStarted && laps[id]+>= 3// is racestarted &  lap == 3
            
{
                
show_hudmessage(id"Lap: %d/%d (Time: %3.2f)                 Last Lap : %3.2f         Best Lap : %3.2f"laps[id] + 1get_pcvar_num(totalLaps), hlTime lapTime[id],kir1,bestlap);

// lap 3/5 or what ever else   &  the time of last lap  & the best time of laps which user did
            

how can i get the time of oder players? in hud i can only show my own time & not of other users.
__________________

Last edited by One; 08-14-2009 at 09:12.
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-14-2009 , 08:44   Re: show the time of all players
Reply With Quote #2

Not sure I understand the parameters of everything. Could you add some comments as to what each variable is for and show us what's being passed into whatever function this is?

It looks like kir and kir1 are never going to be set at the same time, but that may just be because you're not showing everything.
__________________
Bad_Bud is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-14-2009 , 09:13   Re: show the time of all players
Reply With Quote #3

added comments. i hope u all understand
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-14-2009 , 10:05   Re: show the time of all players
Reply With Quote #4

Just make other 'id' ? -.-
__________________
xPaw is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 08-14-2009 , 10:08   Re: show the time of all players
Reply With Quote #5

Quote:
Originally Posted by xPaw View Post
Just make other 'id' ? -.-
how? thats what i never understood. i asked around 2 months ago how to do anything on other players or somthing like this. for my rambo mod. but nobody answered.
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 08-14-2009 , 12:21   Re: show the time of all players
Reply With Quote #6

This code is untested and hasn't been compile tested but it's meant for idea concept so take it as it is.

Code:
#define MAX_PLAYERS 33 #define MAX_LAPS 3 //global // lap_times should be set to hl_time - current_time of lap completion. on lap completion. new Float:lap_times[MAX_PLAYERS][MAX_LAPS]; // current_lap should be incremented on a lap completion. new current_lap[MAX_PLAYERS] #define MAX_HUD_LENGTH 225 get_race_hud( id , current_hud[MAX_HUD_LENGTH], current_pos = 0, max_length = MAX_HUD_LENGTH-1 , full_list = false ) {     if( max_length >= MAX_HUD_LENGTH )         max_length = MAX_HUD_LENGTH-1;     new last_lap[21],best_lap[21]     if( current_lap[id] > 1 )     {         format( last_lap , 20 , "^t^tLast Lap : %3.2f" , lap_times[id][ current_lap[id] - 1 ] );         format( best_lap , 20 , "^tBest Lap : %3.2f" , get_best_lap_time( id ) );     }     new hud[75],size;     size = format( hud , 74 , "Lap: %d/%d (Time: %3.2f)%s%s^n",laps[id] + 1, get_pcvar_num(totalLaps), lap_times[id][ current_lap[id] ] , last_lap , best_lap );     if( current_pos + size > max_length )         return max_length; //lets stop the loop. if we're in one.     current_pos += format( current_hud[ current_pos ] , max_length-current_pos , "%s" , hud );     if( full_list )     {         new Players[32]         new playerCount, i, player         get_players(Players, playerCount, "a")         for (i=0; i<playerCount; i++)         {             player = Players[i];             if( player == id )                 continue;             current_pos = get_race_hud( player , current_hud , current_pos , max_length ) //sets full list to false;             if( current_pos >= max_length )                 break; //stop the loop.         }     }     return current_pos; } Float:get_best_lap_time( id ) {     Float:best;     for( i = 0, stop = current_lap[id]; i < stop; i++ )         best = (best > lap_times[id][i]) ? best : lap_times[id][i];     return best; } //then call it like this new hud_mes[MAX_HUD_LENGTH];  // should use MAX_HUD_LENGTH-1 but the script will fix it get_race_hud( id , hud_mes , 0 , MAX_HUD_LENGTH , true ); show_hud_message( id , "%s" , hud_mes );
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
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 15:02.


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