Raised This Month: $ Target: $400
 0% 

[ES] Random menu map hellowen


  
 
 
Thread Tools Display Modes
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 05-18-2010 , 13:08   Re: [ES] Random menu map hellowen
#11

ya pss superenlo

xd
__________________
capostrike93 is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 05-18-2010 , 13:19   Re: [ES] Random menu map hellowen
#12

Quote:
Originally Posted by marianow View Post
IVA.
http://es.wikipedia.org/wiki/Impuesto_al_valor_agregado
__________________
"There is no knowledge, that is not power"
fezh is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 05-18-2010 , 13:22   Re: [ES] Random menu map hellowen
#13

no es el unico iva..

Individual Voluntary Arrangement
Individual Vehicle Approval
Independent Voters Association
Interaction value analysis
...
__________________
capostrike93 is offline
Helloween
BANNED
Join Date: May 2010
Location: 23 de enero
Old 05-18-2010 , 19:16   Re: [ES] Random menu map hellowen
#14

capo he colocado el codigo identico como lo haz puesto y sigue sin funcionar sera que hay q mover el codigo? claro a otra parte del load_votemap? que podra ser entonces? sigue sin mostrar el menu :S
Helloween is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 05-18-2010 , 23:16   Re: [ES] Random menu map hellowen
#15

a ver muestrame el codigo original del yap_menu..
__________________
capostrike93 is offline
Helloween
BANNED
Join Date: May 2010
Location: 23 de enero
Old 05-19-2010 , 19:27   Re: [ES] Random menu map hellowen
#16

aqui esta:
Attached Files
File Type: sma Get Plugin or Get Source (yap_menu.sma - 470 views - 18.1 KB)

Last edited by Helloween; 05-20-2010 at 01:45.
Helloween is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 05-20-2010 , 02:05   Re: [ES] Random menu map hellowen
#17

lo q pasa es q modificaste cosas q no tenias q mover.. usa el ultimo sma q pusiste -->http://forums.alliedmods.net/showpos...9&postcount=17 y nada mas cambia la funcion


public load_votemap_menu(filename[])..

por

