Raised This Month: $ Target: $400
 0% 

[REQUEST] After years...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-10-2013 , 06:59   [REQUEST] After years...
Reply With Quote #1

Hi, so I am requesting a plugin that after 2 minutes and 30 seconds, if someone is alive, turn the sky to dark (night) and client_print: "Man it's night Cmoooon move after years" and print_chat: world is finished and %s is still moving around You can Rock The Round by saying RTR.
And replace %s with user's name.
Thanks in advance

Last edited by JoooN; 08-10-2013 at 07:03.
JoooN is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 08-10-2013 , 11:22   Re: [REQUEST] After years...
Reply With Quote #2

Can I ask you what do you want this for and what is the value of mp_roundtime ?

Last edited by Moody92; 08-10-2013 at 12:01.
Moody92 is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-10-2013 , 12:37   Re: [REQUEST] After years...
Reply With Quote #3

Quote:
Originally Posted by Moody92 View Post
Can I ask you what do you want this for and what is the value of mp_roundtime ?
I need this because:
1- User will hurry up
2- Notify users about Rock The Round feature
Mp_roundtime is 20

Last edited by JoooN; 08-10-2013 at 12:38.
JoooN is offline
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 08-10-2013 , 17:29   Re: [REQUEST] After years...
Reply With Quote #4

Quote:
Originally Posted by JoooN View Post
I need this because:
1- User will hurry up
2- Notify users about Rock The Round feature
Mp_roundtime is 20
mp_roundtime value is impossible max is 9 and min is 1.. I wasn't asking about timelimit..
Here try this, It'll only print the chats... (Untested)
once you confirm that it works I'll see what to do about the sky (Not sure it's gonna work because usually skies need server restart to apply)

PHP Code:
/* All credits goes to exolent
Source: https://forums.alliedmods.net/showpost.php?p=1348130&postcount=9
*/

#include < amxmodx >

new Float:g_flRoundStart;
new 
Float:g_flRoundEnd;

new 
mp_roundtime;

public 
plugin_init( ){
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
register_logevent"EventRoundEnd"2"1=Round_End" );
    
    
mp_roundtime get_cvar_pointer"mp_roundtime" );
}

public 
EventRoundStart(id)
{
    
g_flRoundStart get_gametime( );
    
g_flRoundEnd g_flRoundStart floatclampget_pcvar_nummp_roundtime ), 1) ) * 60.0;
    
    new 
name[32]
    
get_user_name(idnamecharsmax(name))
    
    if (
GetTimeElapsed() == 150){
        if (
is_user_alive(id)){
        
client_print(idprint_chat"Man, it's night time come on!! Move after years...")
        
client_print(0print_chat"World is finished! and %s is still moving around, You can rock the round by typing RTR"name)
    }
}
        
}

public 
EventRoundEnd( )
{
    
g_flRoundEnd 0.0;
}

// gets how much time has passed
// returns -1.0 on failure
Float:GetTimeElapsed( )
{
    return ( 
g_flRoundEnd 0.0 ) ? ( get_gametime( ) - g_flRoundStart ) : -1.0;


Last edited by Moody92; 08-10-2013 at 17:38.
Moody92 is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-10-2013 , 22:49   Re: [REQUEST] After years...
Reply With Quote #5

Quote:
Originally Posted by Moody92 View Post
mp_roundtime value is impossible max is 9 and min is 1.. I wasn't asking about timelimit..
Here try this, It'll only print the chats... (Untested)
once you confirm that it works I'll see what to do about the sky (Not sure it's gonna work because usually skies need server restart to apply)

PHP Code:
/* All credits goes to exolent
Source: https://forums.alliedmods.net/showpost.php?p=1348130&postcount=9
*/

#include < amxmodx >

new Float:g_flRoundStart;
new 
Float:g_flRoundEnd;

new 
mp_roundtime;

public 
plugin_init( ){
    
register_logevent"EventRoundStart"2"1=Round_Start" );
    
