Raised This Month: $ Target: $400
 0% 

[FreeRun]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
f0xZ
Junior Member
Join Date: Jan 2010
Location: UA (Volnogorsk)
Old 02-05-2010 , 12:55   [FreeRun]
Reply With Quote #1

help finish the plugin =)
Since the plugin author does not want it gradually completed
Need to do so would be 'free' can be used the first 20 seconds of the round.

Sorry for my bad english...
Attached Files
File Type: sma Get Plugin or Get Source (freerun.sma - 1723 views - 3.6 KB)

Last edited by f0xZ; 02-05-2010 at 13:01.
f0xZ is offline
Send a message via ICQ to f0xZ
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 02-05-2010 , 15:06   Re: [FreeRun]
Reply With Quote #2

Explain what it needs to be?
Whats freerun?
__________________
Retired.
Xalus is offline
One
Veteran Member
Join Date: Oct 2008
Location: Hardstyle-eSports.de
Old 02-05-2010 , 21:47   Re: [FreeRun]
Reply With Quote #3

so here you go

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <hamsandwich>
#include <fakemeta_util>
#include <colorchat>

#define PLUGIN "FreeRun"
#define VERSION "0.1.0"
#define AUTHOR "PomanoB"

#define TASK_VOTE_RESULT 5486

new bool:g_free
new bool:g_vote_started
new bool:g_free_try

new g_free_count

new g_votes[3]

new 
g_cvar_percentg_cvar_max_freeg_cvar_t_only
new passed
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
g_cvar_percent register_cvar("dh_free_run_percent""60")
    
g_cvar_max_free register_cvar("dh_free_run_max""3")
    
g_cvar_t_only register_cvar("dh_free_run_t_only""0")
    
    
register_clcmd("say free""cmdFree")
    
set_task(20.0,"passing")
    
register_event("HLTV""eventRoundStart""a""1=0""2=0")
    
    
RegisterHam(Ham_Touch"armoury_entity""fwdTouch")
    
RegisterHam(Ham_Touch"weaponbox""fwdTouch")
    
RegisterHam(Ham_Use"func_button""fwdUse")
    
    
register_menucmd(register_menuid("Free?"), MENU_KEY_1|MENU_KEY_2"free_run_menu")
}
public 
passing()
{
    
passed 1
}
public 
eventRoundStart()
{
    
g_free false
    g_free_try 
false
    g_vote_started 
false
    arrayset
(g_votes03)
    
remove_task(TASK_VOTE_RESULT)
    
passed 0
}

public 
free_run_menu(idkey)
{
    new 
name[32]
    
get_user_name(idname31)
    if (
get_user_team(id) == && key)
    {
        
ColorChat(0RED"[DeathRun]^x01 Ohh, sh~t, terrorist ^x04%s^x01 is not accept free!! :("name)
        
remove_task(TASK_VOTE_RESULT)
        
g_vote_started false
    
}
    else
    {    
        
ColorChat(0RED"[DeathRun]^x01 ^x04%s^x01 voted free ^x04%s^x01"name, (key "no" "yes"))
        
g_votes[key]++
    }
}

public 
cmdFree(id)
{
    if(
passed)
    {
        
client_print(id,print_chat,"20 sec. are passed, you cant do a freerun anymore")
        return 
PLUGIN_HANDLED
    
}
    if (
get_pcvar_num(g_cvar_t_only) && get_user_team(id) != 1)
        
client_print(idprint_center"Only T can Use it!")
    else if (
g_free)
        
client_print(idprint_center"Already FreeRun!")
    else if (
g_vote_started)
        
client_print(idprint_center"FreeRun vote started!")
    else if (
g_free_try)
        
client_print(idprint_center"FreeRun vote already been!")
    else if (
g_free_count >= get_pcvar_num(g_cvar_max_free))
        
client_print(idprint_center"FreeRun count max for this map!")
    else if (!
is_user_alive(id))
        
client_print(idprint_center"Only alive can use it!")        
    else
    {
        new 
menu[256], lenplayers[32], plNumi
        len 
format(menucharsmax(menu), "\yFree?\w^n^n")
        
len += format(menu[len], charsmax(menu) - len"1. Yes^n")
        
len += format(menu[len], charsmax(menu) - len"2. No^n")
        
        
get_players(playersplNum"ach")
        
        for (
0plNumi++)
            
show_menu(players[i], MENU_KEY_1|MENU_KEY_2menu15)
        
        
g_free_try true
        g_vote_started 
true
        set_task
(15.2"voteResult"TASK_VOTE_RESULT)
    }
    return 
PLUGIN_HANDLED
}

