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

Random Command every 10 sec


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ultimatgold
BANNED
Join Date: Jan 2013
Location: https://t.me/pump_upp
Old 06-03-2018 , 21:53   Random Command every 10 sec
Reply With Quote #1

Hi!

I'm looking for a plugin that randomly time(10-20sec) executes a command I've made on players.
amx_slay <name or #userid> or amx_kick <name or #userid> etc..

Thank you very mutch for help!
ultimatgold is offline
Send a message via ICQ to ultimatgold Send a message via AIM to ultimatgold Send a message via Yahoo to ultimatgold Send a message via Skype™ to ultimatgold
akcaliberg
Senior Member
Join Date: Nov 2011
Location: Istanbul
Old 06-04-2018 , 04:40   Re: Random Command every 10 sec
Reply With Quote #2

Create an array of the commands you would like to be executed randomly.
Set a timed task that will be executed every 10-20 seconds.
Get a random number between 0 and the size of your commands array.
Use that number as the index of the commands array.
=> You have a random command.
akcaliberg is offline
ultimatgold
BANNED
Join Date: Jan 2013
Location: https://t.me/pump_upp
Old 06-04-2018 , 08:55   Re: Random Command every 10 sec
Reply With Quote #3

Give me the code pls, i don't understand you

Quote:
Originally Posted by akcaliberg View Post
Create an array of the commands you would like to be executed randomly.
Set a timed task that will be executed every 10-20 seconds.
Get a random number between 0 and the size of your commands array.
Use that number as the index of the commands array.
=> You have a random command.
ultimatgold is offline
Send a message via ICQ to ultimatgold Send a message via AIM to ultimatgold Send a message via Yahoo to ultimatgold Send a message via Skype™ to ultimatgold
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 06-04-2018 , 11:44   Re: Random Command every 10 sec
Reply With Quote #4

Quote:
Originally Posted by ultimatgold View Post
Give me the code pls, i don't understand you
https://forums.alliedmods.net/forumdisplay.php?f=12
__________________
ddhoward is offline
Old 06-04-2018, 12:14
4ever16
This message has been deleted by 4ever16.
ultimatgold
BANNED
Join Date: Jan 2013
Location: https://t.me/pump_upp
Old 06-04-2018 , 12:31   Re: Random Command every 10 sec
Reply With Quote #5

What this pause and unpause? Random player kick 20sec. This code is good, or not?

PHP 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_start(id)
{
    
set_task 20.0"x1"id );    
}

public 
x1()
{
        
unpause("ac","amx_kick");    

Quote:
Originally Posted by 4ever16 View Post
Not the perfect one but you can remake this.
Instead of "unpause("ac","a2.amxx"); " you make the command you want to run.

When freezetime is over 1 second later it will run a command, 20 seconds later it will run command 2, 40 seconds later it will run command 3.


PHP 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_start(id)
{
    
set_task 1.0"x1"id );
        
set_task 20.0"x2"id );   
        
set_task 40.0"x3"id );     
}

public 
x1()
{
        
unpause("ac","a2.amxx");    
}

public 
x2()
{
        
pause("ac","a2.amxx"); 
}

public 
x3()
{
        
your command

ultimatgold is offline
Send a message via ICQ to ultimatgold Send a message via AIM to ultimatgold Send a message via Yahoo to ultimatgold Send a message via Skype™ to ultimatgold
Old 06-04-2018, 13:57
4ever16
This message has been deleted by 4ever16.
4ever16
Veteran Member
Join Date: Apr 2015
Old 06-04-2018 , 20:20   Re: Random Command every 10 sec
Reply With Quote #6

Try this one instead.
6 seconds after round has ended it will run a command.
Change the command and time to what you want.

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

#define PLUGIN "New Plug-In" 
#define VERSION "1.0" 
#define AUTHOR "bugsy" 

public plugin_init()  

    
register_plugin(PLUGINVERSIONAUTHOR
    
register_logevent("logevent_round_end"2"1=Round_End")  

  
public 
logevent_round_end()  

    
set_task(6.0"x1" 

  
public 
x1()  

server_cmd("amx_kick STEAMid")


Last edited by 4ever16; 06-04-2018 at 20:23.
4ever16 is offline
eyal282
Veteran Member
Join Date: Aug 2011
Old 06-05-2018 , 02:19   Re: Random Command every 10 sec
Reply With Quote #7

Should the command execute on all players?
__________________
I am available to make plugins for pay.

Discord: Eyal282#1334
eyal282 is offline
Old 06-05-2018, 06:18
instinctpt1
This message has been deleted by instinctpt1. Reason: Out of context
allroundernaman
Member
Join Date: May 2020
Location: Somewhere Virtual
Old 05-20-2020 , 07:54   Re: Random Command every 10 sec
Reply With Quote #8

Hello!
Can someone help me? Just add a condition that this wont work on admins. Admins must be safe from this random commands.

thanks!
allroundernaman 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 05:09.


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