PHP Code:
public load_votemap_menu(filename[])
{
    new 
file fopen(filename,"rb")

    static 
text[MAX_MAPS][256], szDesc[MAX_MAPS][48]
    while( (
pug_votemap_count MAX_MAPS) && !feof(file) && fgets(file,text[pug_votemap_count],255) )
    {
        
// Rukia: Take out common comment conventions
        
if(text[pug_votemap_count][0]==';') continue
        if( (
text[pug_votemap_count][0]=='/') && (text[pug_votemap_count][1]=='/') ) continue

        
// Rukia: Remove the newline character
        
text[strlen(text[pug_votemap_count])] = '^0'

        
// Rukia: Get the map name and description out of what we read
        
strbreak(text[pug_votemap_count],pug_votemap_name[pug_votemap_count],31,szDesc[pug_votemap_count],47)
        
// Rukia: If the map is invalid, skip it
        
if( !is_map_validpug_votemap_name[pug_votemap_count] ) ) continue;

        
// Rukia: If there is no description (such as if we use mapcycle) then just use the first part of the map name
        
if(szDesc[pug_votemap_count][0] == '^0'strtok(pug_votemap_name[pug_votemap_count],szDesc[pug_votemap_count],47,"",0,'.',1)
    
        
pug_votemap_count++;
    }

    
fclose(file)
    
    new 
i,o,bool:active[20]
    do
    {
        
o=random_num(0,pug_votemap_count-1)
        if(!
active[o] && random_num(0,2)==1)
        {
            
menu_additem(pug_votemap_menupug_votemap_name[i],++)
            
            
active[o] = true;
        }
    }
    while(
i<pug_votemap_count)

__________________

Last edited by capostrike93; 05-20-2010 at 02:58.
capostrike93 is offline
Helloween
BANNED
Join Date: May 2010
Location: 23 de enero
Old 05-20-2010 , 02:20   Re: [ES] Random menu map hellowen
#18

gracias capo ^^ pero me da estos errores al compilar:
Attached Thumbnails
Click image for larger version

Name:	help.JPG
Views:	128
Size:	62.6 KB
ID:	66004  

Last edited by Helloween; 05-20-2010 at 02:38.
Helloween is offline
capostrike93
Veteran Member
Join Date: Feb 2009
Location: adios y??
Old 05-20-2010 , 02:59   Re: [ES] Random menu map hellowen
#19

eso es por q no usaste el sma q te dije -.-

mira aqui te lo dejo ya puesto ..

PHP Code:
#include <amxmodx>
#include <amxmisc>

#include <yap_menu>
#include <yap_const>
#include <yap_stocks>
#include <yap_natives>
#include <yap_forwards>
#include <yap_modspecific>

new const plugin_author[] = "Twilight Suzuka"
new const plugin_name[] = "YAP-MENU"
new const plugin_version[] = "0.0.1"

public pug_votemap_menu;
public 
pug_voteteam_menu;
public 
pug_voteplayers_menu
public pug_voterestart_menu
public pug_votekick_menu

public pug_cvar_vote_time;
public 
pug_cvar_vote_perc;

public 
pug_cvar_votemap
public pug_cvar_votemap_e

public pug_cvar_votekick_perc;

new 
votemap_noswitch

public pug_voting 0;

public 
plugin_init()
{
    
register_plugin(plugin_name,plugin_version,plugin_author);
    
register_dictionary("yap.txt")
    
register_dictionary("yap_vote.txt")

    
pug_cvar_vote_time register_cvar("pug_vote_delay","20")
    
pug_cvar_vote_perc register_cvar("pug_vote_percentage","0.4")

    
pug_cvar_votemap register_cvar("pug_votemap","1")
    
pug_cvar_votemap_e register_cvar("pug_votemap_enabled","1")

    
pug_cvar_votekick_perc register_cvar("pug_votekick_percent","0.7")

    
//register_pug_admincmd("votemap","cmd_votemap",PUG_CMD_LVL,"Starts a vote on map")
    //register_pug_admincmd("voteteams","cmd_voteteams",PUG_CMD_LVL,"Starts a vote on team mode")
    
register_pug_admincmd("voteplayers","cmd_voteplayers",PUG_CMD_LVL,"Starts a vote on game mode")
    
register_pug_admincmd("voterestart","cmd_voterestart",PUG_CMD_LVL,"Starts a vote on whether to restart")
    
register_pug_admincmd("votestop","cmd_voterestart",PUG_CMD_LVL,"Starts a vote on whether to restart")
    
register_pug_admincmd("votecancel","cmd_voterestart",PUG_CMD_LVL,"Starts a vote on whether to restart")
    
register_pug_admincmd("votekick","cmd_votekick",_,"<name or #userid> <reason> Starts a votekick")

    
//parse_header("BOE-E",pug_header,5)
    
    
pug_votemap_menu menu_create("VoteMap:","votemap_handle");
    
pug_voteteam_menu menu_create("TeamType:","voteteam_handle");
    
pug_voterestart_menu menu_create("VoteRestart:","voterestart_handle");
    
pug_votekick_menu menu_create("VoteKick:","votekick_handle");

    
menu_setprop(pug_votemap_menu,MPROP_EXIT,MEXIT_NEVER)

    
menu_additem(pug_voteteam_menu,"Not sorted","1")
    
menu_additem(pug_voteteam_menu,"Skill Sorted","2")
    
menu_additem(pug_voteteam_menu,"Captain Sorted","3")
    
menu_additem(pug_voteteam_menu,"Random","4")
    
menu_setprop(pug_voteteam_menu,MPROP_EXIT,MEXIT_NEVER)

    
menu_additem(pug_voterestart_menu,"Yes","1")
    
menu_additem(pug_voterestart_menu,"No","2")
    
menu_setprop(pug_voterestart_menu,MPROP_EXIT,MEXIT_NEVER)

    
menu_additem(pug_votekick_menu,"Yes","1")
    
menu_additem(pug_votekick_menu,"No","2")
    
menu_setprop(pug_votekick_menu,MPROP_EXIT,MEXIT_NEVER)
}

public 
plugin_cfg() try_load_votemap_menu()

CREATE_GEN_FORW_ID(firsthalf_forward)

public 
pug_firsthalf(GEN_FORW_ID(forward_id))
{
    
firsthalf_forward forward_id

    
if( get_pcvar_num(pug_cvar_votemap_e) && get_pcvar_num(pug_cvar_votemap) ) votemap_start();
    else 
voteteam_start();

    return 
PLUGIN_HANDLED;
}

public 
pug_finished()
{
    if(!
votemap_noswitchset_pcvar_num(pug_cvar_votemap_e,1)
}


#define MAX_MAPS 20

new pug_votemap_votes[MAX_MAPS]
new 
pug_votemap_name[MAX_MAPS][32]
new 
pug_votemap_count;

public 
try_load_votemap_menu()
{
    
// Rukia: Get our maps.ini
    
static filename[64]
    
get_configsdirfilename63 )
    
formatfilename63"%s/maps.ini"filename )

    
// Rukia: Otherwise, just use mapcycle
    
if(file_exists(filename)) 
    {
        
load_votemap_menu(filename)
        if(
pug_votemap_count != 0) return;
    }

    
copy(filename,63,"mapcycle.txt")
    
load_votemap_menu(filename)
}

