AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Remind everyone when (X) seconds passed. (https://forums.alliedmods.net/showthread.php?t=224090)

HalfLife 08-20-2013 01:56

Remind everyone when (X) seconds passed.
 
1 Attachment(s)
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Reminder"
#define VERSION "1.0"
#define AUTHOR "HalfLife"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    if( 
get_gametime () > 600.0 ) )
    {
        
client_print0print_chat"10 minutes have passed, now Admins can Vote For Mod." );
        return 
PLUGIN_HANDLED


This is my plugin, I made so when 600 seconds have passed,
PHP Code:

client_print0print_chat"10 minutes have passed, now Admins can Vote For Mod." ); 

but it doesn't compile and gives errors (see the picture)
https://forums.alliedmods.net/attach...1&d=1376978197

lobopack23 08-20-2013 02:52

Re: Remind everyone when (X) seconds passed.
 
here you go buddy..try this simple version
Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Reminder"
#define VERSION "1.0"
#define AUTHOR "HalfLife"

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    new Float:gametime = get_gametime()

    if( gametime >= 600.0 )
        client_print( 0, print_chat, "10 minutes have passed, now Admins can Vote For Mod." );
    return PLUGIN_HANDLED
}

And if you want to spice things up.

Code:

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Reminder"
#define VERSION "1.0"
#define AUTHOR "HalfLife"

#define MINUTES 10
new g_timePassed
new Float:gametime

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)

    gametime = get_gametime()
    g_timePassed = MINUTES * 60

    if( gametime >= g_timePassed )
        client_print( 0, print_chat, "%s minutes have passed, now Admins can Vote For Mod.", g_timePassed );

    return PLUGIN_HANDLED
}

didn't have time to test, but i hope it's what you're looking for

dark_style 08-20-2013 02:54

Re: Remind everyone when (X) seconds passed.
 
HalfLife you just forgot a bracket after "return PLUGIN_HANDLED". :)

lobopack23 08-20-2013 03:26

Re: Remind everyone when (X) seconds passed.
 
brackets.. HIS GREATEST NEMESIS xD

also..if he added the bracket..he would get plugin_init does not return a value..

you can always add a return PLUGIN_CONTINUE at the end..but yeah :p

HalfLife 08-20-2013 03:37

Re: Remind everyone when (X) seconds passed.
 
Thanks lobopack but I never understood what is bool.

lobopack23 08-20-2013 03:58

Re: Remind everyone when (X) seconds passed.
 
bool is short for boolean.
i believe it returns a value of 1 for true and 0 for false.

HalfLife 08-20-2013 04:02

Re: Remind everyone when (X) seconds passed.
 
Quote:

Originally Posted by lobopack23 (Post 2017770)
bool is short for boolean.
i believe it returns a value of 1 for true and 0 for false.

Thanks for your help.
I am learning scripting better and better :D
Btw from where did you learn scripting?
Edit: Not working the 1st one

HalfLife 08-20-2013 04:26

Re: Remind everyone when (X) seconds passed.
 
Both not working

yokomo 08-20-2013 04:33

Re: Remind everyone when (X) seconds passed.
 
A simple code:
PHP Code:

#include <amxmodx>

#define Seconds 600.0

public plugin_init()
{
    
register_plugin("Reminder All""0.0.1""wbyokomo")
    
    
remove_task(6132)
    
set_task(Seconds"TaskRemindAll"6132)
}

public 
TaskRemindAll()
{
    
client_print(0print_chat"10 minutes have passed, now Admins can Vote For Mod.")



HalfLife 08-20-2013 04:40

Re: Remind everyone when (X) seconds passed.
 
Quote:

Originally Posted by yokomo (Post 2017785)
A simple code:
PHP Code:

#include <amxmodx>

#define Seconds 600.0

public plugin_init()
{
    
register_plugin("Reminder All""0.0.1""wbyokomo")
    
    
remove_task(6132)
    
set_task(Seconds"TaskRemindAll"6132)
}

public 
TaskRemindAll()
{
    
client_print(0print_chat"10 minutes have passed, now Admins can Vote For Mod.")



Thanks this one is working.
But thanks to everyone for your helps :)
Edit: Why remove_task(6132)? What 6132 defines? Latest HLDS ?? LOL


All times are GMT -4. The time now is 15:51.

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