AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Fix jailbreak vote days (https://forums.alliedmods.net/showthread.php?t=139949)

dramix 10-07-2010 08:08

Fix jailbreak vote days
 
Hi guys ,
can any one fix that code
i need it :(
example :
i vote number 1
final vote random :(
i need someone to fix it
and
I want to show the vote for T, they can`t vote
look at the most vote
And the most votes will be chosen
And I want to name appears player
what choose
"" vote CT only ""
PHP Code:

#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < fun >
#include < hamsandwich>
#include < colorchat >
#include < core >

new const AUTHOR []= "Unknown";
new const 
PLUGIN []= "Jailbreak Days Menu";
new const 
VERSION[]= "7up soda";

new const 
ClanTag[] = "CG";

new 
gmsg_SetFOV;

new 
g_maxplayers

new bool:can_have_gun[33];

new 
cvar_atsirandacvar_pranyksta;

//dienos
new g_iVotes];

public 
plugin_init()
{
   
register_plugin(PLUGINVERSIONAUTHOR);
   
   
   
g_maxplayers get_maxplayers()
   
   
RegisterHam(Ham_Touch"armoury_entity""FwdHamPlayerPickup");
   
RegisterHam(Ham_Touch"weaponbox""FwdHamPlayerPickup");
   
RegisterHam(Ham_Spawn"player""Event_Playerspawn"1);
   
register_event("HLTV""newROUND""a""1=0""2=0"
   
cvar_atsiranda register_cvar("days_votestart""5.0")
   
cvar_pranyksta register_cvar("days_voteend""10.0")
}
public 
newROUND(){
    
set_task(get_pcvar_float(cvar_atsiranda), "days_menu")
}


public 
Event_Playerspawn(id)
{
   
can_have_gun[id] = true
}

public 
FwdHamPlayerPickup(iEntityid)
{
   if(!
can_have_gun[id])
      return 
HAM_SUPERCEDE;
   
   return 
HAM_IGNORED;
}

public 
days_menu()
{   
   new 
days_menu menu_create("\yDays Menu""day_handler");
   
   
menu_additem(days_menu"\rFreeday!""1"0);
   
menu_additem(days_menu"\rZombie Day""2"0);
   
menu_additem(days_menu"\rLava Day""3"0);
   
menu_additem(days_menu"\rShark Day""4"0);
   
menu_additem(days_menu"\rCage Day""5"0);
   
menu_additem(days_menu"\rDrug Freeday""6"0);
   
menu_additem(days_menu"\rNight Crawler Day""7"0);
   
menu_additem(days_menu"\rSpartan Day""8"0);
   
   
menu_setprop(days_menuMPROP_EXITMEXIT_ALL);
   
   new 
players[32], pnumtempid;
   
get_players(players,pnum,"ae","CT")

   for( new 
ii<pnumi++ )
   {
    
tempid players[i];

    
menu_display(tempiddays_menu0);
    
    
set_task(get_pcvar_float(cvar_pranyksta),"tikrintiBALSUS")
   }
   return 
PLUGIN_HANDLED
}

public 
freeDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is freeday!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Freeday!");
         
        for(new 
i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
            
            if(
cs_get_user_team) == CS_TEAM_T)
            {
               
set_user_rendering(ikRenderFxGlowShell25000kRenderTransColor16);
            }
         }
}

public 
zombieDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is zombie day!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Zombie!");
         
        for(new 
i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
            
            if( 
cs_get_user_team) == CS_TEAM_T)
            {
               
strip_user_weapons(i);
               
give_item(i"weapon_knife");
               
set_user_health(i2000);
               
               
can_have_gun[i] = false
            
}
         }
}

public 
lavaDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is lava day!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Lava!");
         
        for(new 
i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
            
            if( 
cs_get_user_team) == CS_TEAM_T)
            {
               
ColorChat(iRED"^x04[%s]^x01 Hurry and get on a spray!"ClanTag);
            }
         }
}

public 
sharkDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is shark day!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Shark!");
         
        static 
CsTeams:team
        
for(new i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
            
            
team cs_get_user_team)
            if( 
team == CS_TEAM_CT)
            {
               
strip_user_weapons(i);
               
give_item(i"weapon_knife");
               
set_user_noclip(itrue);
           
           new 
Players[32]
           new 
playerCountiplayer 
               get_players
(PlayersplayerCount"a")
           for (
i=0i<playerCounti++)
           
player Players[i
               
can_have_gun[player] = false;
            }
            else if( 
team == CS_TEAM_T)
            {
               
strip_user_weapons(i);
               
give_item(i"weapon_knife");
               
give_item(i"weapon_deagle");
               
give_item(i"weapon_m4a1");
            }
         }
}

public 
cageDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is cage day!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Cage!");
         
        for(new 
i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
            
            if( 
cs_get_user_team) == CS_TEAM_T)
            {
               
ColorChat(iGREEN"[%s] GET YOUR ASSES IN THE CAGE!"ClanTag);
            }
         }
}

public 
drugDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is drug freeday!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Drug Freeday!");
         
        for(new 
i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
         
            
gmsg_SetFOV get_user_msgid("SetFOV");
            
message_beginMSG_ONEgmsg_SetFOV, {000},i);
            
write_byte180 );
            
message_end( );
         }
}
public 
crawlerDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is night crawler day!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Night Crawler!");
        
        static 
CsTeams:team
        
for(new i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
            
            
team cs_get_user_team)
            if( 
team == CS_TEAM_CT)
            {
               
strip_user_weapons(i);
               
give_item(i"weapon_knife");
               
can_have_gun[i] = false;
               
set_user_rendering(ikRenderFxGlowShell000kRenderTransColor0);
            }
            else if( 
team == CS_TEAM_T)
            {
               
strip_user_weapons(i)
               
give_item(i"weapon_knife");
               
give_item(i"weapon_deagle");
               
give_item(i"weapon_m4a1");
               
give_item(i"weapon_hegrenade");
            }
         }
}

public 
spartanDAY()
{
    
ColorChat(0RED"^x04[%s]^x01 Today is spartan day!"ClanTag);
         
        
set_hudmessage(002550.010.9006.012.0);
        
show_hudmessage(0"Day: Spartan!");
         
        for(new 
i=1i<=g_maxplayersi++) {
            
            if(!
is_user_alive(i)) continue;
            
            if( 
cs_get_user_team) == CS_TEAM_T)
            {
               
strip_user_weapons(i);
               
give_item(i"weapon_knife");
               
give_item(i"weapon_deagle");
               
give_item(i"weapon_shield");
               
can_have_gun[i] = false;
            }
         }
}

public 
day_handler(iddays_menuitem)

   if( 
item == MENU_EXIT )
   {
      
menu_destroy(days_menu);
      
      return 
PLUGIN_HANDLED;
   }
   
   new 
data[7], iName[64];
   new 
accesscallback;
   
   
menu_item_getinfo(days_menuitemaccessdata7iName63callback);
   
   new 
key str_to_num(data);
   
   switch(
key)
   {
      case 
1:
      {
         
g_iVotes[1]++;
      }
      case 
2:
      {
         
g_iVotes[2]++;
      }
      case 
3:
      {
         
g_iVotes[3]++;
      }
      case 
4:
      {
         
g_iVotes[4]++;
      }
      case 
5:
      {
          
g_iVotes[5]++;
      }
      case 
6:
      {
          
g_iVotes[6]++;
      }
      case 
7:
      {
          
g_iVotes[7]++;
      }
      case 
8:
      {
          
g_iVotes[8]++;
      }
   }
   
   return 
PLUGIN_HANDLED;
}

public 
tikrintiBALSUS(){    
    new 
iVoteDatasizeofg_iVotes ) ][ ];
    for( new 
0sizeofiVoteData ); i++ )
    {
        
iVoteData][ ] = i;
        
iVoteData][ ] = g_iVotes];
    }
    
    
SortCustom2DiVoteData9,"SortVotes" );
    
    new 
iBestIndex iVoteData][ ];
    new 
iBestVotes g_iVotesiBestIndex ];
    
    new 
iSimilar 1;
    for( new 
1sizeofiVoteData ); i++ )
    {
        if( 
iBestVotes != iVoteData][ ] )
        {
            break;
        }
        
        
iSimilar++;
    }
    
    if( 
iSimilar )
    {
        
iBestIndex iVoteDatarandomiSimilar ) ][ ];
        
iBestVotes g_iVotesiBestIndex ];
        if(
iBestIndex == 1)
        {
        
freeDAY()
        }else if(
iBestIndex == 2)
        {
        
zombieDAY()
        }else if(
iBestIndex == 3)
        {
        
lavaDAY()
        }else if(
iBestIndex == 4)
        {
        
sharkDAY()
        }else if(
iBestIndex == 5)
        {
        
cageDAY()
        }else if(
iBestIndex == 6)
        {
        
drugDAY()
        }else if(
iBestIndex == 7)
        {
        
crawlerDAY()
        }else if(
iBestIndex == 8)
        {
        
spartanDAY()
        }
    
    }else{
        if(
g_iVotes[1] > g_iVotes[2] && g_iVotes[1] > g_iVotes[3] && g_iVotes[1] > g_iVotes[4] && g_iVotes[1] > g_iVotes[5] && g_iVotes[1] > g_iVotes[6] && g_iVotes[1] > g_iVotes[7] && g_iVotes[1] > g_iVotes[8])
        {
        
freeDAY()
        }else if(
g_iVotes[2] > g_iVotes[1] && g_iVotes[2] > g_iVotes[3] && g_iVotes[2] > g_iVotes[4] && g_iVotes[2] > g_iVotes[5] && g_iVotes[2] > g_iVotes[6] && g_iVotes[2] > g_iVotes[7] && g_iVotes[2] > g_iVotes[8])
        {
        
zombieDAY()
        }else if(
g_iVotes[3] > g_iVotes[1] && g_iVotes[3] > g_iVotes[2] && g_iVotes[3] > g_iVotes[4] && g_iVotes[3] > g_iVotes[5] && g_iVotes[3] > g_iVotes[6] && g_iVotes[3] > g_iVotes[7] && g_iVotes[3] > g_iVotes[8])
        {
        
lavaDAY()
        }else if(
g_iVotes[4] > g_iVotes[1] && g_iVotes[4] > g_iVotes[3] && g_iVotes[4] > g_iVotes[2] && g_iVotes[4] > g_iVotes[5] && g_iVotes[4] > g_iVotes[6] && g_iVotes[4] > g_iVotes[7] && g_iVotes[4] > g_iVotes[8])
        {
        
sharkDAY()
        }else if(
g_iVotes[5] > g_iVotes[1] && g_iVotes[5] > g_iVotes[3] && g_iVotes[5] > g_iVotes[4] && g_iVotes[5] > g_iVotes[2] && g_iVotes[5] > g_iVotes[6] && g_iVotes[5] > g_iVotes[7] && g_iVotes[5] > g_iVotes[8])
        {
        
cageDAY()
        }else if(
g_iVotes[6] > g_iVotes[1] && g_iVotes[6] > g_iVotes[3] && g_iVotes[6] > g_iVotes[4] && g_iVotes[6] > g_iVotes[5] && g_iVotes[6] > g_iVotes[2] && g_iVotes[6] > g_iVotes[7] && g_iVotes[6] > g_iVotes[8])
        {
        
drugDAY()
        }else if(
g_iVotes[7] > g_iVotes[1] && g_iVotes[7] > g_iVotes[2] && g_iVotes[7] > g_iVotes[4] && g_iVotes[7] > g_iVotes[5] && g_iVotes[7] > g_iVotes[6] && g_iVotes[7] > g_iVotes[2] && g_iVotes[7] > g_iVotes[8])
        {
        
crawlerDAY()
        }else if(
g_iVotes[8] > g_iVotes[1] && g_iVotes[8] > g_iVotes[3] && g_iVotes[8] > g_iVotes[2] && g_iVotes[8] > g_iVotes[5] && g_iVotes[8] > g_iVotes[6] && g_iVotes[8] > g_iVotes[7] && g_iVotes[8] > g_iVotes[4])
        {
        
spartanDAY()
        }
    }
    for( new 
1sizeof(g_iVotes); i++ ){
    
g_iVotes[i] = 0;
    }
    
    
iSimilar 0;
    
iBestIndex 0;
    
iBestVotes 0;
}

public 
SortVotesiData1[ ], iData2[ ], iArray[ ], iData[ ], iDataSize )
{
    return ( 
iData1] < iData2] ) ? -1;



reinert 10-07-2010 08:22

Re: Fix jailbreak vote days
 
omg, what a leechers... I posted this code and here we go, another guy got it... :(

EDIT: If you need it, why wouldn't you do it urself from zero ?

dramix 10-07-2010 08:32

Re: Fix jailbreak vote days
 
i can`t :(
I don`t experience with this codes xD
do you have tutorials ?
and ty :)

reinert 10-07-2010 08:36

Re: Fix jailbreak vote days
 
Are you running Non-steam server ?

dramix 10-07-2010 08:58

Re: Fix jailbreak vote days
 
No ,
Steam :D

hornet 10-07-2010 09:20

Re: Fix jailbreak vote days
 
By the sounds of it he's one of those infinitGamers who are in fact running Non-Steam servers - lol they're so desperate for a Jailbreak. Code it yourself mate votes aren't much more than just a bit of time :S

dramix 10-07-2010 09:27

Re: Fix jailbreak vote days
 
i don`t know how make plugin :@

dramix 10-29-2010 07:58

Re: Fix jailbreak vote days
 
up
You can not fix it ? :(
so give me some plugin :
HNS
Zombie
Shark
sprites
freeday
Nighcrawler
cage
Please I very very need it

dramix 12-14-2010 14:11

Re: Fix jailbreak vote days
 
up xD

ErrorStereotype 05-31-2011 15:55

Re: Fix jailbreak vote days
 
bump


All times are GMT -4. The time now is 10:27.

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