public 
load_votemap_menu(filename[])
{
    new 
file fopen(filename,"rb")

    static 
text[MAX_MAPS][256], szDesc[MAX_MAPS][48]
    while( (
pug_votemap_count MAX_MAPS) && !feof(file) && fgets(file,text[pug_votemap_count],255) )
    {
        
// Rukia: Take out common comment conventions
        
if(text[pug_votemap_count][0]==';') continue
        if( (
text[pug_votemap_count][0]=='/') && (text[pug_votemap_count][1]=='/') ) continue

        
// Rukia: Remove the newline character
        
text[strlen(text[pug_votemap_count])] = '^0'

        
// Rukia: Get the map name and description out of what we read
        
strbreak(text[pug_votemap_count],pug_votemap_name[pug_votemap_count],31,szDesc[pug_votemap_count],47)
        
// Rukia: If the map is invalid, skip it
        
if( !is_map_validpug_votemap_name[pug_votemap_count] ) ) continue;

        
// Rukia: If there is no description (such as if we use mapcycle) then just use the first part of the map name
        
if(szDesc[pug_votemap_count][0] == '^0'strtok(pug_votemap_name[pug_votemap_count],szDesc[pug_votemap_count],47,"",0,'.',1)
    
        
pug_votemap_count++;
    }

    
fclose(file)
    
    new 
i,o,bool:active[20]
    do
    {
        
o=random_num(0,pug_votemap_count-1)
        if(!
active[o] && random_num(0,2)==1)
        {
            
menu_additem(pug_votemap_menupug_votemap_name[i],++)
            
            
active[o] = true;
        }
    }
    while(
i<pug_votemap_count)
}  

public 
cmd_votemap(id,level,cid)
{
    if (!
cmd_access(idlevelcid1) ) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")
    
    
votemap_start()
    return 
PLUGIN_HANDLED;
}

public 
votemap_start()
{
    if(
pug_voting) { set_task(get_pcvar_float(pug_cvar_vote_time),"votemap_start",100 pug_votemap_menu); return; }

    
pug_voting 1;
    
arrayset(pug_voted,0,33)

    
arrayset(pug_votemap_votes,0,pug_votemap_count)
    
pug_display_menu_all(pug_votemap_menu)

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""PUG map");
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""PUG map");
    
set_task(get_pcvar_float(pug_cvar_vote_time),"votemap_end",100 pug_votemap_menu)
}

public 
votemap_end()
{
    
pug_cancel_menu()

    
pug_voting 0;
    
remove_task 100 pug_votemap_menu )

    if(
votemap_count()) voteteam_start();
}

public 
votemap_handle(idmenuitem)
{
    if( 
item ) return PLUGIN_CONTINUE;
 
    static 
accesscallback
    
static cmd[3], name[32], cmdname[32]
 
    
menu_item_getinfo(menuitemaccesscmd,2,cmdname,31callback);
    
pug_votemap_votes[str_to_num(cmd)]++;

    
get_user_name(id,name,31)
        
    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);

    
pug_voted[id] = 1;
    if(
pug_should_stopvote() ) votemap_end()
 
    return 
PLUGIN_HANDLED;
}

public 
votemap_count()
{
    new 
winnerwinner_votesvotes

    
for(new 0pug_votemap_count; ++i)
    {
        
votes pug_votemap_votes[i]
        if(
votes winner_votes) { winner iwinner_votes votes; }
        else if(
votes == winner_votes) if(random_num(0,1)) { winner iwinner_votes votes; }
    }

    if(
pug_votemap_votes[winner] == 0) return pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_NOVOTES")

    new 
Floattmp float(pug_get_players()) * get_pcvar_float(pug_cvar_vote_perc
    if( 
pug_votemap_votes[winner] < floatround(tmp,floatround_floor) )
    {
        return 
pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_INSUF_VOTES");
    }

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_votemap_name[winner]);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_votemap_name[winner]);

    
pug_voting 0;
    
votemap_noswitch 1;
    
