Guest User

Untitled

a guest
Jun 18th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.53 KB | None | 0 0
  1. new Handle:hSpawns;
  2.  
  3. public OnPluginStart() {
  4.     hSpawns = CreateArray();
  5. }
  6.  
  7. public OnMapStart() {
  8.     new iEntity = -1;
  9.    
  10.     ClearArray(hSpawns);
  11.    
  12.     while ( (iEntity = FindEntityByClassname(iEntity, "info_player_start") != -1 ) {
  13.         PushArrayCell(hSpawns, iEntity);
  14.     }    
  15. }
  16.  
  17. /* to teleport the player */
  18.  
  19. new Float:fOrigin[3];
  20. new spawn = GetRandomInt(0, GetArraySize(hSpawns)-1);
  21. GetEntPropVector(iEntity, Prop_Send, "m_vecOrigin", fOrigin);
  22. TeleportEntity(client, fOrigin, NULL_VECTOR, NULL_VECTOR);
Add Comment
Please, Sign In to add comment