register_logevent"EventRoundEnd"2"1=Round_End" );
    
    
mp_roundtime get_cvar_pointer"mp_roundtime" );
}

public 
EventRoundStart(id)
{
    
g_flRoundStart get_gametime( );
    
g_flRoundEnd g_flRoundStart floatclampget_pcvar_nummp_roundtime ), 1) ) * 60.0;
    
    new 
name[32]
    
get_user_name(idnamecharsmax(name))
    
    if (
GetTimeElapsed() == 150){
        if (
is_user_alive(id)){
        
client_print(idprint_chat"Man, it's night time come on!! Move after years...")
        
client_print(0print_chat"World is finished! and %s is still moving around, You can rock the round by typing RTR"name)
    }
}
        
}

public 
EventRoundEnd( )
{
    
g_flRoundEnd 0.0;
}

// gets how much time has passed
// returns -1.0 on failure
Float:GetTimeElapsed( )
{
    return ( 
g_flRoundEnd 0.0 ) ? ( get_gametime( ) - g_flRoundStart ) : -1.0;

Thanks ill test when I go home and I tought you mean the timeleft sorry mp_roundtime is 5
JoooN is offline
Old 08-11-2013, 04:26
JoooN
This message has been deleted by asherkin.
Old 08-11-2013, 04:29
sami_spt
This message has been deleted by asherkin.
Old 08-11-2013, 05:00
JoooN
This message has been deleted by asherkin.
Old 08-11-2013, 05:20
sami_spt
This message has been deleted by asherkin.
Old 08-11-2013, 06:02
JoooN
This message has been deleted by asherkin.
Old 08-11-2013, 06:30
sami_spt
This message has been deleted by asherkin.
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 08-11-2013 , 06:39   Re: [REQUEST] After years...
Reply With Quote #6

Quote:
Originally Posted by sami_spt View Post
What is not working


When saying something doesn't work you need to give more details. Is the plugin running? Where is the plugin in the plugin order? check logs folder

More details!
@ sami_spt
You should have seen Moody92's plugin. He is checking if game time is equal to 150 (2mins 30 secs) at round start which is basically impossible. That's the reason why it is not working.

@OP
try this
PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN        "After Years"
#define VERSION        "1.0"
#define AUTHOR        "Shooting King"

#define TASK_ID        91283

new const Float:Time 150.0;

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
register_logevent"Round_Start"2"1=Round_Start" );
    
register_event"HLTV""Event_NewRound""a""1=0""2=0" );
}

public 
Round_Start()
{
    
set_taskTime"AfterYears"TASK_ID);
}

public 
Event_NewRound()
{
    
remove_taskTASK_ID );
    
set_lights("#OFF");
}

public 
AfterYears()
{
    new 
szPlayers[32], iNumiPlayerszName[32];
    
get_playersszPlayersiNum"ac" );
    
    if( !
iNum )
    {
        return 
PLUGIN_CONTINUE;
    }

    for( new 
0iNumi++ )
    {
        
szName[0] = '^0';
        
iPlayer szPlayers[i];
        
get_user_nameiPlayerszName31 );
        
client_printiPlayerprint_chat"Man, it's night time come on!! Move after years..." );        
        
client_print0print_chat"World is finished! But %s is still moving around, You can rock the round by typing RTR"szName);
    }
    
set_lights("e");

    return 
PLUGIN_HANDLED;

__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 08-11-2013 at 10:44.
Shooting King is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-11-2013 , 06:50   Re: [REQUEST] After years...
Reply With Quote #7

Pay attention to your code, you send a print message with index 0 in the for loop.
Also, on most maps (i guess all), default light is "m", but the correct way to reset light with set_light is to pass "#OFF"
You don't need to change sv_skycolor_* values, engine is already handling this.
HLTV event is not round start but new round, better to name the function correctly to prevent confusion (new round is before freezetime, round start is after round time).
Don't forget to reset light at new round event.
You don't need to check is task exists when you call remove_task.
Last, you can simply register enf of round like this : register_logevent("Round_End", 2, "1=Round_End");