set_pcvar_num(pug_cvar_votemap_e,0)

    
message_begin(MSG_ALLSVC_INTERMISSION)
    
message_end()

    
set_task(5.0,"pug_votemap_change",winner)
    return 
PLUGIN_CONTINUE
}

public 
pug_votemap_change(winner)
{
    
server_cmd("changelevel %s",pug_votemap_name[winner]);
}

new 
pug_voteteam_votes[5]

public 
cmd_voteteam(id,level,cid)
{
    if (!
cmd_access(idlevelcid1) ) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

    
voteteam_start()
    return 
PLUGIN_HANDLED;
}

public 
voteteam_start()
{
    if(
pug_voting) { set_task(get_pcvar_float(pug_cvar_vote_time),"voteteam_start",100 pug_voteteam_menu); return; }

    
pug_voting 1;
    
arrayset(pug_voted,0,33)

    
arrayset(pug_voteteam_votes,0,5)
    
pug_display_menu_all(pug_voteteam_menu)

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""team type");
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""team type");

    
set_task(get_pcvar_float(pug_cvar_vote_time),"voteteam_end",100 pug_voteteam_menu)
}

public 
voteteam_end()
{
    
pug_cancel_menu()
    
voteteam_count()

    
pug_voting 0;
    
remove_task 100 pug_voteteam_menu )

    
continue_gen_forward(firsthalf_forward)
}

public 
voteteam_handle(idmenuitem)
{
    if( 
item ) return PLUGIN_CONTINUE;

    static 
accesscallback
    
static cmd[3], name[32], cmdname[32]
 
    
menu_item_getinfo(menuitemaccesscmd,2,cmdname,31callback);
    
pug_voteteam_votes[str_to_num(cmd)]++;

    
get_user_name(id,name,31)
        
    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);

    
pug_voted[id] = 1;
    if(
pug_should_stopvote() ) voteteam_end()
 
    return 
PLUGIN_HANDLED;
}

public 
voteteam_count()
{

    new 
winrar = (pug_voteteam_votes[1] > pug_voteteam_votes[2]) ? 2
    
new winrar2 = (pug_voteteam_votes[3] > pug_voteteam_votes[4]) ? 4
    
    
new allwinrar = (pug_voteteam_votes[winrar] > pug_voteteam_votes[winrar2]) ? winrar winrar2;
    
    switch(
allwinrar)
    {
        case 
1pug_msg_tmp_empty(0,"PUG_VOTETEAM_UNSORT");
        case 
2: { pug_teams_optimize(); pug_msg_tmp_empty(0,"PUG_VOTETEAM_SKILLSORT"); }
        case 
3: { pug_teams_captainsort(); pug_msg_tmp_empty(0,"PUG_VOTETEAM_CAPTAINSORT"); }
        case 
4: { pug_teams_randomize(); pug_msg_tmp_empty(0,"PUG_VOTETEAM_RANDOM"); }
    }
}

public 
pug_teams_captainsort()
{
    
pug_msg_tmp_empty(0,"Captain sort not yet implimented, using random sort");
    
pug_teams_randomize();
}

new 
pug_voteplayers_votes[33]
new 
pug_voteplayers_name[33][32]
new 
pug_voteplayers_count;

public 
assemble_voteplayers_menu()
{
    new 
team_num pug_num_teams()
    new 
upper_limit get_maxplayers() / team_num;

    static 
cmd_name[32], cmd_num[3]

    for(new 
1<= upper_limit; ++i)
    {
        
formatex(cmd_name,31,"%i vs. ",i)
        for(new 
2team_num; ++aformat(cmd_name,31,"%s%i vs ",cmd_name,i)
        
format(cmd_name,31,"%s%i",cmd_name,i)

        
formatex(pug_voteplayers_name[i],31,cmd_name)

        
formatex(cmd_num,2,"%i",i)
        
menu_additem(pug_voteplayers_menu,cmd_name,cmd_num)

        ++
pug_voteplayers_count
    
}
    
menu_setprop(pug_voteplayers_menu,MPROP_EXIT,MEXIT_NEVER)
}

public 
cmd_voteplayers(id,level,cid)
{
    if (!
cmd_access(idlevelcid1) ) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

    
voteplayers_start()
    return 
PLUGIN_HANDLED;
}

public 
voteplayers_start()
{
    if(
pug_voting) { set_task(get_pcvar_float(pug_cvar_vote_time),"voteplayers_start",100 pug_voteplayers_menu); return; }

    
pug_voting 1;
    
arrayset(pug_voted,0,33)

    
pug_voteplayers_menu menu_create("Players:","voteplayers_handle");
    
assemble_voteplayers_menu()

    
arrayset(pug_voteplayers_votes,0,33)
    
pug_display_menu_all(pug_voteplayers_menu)

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""game type");
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""game type");

    
set_task(get_pcvar_float(pug_cvar_vote_time) ,"voteplayers_end",100 pug_voteplayers_menu)
}

public 
voteplayers_end()
{
    
pug_cancel_menu()
    
menu_destroy pug_voteplayers_menu )

    
voteplayers_count()

    
pug_voting 0;
    
remove_task 100 pug_voteplayers_menu )
}

