Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Plugin Freerun - HUD


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 D@ruc

    Profesjonalista

  • Użytkownik

Reputacja: 2
Nowy

  • Postów:201
  • Lokalizacja:Ostrowiec Św.
Offline

Napisano 01.10.2011 21:46

Witam. Posiadam plugin Freerun na serwer DeathRun i mam pewien problem z odblokowaniem wyświetlania się kto na co zagłosował chodzi mi o tą część:

public free_run_menu(id, key)
{
    new name[32]
    get_user_name(id, name, 31)
    if (get_user_team(id) == 1 && key)
    {
        ColorChat(0, RED, "[Pro-Zone]^x01 Ohh, sh~t, terrorist ^x04%s^x01 is not accept free!! <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />", name)
        remove_task(TASK_VOTE_RESULT)
        g_vote_started = false
    }
    else
    {    
        ColorChat(0, RED, "[Pro-Zone]^x01 ^x04%s^x01 voted free ^x04%s^x01", name, (key ? "no" : "yes"))
        g_votes[key]++
    }
}


a o to cały plugin:

/* 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_percent, g_cvar_max_free, g_cvar_t_only

public plugin_init()
{
    register_plugin(PLUGIN, VERSION, AUTHOR)
    
    g_cvar_percent = register_cvar("dh_free_run_percent", "60")
    g_cvar_max_free = register_cvar("dh_free_run_max", "1000")
    g_cvar_t_only = register_cvar("dh_free_run_t_only", "1")
    
    register_clcmd("say free", "cmdFree")
    register_clcmd("say /free", "cmdFree")
    
    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 eventRoundStart()
{
    g_free = false
    g_free_try = false
    g_vote_started = false
    arrayset(g_votes, 0, 3)
    remove_task(TASK_VOTE_RESULT)
}

public free_run_menu(id, key)
{
    new name[32]
    get_user_name(id, name, 31)
    if (get_user_team(id) == 1 && key)
    {
        ColorChat(0, RED, "[Pro-Zone]^x01 Ohh, sh~t, terrorist ^x04%s^x01 is not accept free!! <img src='https://amxx.pl/public/style_emoticons/<#EMO_DIR#>/sad.png' class='bbc_emoticon' alt=':(' />", name)
        remove_task(TASK_VOTE_RESULT)
        g_vote_started = false
    }
    else
    {    
        ColorChat(0, RED, "[Pro-Zone]^x01 ^x04%s^x01 voted free ^x04%s^x01", name, (key ? "no" : "yes"))
        g_votes[key]++
    }
}

public cmdFree(id)
{
    if (get_pcvar_num(g_cvar_t_only) && get_user_team(id) != 1)
        client_print(id, print_center, "TYLKO TT!")
    else if (g_free)
        client_print(id, print_center, "JEST FREERUN!")
    else if (g_vote_started)
        client_print(id, print_center, "GLOSOWANIE TRWA!")
    else if (g_free_try)
        client_print(id, print_center, "GLOSOWANIE JUZ BYLO!")
    else if (g_free_count >= get_pcvar_num(g_cvar_max_free))
        client_print(id, print_center, "LIMIT GLOSOWAN OSIAGNIETY!")
    else if (!is_user_alive(id))
        client_print(id, print_center, "TYLKO ZYWY MOZESZ GLOSOWAC!")        
    else
    {
        new menu[256], len, players[32], plNum, i
        len = format(menu, charsmax(menu), "\yGRAMY FREERUN?\w^n^n")
        len += format(menu[len], charsmax(menu) - len, "1. TAK^n")
        len += format(menu[len], charsmax(menu) - len, "2. NIE^n")
        
        get_players(players, plNum, "ach")
        
        for (i = 0; i < plNum; i++)
            show_menu(players[i], MENU_KEY_1|MENU_KEY_2, menu, 15)
        
        g_free_try = true
        g_vote_started = true
        set_task(15.0, "voteResult", TASK_VOTE_RESULT)
    }
}

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(0, RED, "[Pro-Zone]^x01 Gramy^x04 FREERUN^x01!")
        
        new players[32], plNum, i
        get_players(players, plNum, "ah")
        for (i = 0; i < plNum; i++)
        {
            fm_strip_user_weapons(players[i])
            fm_give_item(players[i], "weapon_knife")
        }    
    }
    else
        ColorChat(0, RED, "[Pro-Zone]^x01 ^x04 FREERUN^x01 nie zostal wybrany!")
        
    g_vote_started = false
}

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

public fwdUse(ent, idcaller, idactivator, use_type, Float:value)
{
    if (is_user_alive(idactivator) && g_free && get_user_team(idactivator) == 1)
    {
        client_print(idactivator, print_center, "WYBRANO FREERUN!")
        return HAM_SUPERCEDE
    }
    return HAM_IGNORED
}

Proszę o pomoc.
  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych