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

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


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 05-30-2018 , 15: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-04-2021 at 23:37. Reason: Marked as solved
Psyk0tik is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-30-2018 , 17:55   Re: [L4D/L4D2] Getting coordinates of "warp_all_survivors_to_checkpoint"
Reply With Quote #2

Why do you think this will cause the round to end?
__________________
Spirit_12 is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 05-30-2018 , 18:48   Re: [L4D/L4D2] Getting coordinates of "warp_all_survivors_to_checkpoint"
Reply With Quote #3

Because I'm gonna use it in my Anti-Speedrunner System plugin and that has a feature where it locks the Saferoom door. I'm afraid that if I warp all the survivors to the Saferoom while the door is locked, that it will end the round before they can be warped back to the starting area, or that the round will still end even if they do get warped back. I mean, I could just add a delay to the door lock but my main concern is the method I'm using to get the coordinates.
__________________
Psyk0tik is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 05-30-2018 , 21:19   Re: [L4D/L4D2] Getting coordinates of "warp_all_survivors_to_checkpoint"
Reply With Quote #4

In case this is only for stock maps. I think L4Dnation guys have already saved the coordinates for all the stock maps in mapinfo.ini file. You can use that to set static coordinates, if you like.
__________________
Spirit_12 is offline
Reply


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 15:02.


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