public 
voteplayers_handle(idmenuitem)
{
    if( 
item ) return PLUGIN_CONTINUE;

    static 
accesscallback
    
static cmd[3], name[32], cmdname[32]
 
    
menu_item_getinfo(menuitemaccesscmd,2,cmdname,31callback);
    
pug_voteplayers_votes[str_to_num(cmd)]++;

    
get_user_name(id,name,31)
        
    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);

    
pug_voted[id] = 1;
    if(
pug_should_stopvote() ) voteplayers_end()
 
    return 
PLUGIN_HANDLED;
}

public 
voteplayers_count()
{
    new 
winnerwinner_votesvotes

    
for(new 0pug_voteplayers_count; ++i)
    {
        
votes pug_voteplayers_votes[i]
        if(
votes winner_votes) { winner iwinner_votes votes; }
        else if(
votes == winner_votes) if(random_num(0,1)) { winner iwinner_votes votes; }
    }

    if(
pug_voteplayers_votes[winner] == 0) return pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_NOVOTES")

    new 
Floattmp float(pug_get_players()) * get_pcvar_float(pug_cvar_vote_perc
    if( 
pug_voteplayers_votes[winner] < floatround(tmp,floatround_floor) )
    {
        return 
pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_INSUF_VOTES");
    }

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_voteplayers_name[winner]);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_voteplayers_name[winner]);

    new 
total_amount pug_num_teams() * winner
    
new upper_limit = (GET_CVAR_MAXPLAYERS() - GET_CVAR_MINPLAYERS()) + total_amount

    SET_CVAR_MAXPLAYERS
(upper_limit)
    
SET_CVAR_MINPLAYERS(total_amount)

    
set_cvar_num("sv_visiblemaxplayers"upper_limit )
    return 
PLUGIN_CONTINUE
}

new 
pug_voterestart_votes[33]
new 
pug_voterestart_name[][] = {"","Yes","No"}
new 
pug_voterestart_count;

public 
cmd_voterestart(id,level,cid)
{
    if (!
cmd_access(idlevelcid1) ) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")
    else 
voterestart_start()

    return 
PLUGIN_HANDLED;
}

public 
voterestart_start()
{
    if(
pug_voting) { set_task(get_pcvar_float(pug_cvar_vote_time),"voterestart_start",100 pug_voterestart_menu); return; }

    
pug_voting 1;
    
arrayset(pug_voted,0,33)

    
arrayset(pug_voterestart_votes,0,33)
    
pug_display_menu_all(pug_voterestart_menu)

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""pug restart");
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""pug restart");

    
set_task(get_pcvar_float(pug_cvar_vote_time) ,"voterestart_end",100 pug_voterestart_menu)
}

public 
voterestart_end()
{
    
pug_cancel_menu()

    
voterestart_count()

    
pug_voting 0;
    
remove_task 100 pug_voterestart_menu )
}

public 
voterestart_handle(idmenuitem)
{
    if( 
item ) return PLUGIN_CONTINUE;

    static 
accesscallback
    
static cmd[3], name[32], cmdname[32]
 
    
menu_item_getinfo(menuitemaccesscmd,2,cmdname,31callback);
    
pug_voterestart_votes[str_to_num(cmd)]++;

    
get_user_name(id,name,31)
        
    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);

    
pug_voted[id] = 1;
    if(
pug_should_stopvote() ) voterestart_end()
 
    return 
PLUGIN_HANDLED;
}