I would like to see that rock the round plugin, there should be a more dynamic way to make the requested plugin.
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-11-2013 at 06:51.
ConnorMcLeod is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-11-2013 , 06:56   Re: [REQUEST] After years...
Reply With Quote #8

@Shooting King
Thanks ill test
@ConnorMcLeod this is the RTR plugin: https://forums.alliedmods.net/showthread.php?p=616951
JoooN is offline
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 08-11-2013 , 07:14   Re: [REQUEST] After years...
Reply With Quote #9

First, Thanks.
Quote:
Originally Posted by ConnorMcLeod View Post
Pay attention to your code, you send a print message with index 0 in the for loop.
OP wants that.
Quote:
Originally Posted by JoooN View Post
client_print: "Man it's night Cmoooon move after years" and print_chat: world is finished and %s is still moving around You can Rock The Round by saying RTR.
Quote:
Originally Posted by ConnorMcLeod View Post
Also, on most maps (i guess all), default light is "m", but the correct way to reset light with set_light is to pass "#OFF"
Saw that in documentation also, whatever changed.
Quote:
Originally Posted by ConnorMcLeod View Post
You don't need to change sv_skycolor_* values, engine is already handling this.
Dont know that Didnt read AMXSDK and engine module ;D
Quote:
Originally Posted by ConnorMcLeod View Post
HLTV event is not round start but new round, better to name the function correctly to prevent confusion (new round is before freezetime, round start is after round time).
Don't forget to reset light at new round event.
Forgot that changed Round_Start. With TextMsg i can do that at round end.
Quote:
Originally Posted by ConnorMcLeod View Post
You don't need to check is task exists when you call remove_task.
Why ?? Does remove_task checks if task_exists ??
Quote:
Originally Posted by ConnorMcLeod View Post
Last, you can simply register enf of round like this : register_logevent("Round_End", 2, "1=Round_End");
No. This method is called only when TERROR WIN, CT WIN, Round Draw. With Text Msg i can call my function when commencing and When the server has restarted.
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here

Last edited by Shooting King; 08-11-2013 at 07:37.
Shooting King is offline
JoooN
BANNED
Join Date: Jul 2013
Location: Ban List :P
Old 08-11-2013 , 07:50   Re: [REQUEST] After years...
Reply With Quote #10

Quote:
Originally Posted by Shooting King View Post
@OP
try this
PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN        "After Years"
#define VERSION        "1.0"
#define AUTHOR        "Shooting King"

#define TASK_ID        91283

new const Float:Time 150.0;

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
register_logevent"Round_Start"2"1=Round_Start" );
    
register_event"TextMsg""Round_End""a""2&#Game_will_restart_in""2&#Game_Commencing""2&#CTs_Win""2&#Terrorists_Win""2&#Round_Draw" );
}

public 
Round_Start()
{
    
set_taskTime"AfterYears"TASK_ID);
}

public 
Round_End()
{
    
remove_taskTASK_ID );
    
set_lights("#OFF");
}

public 
AfterYears()
{
    new 
szPlayers[32], iNumiPlayerszName[32];
    
get_playersszPlayersiNum"a" );
    
    if( !
iNum )
    {
        return 
PLUGIN_CONTINUE;
    }

    for( new 
0iNumi++ )
    {
        
szName[0] = '^0';
        
iPlayer szPlayers[i];
        
get_user_nameiPlayerszName31 );
        
client_printiPlayerprint_chat"Man, it's night time come on!! Move after years..." );        
        
client_print0print_chat"World is finished! But %s is still moving around, You can rock the round by typing RTR"szName);
    }
    
set_lights("e");

    return 
PLUGIN_HANDLED;

Very good but only there is a problem: I have a DeathRun server with DeathRun Manager and it will put a bot in Terrorist Team, so it doesn't ignore the BOT. If possible please fix this.
Thanks
JoooN 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 00:15.


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