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

Pause a plugin before roundstart and unpause after few second


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
elle
Member
Join Date: Feb 2011
Old 04-16-2012 , 06:03   Pause a plugin before roundstart and unpause after few second
Reply With Quote #1

I dont know about coding but i have a idea ,anyone who kind please make for me a plugin like this


At the time round start (immediately after round end) => pause csdm_spawn_preset.amxx

(because i want to change "csdm spawn mode" to "normal")

Then after few second (when all player has spawned )
=> unpause
csdm_spawn_preset.amxx


(change "csdm spawn mode" to "spawn preset")


The reason i want a plugin like above:

I want a csdm spawn mode that :

at the round begining ,the player will spawn in default team spawn point

Then when dead , they will spawn at csdm spawn point (random spawn point)

It will make more fun ,team play at beginning ,then later you can't know where the enemy will come from .

so if anyone has better idea (such as change csdm spawn mode cvars ....at roundstart ) please tell me





it will help me so much
thank you !!

Last edited by elle; 04-16-2012 at 06:54.
elle is offline
elle
Member
Join Date: Feb 2011
Old 04-16-2012 , 11:30   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #2

Big thanks for Deidara , he solved this problem :

i post his plugin here for anyone who needs

it works !!!


Code:
#include < amxmodx >

public plugin_init()
{
    register_plugin("PausePlugin","1.0","Deidara");
    register_logevent("round_end", 2, "1=Round_End");
    register_logevent("round_start", 2, "1=Round_Start")
}

public round_end()
{
    pause("ac","csdm_spawn_preset.amxx");
    
        
}

public round_start(id)
{
    set_task ( 2.0, "start", id );
}

public start()
{
    unpause("ac","csdm_spawn_preset.amxx");
    
}
elle is offline
nss
Junior Member
Join Date: Feb 2011
Old 04-21-2012 , 13:15   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #3

is it possible to optimize this plugin more ?

thus when i use the command mp_restartround 1 , there is no round end ,so the plugin "csdm_spawn_preset.amxx" won't pause (although the round restart)

is there anyway to fix it ?
nss is offline
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 04-21-2012 , 15:06   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #4

Code:
#include < amxmodx >

public plugin_init()
{
	register_plugin("PausePlugin","1.0","Deidara");
	register_logevent("round_end", 2, "1=Round_End");
	register_event("TextMsg", "round_restart", "a", "2&#Game_C", "2&#Game_w");
	register_logevent("round_start", 2, "1=Round_Start")
}

public round_end()
{
	pause("ac","csdm_spawn_preset.amxx");
    
        
}

public round_restart()
{
	pause("ac","csdm_spawn_preset.amxx");
}

public round_start(id)
{
	set_task ( 2.0, "start", id );
}

public start()
{
	unpause("ac","csdm_spawn_preset.amxx");
    
}
Try
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
nss
Junior Member
Join Date: Feb 2011
Old 04-21-2012 , 23:23   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #5

Quote:
Originally Posted by Deidara View Post
Try
thanks man
you are great ,it works
nss is offline
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-21-2012 , 23:35   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #6

i tried it and seems to me it works. there were two players on the server. i connected first and spawned randomly then my friend connected and restart round occurred after that we had normal spawn and then spawn randomly again!
sorry for my bad english!
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 04-22-2012 , 08:51   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #7

Because on first connect, event is round_draw. You want to make it for round_draw?
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
TRUE RED
Senior Member
Join Date: Mar 2012
Location: Ukraine
Old 04-22-2012 , 15:17   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #8

Yes, in round_draw will be great!
TRUE RED is offline
Send a message via ICQ to TRUE RED Send a message via Skype™ to TRUE RED
Deidara
Member
Join Date: Jul 2010
Location: Romania
Old 04-22-2012 , 15:30   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #9

Code:
#include < amxmodx >

public plugin_init()
{
	register_plugin("PausePlugin","1.0","Deidara");
	register_logevent("round_end", 2, "1=Round_End");
	register_event("TextMsg", "round_restart", "a", "2&#Game_C", "2&#Game_w");
	register_logevent("round_start", 2, "1=Round_Start")
	register_logevent("round_draw", 2, "1=Round_Draw");
}

public round_end()
{
	pause("ac","csdm_spawn_preset.amxx");
    
        
}

public round_restart()
{
	pause("ac","csdm_spawn_preset.amxx");
}

public round_draw()
{
	pause("ac","csdm_spawn_preset.amxx");
}

public round_start(id)
{
	set_task ( 2.0, "start", id );
}

public start()
{
	unpause("ac","csdm_spawn_preset.amxx");
    
}
Deidara is offline
Send a message via Yahoo to Deidara Send a message via Skype™ to Deidara
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 04-22-2012 , 17:18   Re: Pause a plugin before roundstart and unpause after few second
Reply With Quote #10

This should be more accurate :

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define VERSION "0.0.1"
#define PLUGIN "Normal Spawn On New Round"

new const CSDM_SPAWN_PRESET_PLUGIN_NAME[] = "csdm_spawn_preset.amxx"

new m_usResetDecals

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
    
m_usResetDecals engfunc(EngFunc_PrecacheEvent1"events/decal_reset.sc")
    
register_event("HLTV""Event_HLTV_New_Round""a""1=0""2=0")
    
register_forward(FM_PlaybackEvent"OnPlaybackEvent_P"1)
}

public 
Event_HLTV_New_Round()
{
    
pause("ac",CSDM_SPAWN_PRESET_PLUGIN_NAME)
}

public 
OnPlaybackEvent_P(flagspInvokereventindex)
{
    if( 
eventindex == m_usResetDecals )
    {
        
unpause("ac",CSDM_SPAWN_PRESET_PLUGIN_NAME)
    }

__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
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 17:31.


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