AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Respawn Distance Close to other players! (https://forums.alliedmods.net/showthread.php?t=92485)

dstopgunner 05-15-2009 21:08

Respawn Distance Close to other players!
 
When playing some co-op map in CS other day , those people who died had to walk all the way back because the spawn points remain the same.
I cant add custom spawn points as they would spawn in other parts like middle of map without even going through it , so I tried making a plugin to work with the custom spawn points.

This plugin is supposed to ONLY ALLOW players to RESPAWN if they are near their teammates , if they spawn elsewhere the plugin will respawn the player near his teammates.

Minimum distance is 1000.
Maximum distance is 1500.

I know it sounds crazy with a lot of bugs if I use this they might spawn even further into the map dont worry about that part yet. Because right now this isnt even working.
Sry my knowledge of <engine> is bad.

PHP Code:

//RegisterHam(Ham_Spawn,"player","spawned")
public spawned(id)
{
 new 
players[32], count
 get_players
(playerscount"fh")
 for(new 
0counti++) //getting all alive players
 
{
  new 
Float:pos[3]
  
entity_get_vector(players[i], EV_VEC_originpos)
  static 
className[64];
  if(
equali(className"info_player_start"))
  
   if (
vector_distance(posequali(className"info_player_start")) > 1000 && vector_distance(posequali(className"info_player_start")) < 1500
   {
    return 
PLUGIN_HANDLED
   
}
   else
   {
    
ExecuteHam(Ham_CS_RoundRespawn,id)
   }
 }


Not completed yet someone pls help I dont know how to allow them to respawn only if they are near teammates. Right now it will continuously respawn players until they are near teammates , thats bad =/

dstopgunner 05-15-2009 21:09

Re: Respawn Distance Close to other players!
 
Sorry I forgotton its not only info_player_start , pls dont make this team-specific becuase terrorists too in the game.

dstopgunner 05-16-2009 01:51

Re: Respawn Distance Close to other players!
 
Someone pls help I need it urgent.
+Karma for help


All times are GMT -4. The time now is 01:34.

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