Raised This Month: $ Target: $400
 0% 

[help] votemaps


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Snitch
Veteran Member
Join Date: Sep 2013
Location: Kazakhstan
Old 03-29-2014 , 18:05   [help] votemaps
Reply With Quote #1

It will be built on the server time [mod]
timeleft.amxx?

And how can I do: new const Change
To 1?
Without 3 new const = all maps in new const 1 and shares will randomly

At the end votemap it sets the nextmap server and deliver the next Round.

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

#include < amxmodx >
#include < cstrike >
#include < hamsandwich >

new bool:Voted33 ];

new 
g_szRoundVotemap;

new 
g_szKind], TimerEndVote 0;

new const 
Change[][] = { 
"jb_funny_live",
"jail_crewkule",
"jb_flyhigh",
"jail_pyramid"
}
new const 
Change2[][] = { 
"jail_crewkule2",
"jail_aj_bananamuffin_nd",
"jail_rehab_b2",
"jail_xmf"
}
new const 
Change3[][] = { 
"jail_armageddon",
"jail_renner_b6",
"jail_rats"
}
public 
plugin_init() {
register_plugin("Simple VoteMap""1.0""AMXX")

register_event"HLTV""NewRound""a""1=0""2=0" )
}


public 
NewRound()
{
g_szRoundVotemap++;

ColorChat0"there will be votemap in: %i Rounds"g_szRoundVotemap);


if(
g_szRoundVotemap == 3)
set_task1.0"ActionSpecial" );
}
public 
ActionSpecial()
{

for( new 
1<= get_maxplayers(); i++ ){

Voted] = false;
show_menui0"^n");
}

g_szKind] = 0
g_szKind
] = 0
g_szKind
] = 0
g_szKind
] = 
switch(random_num(0,3) ){

case 
0:EndVote 1
case 1:EndVote 2
case 2:EndVote 3
case 3:EndVote 4
}

for( new 
iget_maxplayers(); <= ji++ ){

if( !
is_user_alive) || !is_user_connected) )
continue;

Timer 17
ChangeMaps
(i)
}

client_cmd(0"spk ^"get red(e80ninety(s45to check(e20) use bay(s18mass(e42cap(s50)^""
set_task17.0"checkvotesd",1700 ); 
countdown2();

return 
1;
}


public 
ChangeMaps(client)
{

static 
szMap[128]; 
new 
st];
formatex(szMapcharsmax(szMap), "\r[AMXX]\w Choose Map:^n\r// \wStatus: %s^n\r// \wTime to choose: \y%i",Voted[client] ? "\yVoted" "\rNot Voted"Timer);
new 
menu menu_create(szMap"handlerdddd");
switch(
EndVote)
{
case 
1:

for( new 
ksizeof Changek++ )
{
num_to_strkst);
formatexszMapcharsmaxszMap ), "\w%s \d[\y%i Votes\d]"Change], g_szKind]);
menu_additemmenuszMapst );
}
}
case 
2:
{
for( new 
ksizeof Change2k++ )
{
num_to_strkst);
formatexszMapcharsmaxszMap ), "\w%s \d[\y%i Votes\d]"Change2], g_szKind]);
menu_additemmenuszMap,st );
}
}
case 
3:
{
for( new 
ksizeof Change3k++ )
{
num_to_strkst);
formatexszMapcharsmaxszMap ), "\w%s \d[\y%i Votes\d]"Change3], g_szKind]);
menu_additemmenuszMap,st );


}

}
menu_setpropmenuMPROP_EXITMEXIT_NEVER );
menu_display(client,menu);

}

public 
checkvotesd()

new 
Winner 0;
switch(
EndVote)
{
case 
1:

for( new 
0sizeof Changei++ )
{
if( 
g_szKindWinner ] < g_szKind] )
{
Winner i;
}
}
}
case 
2:
{
for( new 
0sizeof Change2i++ )
{
if( 
g_szKindWinner ] < g_szKind] )
{
Winner i;
}
}
}
case 
3:
{
for( new 
0sizeof Change3i++ )
{
if( 
g_szKindWinner ] < g_szKind] )
{
Winner i;
}
}
}

}
for( new 
1<= get_maxplayers(); i++ )
{
Voted] = false;
show_menui0"^n");
}
switch(
EndVote)
{
case 
1:

ColorChat0"%s ^4won ^1the vote with ^3%i ^1"ChangeWinner ], g_szKindWinner ] );
for( new 
0sizeof Changei++ )
{
g_szKind] = 0
}
}
case 
2:
{
ColorChat0"%s ^3won ^1the vote with ^3%i ^1"Change2Winner ], g_szKindWinner ] );
for( new 
0sizeof Change2i++ )
{
g_szKind] = 0
}

case 
3:
{
ColorChat0"%s ^3won ^1the vote with ^3%i ^1"Change3Winner ], g_szKindWinner ] );
for( new 
0sizeof Change3i++ )
{
g_szKind] = 0


}
}
}

public 
handlerddddclientmenuitem )
{
if( 
Votedclient ] == true )

ChangeMapsclient);

return 
1;
}

new 
szName32 ];

get_user_nameclientszName32 );
switch(
EndVote)
{
case 
1:

ColorChat0"^3%s^1 has^4 voted ^1for^4 %s"szNameChangeitem ] )

}
case 
2:
{
ColorChat0"^3%s^1 has^4 voted ^1for^4 %s"szNameChange2item ] )
}
}
g_szKinditem ]++;

Votedclient ] = true;

ChangeMaps(client);

return 
1;
}

public 
countdown2()
{
if(
Timer <= 0)
{
remove_task(2000)
}
else
{
Timer--
set_task(1.0,"countdown2");
for( new 
1<= get_maxplayers(); i++ )
{
if( !
is_user_alive) || !is_user_connected) )
continue;
show_menui0"^n");
ChangeMaps(i)
}

}
return 
PLUGIN_HANDLED
}

stock ColorChat(const id, const string[], {FloatSqlResul,_}:...) {
new 
msg[191], players[32], count 1

static len
len 
formatex(msgcharsmax(msg), "^1[^3 AMXX^1] ")
vformat(msg[len], charsmax(msg) - lenstring3)

if(
idplayers[0] = id
else get_players(players,count,"ch")

for (new 
0counti++)
{
if(
is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"),_players[i])
write_byte(players[i])
write_string(msg)
message_end()
}
}

return 
1;


Last edited by YamiKaitou; 04-19-2014 at 15:52.
Snitch is offline
Send a message via Skype™ to Snitch
 



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 05:55.


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