AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Allow only every new round execute (https://forums.alliedmods.net/showthread.php?t=141074)

killergirl 10-19-2010 08:33

Allow only every new round execute
 
I have an idea to make a script with additional functions but I need help about "time interval". I've tried to make with "client_putinserver", with "Ham_Spawn", with "set_task", etc., with no success.
The script allows to execute the command only in the first 15 seconds, the beginning of a new round or when the server gets the command, automatically executes the command after when the round ends or when a new round starts.

hleV 10-19-2010 09:50

Re: Allow only every new round execute
 
First 15 seconds of map?
PHP Code:

#include <amxmodx>
 
new bool:CommandCanBeExecuted;
new 
bool:CommandRequested;
 
public 
plugin_init()

        
register_clcmd("amx_command""AttemptToExecuteCommand");
 
        
register_event("HLTV""NewRound""a""1=0""2=0");
}
 
public 
DisallowExecutingCommand()
        
CommandCanBeExecuted false;
 
public 
AttemptToExecuteCommand(Client)
{
        if (
CommandCanBeExecuted)
                
CommandAccepted();
        else 
                
CommandRequested true;
 
        return 
PLUGIN_HANDLED;
}
 
public 
NewRound()
{        
        
set_task(15.0"DisallowExecutingCommand");
 
        if (
CommandRequested)
                
CommandAccepted();
}
 
CommandAccepted()
{
        
CommandRequested false;
 
        
// Stuff



fysiks 10-19-2010 18:19

Re: Allow only every new round execute
 
You may need to better describe what you are trying to do.

killergirl 10-20-2010 11:37

Re: Allow only every new round execute
 
Quote:

Originally Posted by fysiks (Post 1329708)
You may need to better describe what you are trying to do.

For example: amx_blind .

I was wonderig, to execute amx_blind only int the first 15 seconds of a round, not a map! Because everyday I've got reclamations from other players because they've got banned for no reasons. The admin is so foolish and he executes the command anytime, anywhere, in the middle of the game when the victim is killing enemies.

And the second is with another command, but included amx_blind. This script will work with ex: /report <name of player> and the server will execute the command if there is no admin online or when the clock is 00:00 or the suspect will reach a number of kills.

fysiks 10-20-2010 13:15

Re: Allow only every new round execute
 
Quote:

Originally Posted by killergirl (Post 1330211)
For example: amx_blind .

I was wonderig, to execute amx_blind only int the first 15 seconds of a round, not a map! Because everyday I've got reclamations from other players because they've got banned for no reasons. The admin is so foolish and he executes the command anytime, anywhere, in the middle of the game when the victim is killing enemies.

You explaination is still confusing imo. You want to allow an admin to use a command only in the first 15 seconds of a round?

Quote:

Originally Posted by killergirl (Post 1330211)
And the second is with another command, but included amx_blind. This script will work with ex: /report <name of player> and the server will execute the command if there is no admin online or when the clock is 00:00 or the suspect will reach a number of kills.

"when the clock is 00:00"?? What? Isn't the game over at 00:00?

killergirl 10-20-2010 14:52

Re: Allow only every new round execute
 
Quote:

You explaination is still confusing imo. You want to allow an admin to use a command only in the first 15 seconds of a round?
Yes.

Quote:

"when the clock is 00:00"?? What? Isn't the game over at 00:00?
After 00:00 AM.
Just forget this proposition. I can't explain how my brain want's to works, just forget this.

hleV
Thank you for reply and for idea how to start the plugin.


All times are GMT -4. The time now is 10:17.

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