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

Random Spot Spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 12-11-2009 , 07:35   Random Spot Spawn
Reply With Quote #1

Does anyone know how to random-ing spawn client in different spot. Instead of ct base, t base just like CSDM
__________________
ƒa†es™ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-11-2009 , 07:36   Re: Random Spot Spawn
Reply With Quote #2

Look at CSDM code.
__________________
Arkshine is offline
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 12-11-2009 , 09:02   Re: Random Spot Spawn
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
Look at CSDM code.
I did but i can't seem to find the direct code.
__________________
ƒa†es™ is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-11-2009 , 09:16   Re: Random Spot Spawn
Reply With Quote #4

in csdm_spawn_preset ?
__________________
Arkshine is offline
Old 12-11-2009, 09:30
ƒa†es™
This message has been deleted by ƒa†es™.
dFF
sıɹɹoɥɔ ʞɔnu
Join Date: Oct 2009
Old 12-11-2009 , 09:34   Re: Random Spot Spawn
Reply With Quote #5

zombie_plague -> do_random_spawn stock
dFF is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-11-2009 , 09:44   Re: Random Spot Spawn
Reply With Quote #6

Quote:
Originally Posted by ƒa†es™ View Post
Yeah but reqiure csdm modules ?

So izzit possible to make without csdm modules ?
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.
__________________
Arkshine is offline
Old 12-11-2009, 10:07
ƒa†es™
This message has been deleted by ƒa†es™.
Old 12-11-2009, 10:07
ƒa†es™
This message has been deleted by ƒa†es™.
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 12-15-2009 , 09:10   Re: Random Spot Spawn
Reply With Quote #7

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
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 12-15-2009 , 09:46   Re: Random Spot Spawn
Reply With Quote #8

#define MAX_SPAWNS 32
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
ƒa†es™
Senior Member
Join Date: May 2009
Location: Garena
Old 12-15-2009 , 10:24   Re: Random Spot Spawn
Reply With Quote #9

Quote:
Originally Posted by joropito View Post
#define MAX_SPAWNS 32
Thanks console print out this:

Code:
L 12/15/2009 - 23:21:49: [Berserker-Mod.amxx] Loaded 32 spawn points for map de_dust2
SPAM

But they still spawning in Tbase or CTbase
__________________
ƒa†es™ is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 12-15-2009 , 10:38   Re: Random Spot Spawn
Reply With Quote #10

Your script is only loading spawnpoints but not managing them.

You should check csdm code deeply.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Reply



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 16:38.


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