public 
voteResult()
{
    if (!
g_votes[1] || ( g_votes[0] * 100 / (g_votes[1] + g_votes[0])> get_pcvar_num(g_cvar_percent)))
    {
        
g_free true
        
        g_free_count
++
        
        
ColorChat(0RED"[DeathRun]^x01 Now play ^x04 FREERUN^x01 mode!! Ohh, gamers, if you failing, you really noobs :(")
        
        new 
players[32], plNumi
        get_players
(playersplNum"ah")
        for (
0plNumi++)
        {
            
fm_strip_user_weapons(players[i])
            
fm_give_item(players[i], "weapon_knife")
        }    
    }
    else
        
ColorChat(0RED"[DeathRun]^x01 ^x04 FREERUN^x01 mode is not choisen. Play DeathRun and not Fail!"
        
    
g_vote_started false
}

public 
fwdTouch(entid)
{
    if (
is_user_alive(id) && g_free)
        return 
HAM_SUPERCEDE
    
return HAM_IGNORED
}

public 
fwdUse(entidcalleridactivatoruse_typeFloat:value)
{
    if (
is_user_alive(idactivator) && g_free && get_user_team(idactivator) == 1)
    {
        
client_print(idactivatorprint_center"You choose FreeRun!")
        return 
HAM_SUPERCEDE
    
}
    return 
HAM_IGNORED

after 20 sec. you will get the message that 20 sec. are over and you cant use the free command anymore... i think its that what you wanted.

added:



Code:
new passed

public passing()
{
    passed = 1
}
public eventRoundStart()
{
    g_free = false
    g_free_try = false
    g_vote_started = false
    arrayset(g_votes, 0, 3)
    remove_task(TASK_VOTE_RESULT)
    passed = 0
    set_task(20.0,"passing")
}


public cmdFree(id)
{
    if(passed)
    {
        client_print(id,print_chat,"20 sec. are passed, you cant do a freerun anymore")
        return PLUGIN_HANDLED
    }
__________________
One is offline
Send a message via ICQ to One Send a message via AIM to One Send a message via MSN to One Send a message via Yahoo to One Send a message via Skype™ to One
f0xZ
Junior Member
Join Date: Jan 2010
Location: UA (Volnogorsk)
Old 02-06-2010 , 03:55   Re: [FreeRun]
Reply With Quote #4

Thanks =)
f0xZ is offline
Send a message via ICQ to f0xZ
Melisko
Senior Member
Join Date: Feb 2010
Old 03-06-2010 , 11:49   Re: [FreeRun]
Reply With Quote #5

Hey , This plugin will drop CTs USPs and CTs cant pick up weapons??? like mp5 etc.... And , also this FreeRun can be played only every 3rd round?
Melisko is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 03-06-2010 , 14:31   Re: [FreeRun]
Reply With Quote #6

about max 3freeruns

g_cvar_max_free = register_cvar("dh_free_run_max", "3")

Its a cvar.
Maybe if u set it 0
__________________
Retired.
Xalus is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 03-06-2010 , 14:32   Re: [FreeRun]
Reply With Quote #7

and maybe about that weapons

remove:

PHP Code:
RegisterHam(Ham_Touch"weaponbox""fwdTouch"
PHP Code:
public fwdTouch(entid)
{
    if (
is_user_alive(id) && g_free)
        return 
HAM_SUPERCEDE
    
return HAM_IGNORED

__________________
Retired.
Xalus is offline
Melisko
Senior Member
Join Date: Feb 2010
Old 03-06-2010 , 16:32   Re: [FreeRun]
Reply With Quote #8

Quote:
Originally Posted by Xalus View Post
and maybe about that weapons

remove:

PHP Code:
RegisterHam(Ham_Touch"weaponbox""fwdTouch"
PHP Code:
public fwdTouch(entid)
{
    if (
is_user_alive(id) && g_free)
        return 
HAM_SUPERCEDE
    
return HAM_IGNORED


And can u add it to the script and post the .sma??? because Im not good scripter at all...
Melisko is offline
|LGN| Senzi
New Member
Join Date: Jun 2010
Old 08-21-2010 , 07:29   Re: [FreeRun]
Reply With Quote #9

Same Melisko ..

Can u do that pls ?
__________________
Genocid.ro Gaming (GNC) ROMANIA !
www.GENOCID.ro
|LGN| Senzi is offline
Send a message via Yahoo to |LGN| Senzi
debilekCZ
Junior Member
Join Date: Apr 2010
Old 01-29-2011 , 16:44   Re: [FreeRun]
Reply With Quote #10

yeh, nice ideas... work... but please add it all in ONE !! ;-)
debilekCZ 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 08:24.


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