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

[Resuelto] Votacion bunny hop


  
 
 
Thread Tools Display Modes
Author Message
Sinaloense
Member
Join Date: Jun 2012
Old 07-23-2013 , 13:47   [Resuelto] Votacion bunny hop
#1

Hola me encontre este plugin que es para que cuando escribes /jumpmenu sale un menu para escojer activarte o desactivarte el bunny, lo que yo quiero es que cuando empiese cada ronda salga una votacion sobre si quieren bunny o no pero no e podido >.< espero me puedan ayudar.
PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN    "Jump Menu Modified"
#define VERSION "2.1b"
#define AUTHOR    "v3x"

#define MAX_PLAYERS    33

public plugin_init() 
{
    
register_plugin(PLUGIN VERSION AUTHOR);

    
register_clcmd("say /jumpmenu"    "ClCmd_JumpMenu");
    
register_clcmd("jumpmenu"    "ClCmd_JumpMenu");
}

enum 
{
    
JUMP_REGULAR 0,
    
JUMP_BUNNY,
}

new 
g_iJumpType[33];

public 
client_putinserver(id
    
g_iJumpType[id] = JUMP_REGULAR;

public 
client_disconnect(id
    
g_iJumpType[id] = JUMP_REGULAR;

public 
ClCmd_JumpMenu(id
{
    new 
menu menu_create("Select your jump type:" "menuHandler_Jump");

    
menu_additem(menu "Bunnyhop"        "" 0);
    
menu_additem(menu "Regular"        "" 0);

    
menu_setprop(menu MPROP_EXIT MEXIT_ALL);
    
    
menu_display(id menu 0);

    new 
arg[21];
    
read_argv(arg 20);
    if(!
contain(arg "say"))
        return 
PLUGIN_CONTINUE;

    return 
PLUGIN_HANDLED;
}

public 
menuHandler_Jump(id menu item
{
    if(
item == MENU_EXIT
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
szCommand[6] , szName[64];
    new 
access callback;
    
    
menu_item_getinfo(menu item access szCommand szName 63 callback);
    
    if(
equal(szName "Bunnyhop")) 
    {
        
client_print(id print_chat "[AMXX] Bunnyhop enabled");
        
g_iJumpType[id] = JUMP_BUNNY;

        
menu_destroy(menu); return PLUGIN_CONTINUE;
    }
    else 
    {
        
client_print(id print_chat "[AMXX] Regular jumping enabled");
        
g_iJumpType[id] = JUMP_REGULAR;

        
menu_destroy(menu); return PLUGIN_CONTINUE;
    }
    
    
menu_destroy(menu);
    
    return 
PLUGIN_HANDLED;
}

public 
client_PreThink(id
{
    if(!
is_user_alive(id) || !g_iJumpType[id])
        return 
PLUGIN_CONTINUE;

    
entity_set_float(idEV_FL_fuser20.0)     // Disable slow down after jumping

    // Code from CBasePlayer::Jump (player.cpp)     Make a player jump automatically
    
if (entity_get_int(idEV_INT_button) & 2) {    // If holding jump
        
new flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE
        
if ( entity_get_int(idEV_INT_waterlevel) >= )
            return 
PLUGIN_CONTINUE
        
if ( !(flags FL_ONGROUND) )
            return 
PLUGIN_CONTINUE

        
new Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
velocity[2] += 250.0
        entity_set_vector
(idEV_VEC_velocityvelocity)

        
entity_set_int(idEV_INT_gaitsequence6)    // Play the Jump Animation
    
}

    return 
PLUGIN_CONTINUE;

Sinaloense is offline
MexPower
Veteran Member
Join Date: Nov 2012
Old 07-23-2013 , 14:34   Re: [Ayuda] Votacion bunny hop
#2

Pruebalo
PHP Code:
#include <amxmodx>
#include <engine>

#define maxplayers 32

#define    FL_WATERJUMP    (1<<11)    // player jumping out of water
#define    FL_ONGROUND    (1<<9)    // At rest / on the ground

new vote_yesvote_novotes
new g_bunny

public plugin_init() 
{
    
register_plugin("Super Bunny Hopper""1.2""Cheesy Peteza")
    
    
register_cvar("sbhopper_version""1.2"FCVAR_SERVER)
    
register_event("HLTV""event_new_round""a""1=0""2=0"
}

public 
show_menu2(id)
{
    new 
menu menu_create("Votaciones, desea que se active bunnyhoop esta ronda","handler"), len[10]
    
    
formatex(lencharsmax(len), "Si (%d)"vote_yes)
    
menu_additem(menulen"0")
    
    
formatex(lencharsmax(len), "No (%d)"vote_no)
    
menu_additem(menulen"1")
    
    
menu_display(idmenu0)
}
public 
handler(idmenuitem)
{
    if(!
itemvote_yes++
    else 
vote_no++
        
    
votes++
}
public 
event_new_round()
{
    
vote_yes vote_no votes 0
    g_bunny 
false
    
    
for(new 1<= maxplayersi++)
    {
        if(
is_user_connected(i))
        
show_menu2(i)
    }
        
    
    
set_task(15.0"check_votes")
}

public 
check_votes()
{
    if(
vote_yes >= vote_nog_bunny true
    
else g_bunny false
    
    client_print
(0print_chat"Votacion terminada, A favor: %d/%d, en contra: %d/%d. Bunnyhoop: %sctivado"vote_yesvotesvote_novotesg_bunny "A" "Desa")
}
public 
client_PreThink(id
{
    if(!
g_bunny)
        return 
PLUGIN_CONTINUE;
        
    
entity_set_float(idEV_FL_fuser20.0)        // Disable slow down after jumping

// Code from CBasePlayer::Jump (player.cpp)        Make a player jump automatically
    
if (entity_get_int(idEV_INT_button) & 2) {    // If holding jump
        
new flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE
        
if ( entity_get_int(idEV_INT_waterlevel) >= )
            return 
PLUGIN_CONTINUE
        
if ( !(flags FL_ONGROUND) )
            return 
PLUGIN_CONTINUE

        
new Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
velocity[2] += 250.0
        entity_set_vector
(idEV_VEC_velocityvelocity)

        
entity_set_int(idEV_INT_gaitsequence6)    // Play the Jump Animation
    
}
    return 
PLUGIN_CONTINUE  

Fix
__________________
Allied Modders En Espaņol

Last edited by MexPower; 07-23-2013 at 20:50.
MexPower is offline
Sinaloense
Member
Join Date: Jun 2012
Old 07-23-2013 , 22:08   Re: [Ayuda] Votacion bunny hop
#3

Gracias por segunda ves MexPower me sacaste de otro apuro x.x
Sinaloense is offline
 



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:39.


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