Raised This Month: $30 Target: $400
 7% 

Solved [L4D/L4D2] Getting coordinates of "warp_all_survivors_to_checkpoint"


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 05-30-2018 , 16:46   [L4D/L4D2] Getting coordinates of "warp_all_survivors_to_checkpoint"
Reply With Quote #1

I'm wondering if there's an efficient way of getting the coordinates of where in the Saferoom survivors are teleported to when "warp_all_survivors_to_checkpoint" is used.

I want to get those coordinates at the start of each map. This is the only method I can think of but I fear that it may cause the round to end.

PHP Code:
float g_flPosition[3];
...
public 
Action eRoundStart(Event event, const char[] namebool dontBroadcast)
{
     
g_flPosition[0] = 0.0;
     
g_flPosition[1] = 0.0;
     
g_flPosition[2] = 0.0;
     
// As long as it's not a finale map
     
if (!bIsFinaleMap())
     {
          
ServerCommand("warp_all_survivors_to_checkpoint"); // Teleport to saferoom
          
for (int iSurvivor 1iSurvivor <= MaxClientsiSurvivor++)
          {
               
// Get position of the 1st survivor
               
if (bIsSurvivor(iSurvivor))
               {
                    
GetClientAbsOrigin(iSurvivorg_flPosition);
                    break;
               }
               
// Teleport all survivors back to starting saferoom
               
TeleportEntity(iSurvivorg_flOriginNULL_VECTORNULL_VECTOR); // g_flOrigin would be set on "player_activate" event
          
}
     }
}
...
void Blah(int targetint client)
{
     
TeleportEntity(targetg_flPositionNULL_VECTORNULL_VECTOR);
     
PrintToChat(client"%N was teleported to the Saferoom."target);

__________________

Last edited by Psyk0tik; 05-05-2021 at 00:37. Reason: Marked as solved
Psyk0tik is offline
 


Thread Tools
Display Modes

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 14:11.


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