Raised This Month: $ Target: $400
 0% 

deathrun help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr7sTyLe
Senior Member
Join Date: Dec 2010
Old 04-23-2011 , 07:22   deathrun help
Reply With Quote #1

i found this sma that when you type free so its do vote but when vote is succes the CT's can still use weapons can you fix it ?
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""15")
    
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")
public 
fwdTouch(entid)
{
    if (
is_user_alive(id) && g_free)
        return 
HAM_SUPERCEDE
    
return HAM_IGNORED
}  
    
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

Dr7sTyLe is offline
Reply


Thread Tools
Display Modes

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 20:10.


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