public 
voterestart_count()
{
    new 
winnerwinner_votesvotes

    
for(new 0pug_voterestart_count; ++i)
    {
        
votes pug_voterestart_votes[i]
        if(
votes winner_votes) { winner iwinner_votes votes; }
        else if(
votes == winner_votes) if(random_num(0,1)) { winner iwinner_votes votes; }
    }

    if(
pug_voterestart_votes[winner] == 0) return pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_NOVOTES")

    new 
Floattmp float(pug_get_players()) * get_pcvar_float(pug_cvar_vote_perc
    if( 
pug_voterestart_votes[winner] < floatround(tmp,floatround_floor) )
    {
        return 
pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_INSUF_VOTES");
    }

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_voterestart_name[winner]);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_voterestart_name[winner]);

    if(
winner == 1pug_call_reset()

    return 
PLUGIN_CONTINUE
}


new 
pug_votekick_votes[3]
new 
pug_votekick_name[32]
new 
pug_votekick_reason[50]

public 
cmd_votekick(id,level,cid)
{
    if (!
cmd_access(idlevelcid2) ) return pug_msg_tmp_empty(id,"PUG_CMD_NOTALLOWED")

    
read_argv(1,pug_votekick_name,31)

    new 
target cmd_target(id,pug_votekick_name,1)
    if(!
target) return pug_msg_tmp_empty(id,"PUG_CMD_NOTARGET")
    else 
get_user_name(target,pug_votekick_name,31)
    
    if(
read_argc ( ) > 2read_argv(2,pug_votekick_reason,49)
    else 
formatex(pug_votekick_reason,49,"None")

    
votekick_start()
    return 
PLUGIN_HANDLED;
}

public 
votekick_start()
{
    if(
pug_voting) { set_task(get_pcvar_float(pug_cvar_vote_time),"votekick_start",100 pug_votekick_menu); return; }

    
pug_voting 1;
    
arrayset(pug_voted,0,33)
    
arrayset(pug_votekick_votes,0,3)

    static 
votename[100]
    
formatex(votename,99,"VoteKick: %s (Reason: %s)",pug_votekick_name,pug_votekick_reason)

    
menu_setprop(pug_votekick_menu,MPROP_TITLE,votename)
    
pug_display_menu_all(pug_votekick_menu)

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""kick player");
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_START""kick player");

    
set_task(get_pcvar_float(pug_cvar_vote_time),"votekick_end",100 pug_votekick_menu)
}

public 
votekick_end()
{
    
pug_cancel_menu()
    
votekick_count()

    
pug_voting 0;
    
remove_task 100 pug_votekick_menu )
}

public 
votekick_handle(idmenuitem)
{
    if( 
item ) return PLUGIN_CONTINUE;

    static 
accesscallback
    
static cmd[3], name[32], cmdname[32]
 
    
menu_item_getinfo(menuitemaccesscmd,2,cmdname,31callback);
    
pug_votekick_votes[str_to_num(cmd)]++;

    
get_user_name(id,name,31)
        
    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTED_FOR"namecmdname);

    
pug_voted[id] = 1;
    if(
pug_should_stopvote() ) votekick_end()
 
    return 
PLUGIN_HANDLED;
}

public 
votekick_count()
{
    new 
winner;
    if(
pug_votekick_votes[1] > pug_votekick_votes[2]) winner 1
    
else if(pug_votekick_votes[1] < pug_votekick_votes[2]) winner 2
    
else return pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_TIE");

    if(
pug_votekick_votes[winner] == 0) return pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_NOVOTES")

    new 
Floattmp float(pug_get_players()) * get_pcvar_float(pug_cvar_votekick_perc
    if( 
pug_votekick_votes[winner] < floatround(tmp,floatround_floor) )
    {
        return 
pug_msg_tmp_empty(0,"PUG_VOTE_FAILED_INSUF_VOTES");
    }

    
client_print(0,print_chat,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_voterestart_name[winner]);
    
console_print(0,"%s %L",pug_headerLANG_PLAYER"PUG_VOTE_WON"pug_voterestart_name[winner]);

    if(
winner == 1server_cmd("amx_kick %s %s",pug_votekick_name,pug_votekick_reason)
    
    return 
PLUGIN_HANDLED

__________________
capostrike93 is offline
Helloween
BANNED
Join Date: May 2010
Location: 23 de enero
Old 05-20-2010 , 09:55   Re: [ES] Random menu map hellowen
#20

si pero igual al colocarlo con el codigo dio 2 errores! y recuerda que yo ya no utilizo ese codigo viejo ya que en el nuevo que es este:

https://forums.alliedmods.net/showpo...46&postcount=8

le he arreglado miles de errores y bugs y he modificado cosas a mi estilo! por eso es que te preguntaba como arreglarlo con el codigo que tengo yo?
Helloween 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 07:16.


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