Raised This Month: $ Target: $400
 0% 

[SOLVED] Player Spawn Or Round Start?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-25-2013 , 05:20   [SOLVED] Player Spawn Or Round Start?
Reply With Quote #1

ive got a script that fades screen for CT and sets time to unfade.

and then unfreeze the CT's

but if i use the code in Player Spawn... it works as long as everyone spawns same time(round start)

but then starts bugging when people spawn at different times...

and then i use Round Start event, and nothing happens it doesnt work.

Spoiler

Last edited by Blizzard_87; 01-26-2013 at 05:40.
Blizzard_87 is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-25-2013 , 14:47   Re: Player Spawn Or Round Start?
Reply With Quote #2

public LogEvent_RoundStart(id)

id O_O ?

This is a global Event.
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 01-25-2013 , 15:27   Re: Player Spawn Or Round Start?
Reply With Quote #3

WTF?!
PHP Code:
LogEvent_RoundStart(id
It's god damm fu***ng global event, it has not params.

Use this:
PHP Code:
public LogEvent_RoundStart(){
    for (new 
1<= 32i++)
    {
        if(
cs_get_user_team(i) != CS_TEAM_T)
        {
            
Freeze(i);
            
ScreenFade(i);
            
set_hudmessage(85255255, -1.00.26120.020.00.050.051)
            
show_hudmessage(i"Hiders Get 20 Secs To Hide!")
            
set_task(20.0"Released"i);
        }
    }

__________________
simanovich is offline
Bos93
Veteran Member
Join Date: Jul 2010
Old 01-25-2013 , 15:55   Re: Player Spawn Or Round Start?
Reply With Quote #4

for (new i = 1; i <= 32; i++)

-->

new g_iMaxClients;

plugin_init( ) g_iMaxClients = get_maxplayers( );

for( new i = 1; i <= g_iMaxClients; i++ )
__________________
Bos93 is offline
Send a message via ICQ to Bos93 Send a message via Skype™ to Bos93
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 01-25-2013 , 16:53   Re: Player Spawn Or Round Start?
Reply With Quote #5

Quote:
Originally Posted by simanovich View Post
WTF?!
PHP Code:
LogEvent_RoundStart(id
It's god damm fu***ng global event, it has not params.

Use this:
PHP Code:
public LogEvent_RoundStart(){
    for (new 
1<= 32i++)
    {
        if(
cs_get_user_team(i) != CS_TEAM_T)
        {
            
Freeze(i);
            
ScreenFade(i);
            
set_hudmessage(85255255, -1.00.26120.020.00.050.051)
            
show_hudmessage(i"Hiders Get 20 Secs To Hide!")
            
set_task(20.0"Released"i);
        }
    }

PHP Code:
if(cs_get_user_team(i) != CS_TEAM_T
that will even target the spectators

Solution ==> Post #4

and dont forget to add the team check

Last edited by EpicMonkey; 01-25-2013 at 16:55.
EpicMonkey is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 01-25-2013 , 20:18   Re: Player Spawn Or Round Start?
Reply With Quote #6

Don't forget to add a connected/alive check because cs_get_user_team will throw an error if the user is not in game yet.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-25-2013 , 20:21   Re: Player Spawn Or Round Start?
Reply With Quote #7

thanks heaps guys. will edit code :-)
Blizzard_87 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-26-2013 , 02:28   Re: Player Spawn Or Round Start?
Reply With Quote #8

PHP Code:
public LogEvent_RoundStart()
{
    
    new 
players[32], num;
    
get_playersplayersnum);
    
    for( new 
0num ;i++ )
    {
        if( 
is_user_connected(i) && is_user_alive(i) )
        {
            if(
cs_get_user_team(i) == CS_TEAM_CT)
            {
                
Freeze(i);
                
ScreenFade(i);
            }
            
set_hudmessage(85255255, -1.00.26120.020.00.050.051)
            
show_hudmessage(i"Hiders Get 20 Secs To Hide!")
            
set_task(20.0"Released"i);
        }    
    }
    
    
/*    
    for( new i = 1; i <= g_iMaxClients; i++ )
    {
    if( is_user_connected(i) && is_user_alive(i) )
    {
        if(cs_get_user_team(i) == CS_TEAM_CT)
        {
            Freeze(i);
            ScreenFade(i);
        }
        set_hudmessage(85, 255, 255, -1.0, 0.26, 1, 20.0, 20.0, 0.05, 0.05, 1)
        show_hudmessage(i, "Hiders Get 20 Secs To Hide!")
        set_task(20.0, "Released", i);
    }
    }*/

ive used both methods and nothing in game works....
nothing happens.
Blizzard_87 is offline
EpicMonkey
buttmonkey
Join Date: Feb 2012
Old 01-26-2013 , 04:05   Re: Player Spawn Or Round Start?
Reply With Quote #9

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

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "None"

new g_maxplayers;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("EventRoundStart"2"1=Round_Start");
    
    
g_maxplayers get_maxplayers()
}

public 
EventRoundStart()
{
    for(new 
0g_maxplayersi++)
    {
        if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
        {
            
client_print(iprint_chat"[AMXX] Works!")
        }
    }

this simple test works
EpicMonkey is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 01-26-2013 , 05:01   Re: Player Spawn Or Round Start?
Reply With Quote #10

Quote:
Originally Posted by EpicMonkey View Post
PHP Code:
#include <amxmodx>
#include <cstrike>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "None"

new g_maxplayers;

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("EventRoundStart"2"1=Round_Start");
    
    
g_maxplayers get_maxplayers()
}

public 
EventRoundStart()
{
    for(new 
0g_maxplayersi++)
    {
        if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
        {
            
client_print(iprint_chat"[AMXX] Works!")
        }
    }

this simple test works
PHP Code:
public LogEvent_RoundStart()
{

    for(new 
0g_iMaxClientsi++)
    {
    
set_hudmessage(85255255, -1.00.26120.020.00.050.051)
    
show_hudmessage(i"Hiders Get 20 Secs To Hide!")
    
set_task(20.0"Released"i);   
     
    if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
         {
        
Freeze(i);
        
ScreenFade(i);
    }
    }

the HUD and Released task show and work for Terrorist but nothing happens or shows on CT still..

_____________________________________________ ______________________________________

[EDIT]

when testing with myself it doesnt do anything when i first restart server.. but once DIE and round starts again it all seems to work...

thanks.

Last edited by Blizzard_87; 01-26-2013 at 05:39.
Blizzard_87 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 20:32.


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