Raised This Month: $32 Target: $400
 8% 

[FUN] How to random frag all player's every 10sec?


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 , 19:53   [FUN] How to random frag all player's every 10sec?
Reply With Quote #1

Hi Everyone!

I have a fun server, how can I every 10 minutes add all player's random kills and deaths?

Thank you for help!

Sorry, for my bad english
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
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-03-2018 , 20:34   Re: [FUN] How to random frag all player's every 10sec?
Reply With Quote #2

You could set a repeating task for 600 seconds and execute code that does what you want to all the players.
__________________
fysiks is offline
ultimatgold
BANNED
Join Date: Jan 2013
Location: https://t.me/pump_upp
Old 06-03-2018 , 21:25   Re: [FUN] How to random frag all player's every 10sec?
Reply With Quote #3

The trouble I can not write. I tried.
Please someone write to me.

Code:
#include <amxmodx>
#include <amxmisc>
 
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
 
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_event("DeathMsg","death","a")	
}
public death(id){
new killer = read_data(1)
new victim = read_data(2)
new fragnum = random_num(1,100)
if(killer != victim)
{
new players[32], num, player
get_players(players, num)
player = players[random(num)]
set_user_frags (player, get_user_frags(player)+fragnum)
}
return PLUGIN_HANDLED
}
Quote:
Originally Posted by fysiks View Post
You could set a repeating task for 600 seconds and execute code that does what you want to all the players.
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
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 06-04-2018 , 01:24   Re: [FUN] How to random frag all player's every 10sec?
Reply With Quote #4

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

#define lower 1
#define upper 4
#define TaskTime 5.0

new cvarx

public plugin_init()
{
    
register_plugin("Random Frags and Deaths""1.0""DiGiTaL")
    
register_clcmd("say /addfrags""cmdexec")
    
cvarx register_cvar("mode""1")
}

public 
cmdexec() set_task(TaskTime"checkRandom")

public 
checkRandom()
{
    new 
players[32], iNumx
    get_players
(playersiNum)
    for(new 
iiNumi++)
    {
        
players[i]
        switch(
get_pcvar_num(cvarx))
        {
            case 
1set_user_frags(xget_user_frags(x) + random_num(lowerupper))
            case 
2cs_set_user_deaths(xget_user_deaths(x) - random_num(lowerupper))
        }
    }

instinctpt1 is offline
ultimatgold
BANNED
Join Date: Jan 2013
Location: https://t.me/pump_upp
Old 06-04-2018 , 08:59   Re: [FUN] How to random frag all player's every 10sec?
Reply With Quote #5

This code random add frags every 10sec, or no? I see this: #define TaskTime 5.0 This is maybe 5 second?

And 1 more question. Whats this?
#define lower 1
#define upper 4


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

#define lower 1
#define upper 4
#define TaskTime 5.0

new cvarx

public plugin_init()
{
    
register_plugin("Random Frags and Deaths""1.0""DiGiTaL")
    
register_clcmd("say /addfrags""cmdexec")
    
cvarx register_cvar("mode""1")
}

public 
cmdexec() set_task(TaskTime"checkRandom")

public 
checkRandom()
{
    new 
players[32], iNumx
    get_players
(playersiNum)
    for(new 
iiNumi++)
    {
        
players[i]
        switch(
get_pcvar_num(cvarx))
        {
            case 
1set_user_frags(xget_user_frags(x) + random_num(lowerupper))
            case 
2cs_set_user_deaths(xget_user_deaths(x) - random_num(lowerupper))
        }
    }

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
ultimatgold
BANNED
Join Date: Jan 2013
Location: https://t.me/pump_upp
Old 06-04-2018 , 10:00   Re: [FUN] How to random frag all player's every 10sec?
Reply With Quote #6

Ahh okay, i understand I tested on server, and I will come Back
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
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, India
Old 06-04-2018 , 11:23   Re: [FUN] How to random frag all player's every 10sec?
Reply With Quote #7

Quote:
Originally Posted by ultimatgold View Post
This code random add frags every 10sec, or no? I see this: #define TaskTime 5.0 This is maybe 5 second?

And 1 more question. Whats this?
#define lower 1
#define upper 4
You posted your thread in Scripting help ..
So i guess you should know.. what it is
instinctpt1 is offline
ultimatgold
BANNED
Join Date: Jan 2013
Location: https://t.me/pump_upp
Old 06-04-2018 , 12:32   Re: [FUN] How to random frag all player's every 10sec?
Reply With Quote #8

Sorry, now i know this

Quote:
Originally Posted by instinctpt1 View Post
You posted your thread in Scripting help ..
So i guess you should know.. what it is
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
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 21:42.


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