Raised This Month: $ Target: $400
 0% 

Random Spot Spawn


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 12-15-2009 , 09:10   Re: Random Spot Spawn
Reply With Quote #8

Quote:
Originally Posted by Arkshine View Post
You don't need CSDM modules. It may no the best examples. CSDM needs spawn points. This plugin stores those spawn points and figure out if a player can spawn on a spaw point selected randomly.

I try this:

PHP Code:
#include <amxmodx>
#include <fakemeta>
#include <cstrike>
#include <amxmisc>
#include <fun>

new Float:g_SpawnVecsMAX_SPAWNS ][ ]
new 
Float:g_SpawnAnglesMAX_SPAWNS ][ ]
new 
Float:g_SpawnVAnglesMAX_SPAWNS ][ ]
new 
g_TotalSpawns 0

new cvar_respawndelay

public plugin_init( )
{
    
register_plugin"Berserker Mod""1.0""ƒa†es™" )
    
register_event"DeathMsg""Event_DeathMsg""a" )

    
cvar_respawndelay register_cvar"berserker_respawndelay""15.0" )
}

public 
Event_DeathMsg( )
{
     if ( 
get_pcvar_numpcvar_berserker_toggle ) == )
     {
         new 
id read_data)
         
cooldown_timeid ] = get_pcvar_numcvar_respawndelay )
         
set_taskget_pcvar_floatcvar_respawndelay ), "Respawn_Player"id )
         
set_task1.0"ShowHUD"id,  __"a"cooldown_timeid ] )
     }
}

public 
Respawn_Playerid )
{
    new 
name[32]
    
get_user_nameidname31 )
    if ( !
is_user_connectedid ) || is_user_aliveid ) || cs_get_user_teamid ) == CS_TEAM_SPECTATOR )
         return;
    
    
client_print0print_chat"Player %s is respawning."name )
    
    
set_pevidpev_deadflagDEAD_RESPAWNABLE )
    
dllfuncDLLFunc_Thinkid )
    
    if ( 
is_user_botid ) && pevidpev_deadflag ) == DEAD_RESPAWNABLE )
    {
        
dllfuncDLLFunc_Spawnid )
    }
    
readSpawns( )
}

readSpawns( )
{
 
//-617 2648 179 16 -22 0 0 -5 -22 0
 // Origin ( x, y, z ), Angles ( x, y, z ), vAngles( x, y, z ), Team ( 0 = ALL ) - ignore
 // :TODO: Implement team specific spawns
 
 
new Map32 ], config32 ],  MapFile64 ]
 
 
get_mapnameMap31 )
 
get_configsdirconfig31 )
 
formatMapFile63"%s\csdm\%s.spawns.cfg"configMap )
 
g_TotalSpawns 0
 
 
if ( file_existsMapFile ) ) 
 {
  new 
Data124 ], len
  
new line 0
  
new pos12 ][ ]
      
  while( 
g_TotalSpawns MAX_SPAWNS && ( line read_fileMapFile line Data 123 len ) ) != 
  {
   if ( 
strlenData ) <|| Data] == '[' )
    continue;
   
parseDatapos], 7pos], 7pos], 7pos], 7pos], 7pos], 7pos], 7pos], 7pos], 7pos10 ], )
   
   
// Origin
   
g_SpawnVecsg_TotalSpawns][ ] = str_to_floatpos[] )
   
g_SpawnVecsg_TotalSpawns][ ] = str_to_floatpos] )
   
g_SpawnVecsg_TotalSpawns][ ] = str_to_floatpos] )
   
   
//Angles
   
g_SpawnAnglesg_TotalSpawns ][ ] = str_to_floatpos] )
   
g_SpawnAnglesg_TotalSpawns ][ ] = str_to_floatpos] )
   
g_SpawnAnglesg_TotalSpawns ][ ] = str_to_floatpos] )
   
   
//v-Angles
   
g_SpawnVAngles[g_TotalSpawns][ ] = str_to_floatpos] )
   
g_SpawnVAngles[g_TotalSpawns][ ] = str_to_floatpos] )
   
g_SpawnVAngles[g_TotalSpawns][ ] = str_to_floatpos10 ] )
   
   
//Team - ignore - 7
   
   
g_TotalSpawns++;
  }
  
  
log_amx("Loaded %d spawn points for map %s."g_TotalSpawnsMap )
 } else {
  
log_amx("No spawn points file found (%s)"MapFile )
 }
 
 return 
1;

Error compile: 4 undefined symbol "MAX_SPAWNS"

I can't figure where to put

spawn_Preset
__________________
ƒa†es™ is offline
 



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 00:29.


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