Raised This Month: $ Target: $400
 0% 

Last man bet for HnS


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-05-2010 , 17:24   Re: Last man bet for HnS
Reply With Quote #1

Might have to recompile. I just edited out the incorrect return values. Don't know what I was thinking... had HAM_SUPERCEDE's in DeathMsg.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
r14170
Veteran Member
Join Date: Dec 2009
Old 03-05-2010 , 19:05   Re: Last man bet for HnS
Reply With Quote #2

wow super plg
r14170 is offline
AirShot
Veteran Member
Join Date: Sep 2009
Location: Belgium
Old 03-06-2010 , 07:00   Re: Last man bet for HnS
Reply With Quote #3

ty but now sometimes the menu doesn't appear when the terrorist is the last surviving
__________________
AirShot is offline
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 03-06-2010 , 12:40   Re: Last man bet for HnS
Reply With Quote #4

Was probably because I was using get_players with flag "e".

Made a more efficient way.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>

#define MAX_PLAYERS    32

#define EXTRA_HEALTH 50

new const VERSION[] = "1.2"

new bool:b_BetHappening
new bool:b_CtWon
new bool:b_TerrWon

new bool:b_Bet[MAX_PLAYERS+1]
new 
bool:b_ChoseTerr[MAX_PLAYERS+1]
new 
bool:b_ChoseCt[MAX_PLAYERS+1]
new 
bool:b_ChoseNothing[MAX_PLAYERS+1]

new 
bool:b_Respawn[MAX_PLAYERS+1]

new 
trName[32]

new 
pcTimeAfter

public plugin_init()
{
    
register_plugin"HnS Betting"VERSION"Wrecked" // :avast:
    
    
register_event"DeathMsg""EV_DeathMsg""a" )
    
    
register_logevent"LEV_RoundStart"2"1=Round_Start" )
    
    
pcTimeAfter register_cvar"hb_time""10.0" )
}

public 
LEV_RoundStart()
{
    
set_taskget_pcvar_floatpcTimeAfter ), "task_GiveRewards" )
}

public 
task_GiveRewards()
{
    new 
iPlayers[32]
    new 
iNum
    
new id
    
    get_players
iPlayersiNum )
    
    for( new 
0iNumi++ )
    {
        
id iPlayers[i]
        
        if( 
b_Bet[id] )
        {
            if( 
b_CtWon && b_ChoseCt[id] )
            {
                
GIVE_Rewardsid )
            }
            else if( 
b_TerrWon && b_ChoseTerr[id] )
            {
                
GIVE_Rewardsid )
            }
            else
            {
                new 
num random_num1100 )
                
                if( 
num == 96 )
                {
                    new 
iWep give_itemid"weapon_awp" )
                    
                    
cs_set_weapon_ammoiWep)
                    
cs_set_user_bpammoidCSW_AWP)
                    
                    
client_printidprint_chat"WOW! You won the 1% chance to win an awp!" )
                }
            }
        }
    }
}

public 
EV_DeathMsg()
{
    new 
victim read_data)
    
    if( 
b_Respawn[victim] )
        
set_task2.0"TASK_Respawn"victim )
    
    if( 
b_BetHappening && cs_get_user_teamvictim ) == CS_TEAM_T )
    {
        
b_TerrWon false
        b_CtWon 
true
        
        
return PLUGIN_HANDLED;
    }
    else if( 
b_BetHappening && cs_get_user_teamvictim ) == CS_TEAM_CT )
    {
        new 
ctAmt GetTeamsCS_TEAM_CT )
        
        if( 
ctAmt == )
        {
            
b_CtWon false
            b_TerrWon 
true
        
}
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
trAmt GetTeamsCS_TEAM_T )
    
    if( 
trAmt != )
    {
        return 
PLUGIN_HANDLED;
    }
    else if( 
trAmt == )
    {
        new 
iPlayers[32]
        new 
iNum
        
new tempid
        
        get_players
iPlayersiNum )
        
        for( new 
0iNumi++ )
        {
            
tempid iPlayers[i]
            
            if( !
is_user_alivetempid ) && is_user_connectedtempid ) )
            {
                
menu_Bettempid )
            }
            
            else if( 
is_user_alivetempid ) && cs_get_user_teamtempid ) == CS_TEAM_T )
            {
                
get_user_nametempidtrName31 )
            }
        }
        
b_BetHappening true
    
}
    return 
PLUGIN_CONTINUE;
}

public 
menu_Betid )
{
    new 
menu menu_create"Who Will Win?""menu_BetHandler" )
    
    
menu_additemmenutrName"1")
    
menu_additemmenu"The CT's""2")
    
menu_additemmenu"I Don't Know""3")
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL )
    
    
menu_displayidmenu)
    
    return 
PLUGIN_CONTINUE;
}

public 
menu_BetHandleridmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu )
        
        return 
PLUGIN_HANDLED;
    }
    
    new 
name[64]
    new 
data[6]
    new 
access
    
new callback
    
    menu_item_getinfo
menuitemaccessdata5name63callback )
    
    new 
choice str_to_numdata )
    
    switch( 
choice )
    {
        case 
1// Single Terr
        
{
            
b_Bet[id] = true
            b_ChoseTerr
[id] = true
            b_ChoseCt
[id] = false
            b_ChoseNothing
[id] = false
        
}
        
        case 
2// CT Team
        
{
            
b_Bet[id] = true
            b_ChoseTerr
[id] = false
            b_ChoseCt
[id] = true
            b_ChoseNothing
[id] = false
        
}
        
        case 
3// 1% AWP
        
{
            
b_Bet[id] = true
            b_ChoseTerr
[id] = false
            b_ChoseCt
[id] = false
            b_ChoseNothing
[id] = true
        
}
    }
    
    return 
PLUGIN_HANDLED;
}

stock GIVE_Rewardsid )
{
    if( !
is_user_aliveid ) )
        return 
PLUGIN_HANDLED;
    
    new 
rnum random_num1)
    
    switch( 
rnum )
    {
        case 
1// scout
        
{
            new 
iWep give_itemid"weapon_scout" )
            
            if( 
iWep )
            {
                
cs_set_weapon_ammoiWep)
                
cs_set_user_bpammoidCSW_SCOUT)
            }
            
            
client_printidprint_chat"You won a scout with no bullets for placing the correct bet!" )
        }
        
        case 
2// nade
        
{
            
give_itemid"weapon_hegrenade" )
            
            
client_printidprint_chat"You won a grenade for placing the correct bet!" )
        }
        
        case 
3// health
        
{
            
set_user_healthidget_user_healthid ) + EXTRA_HEALTH )
            
            
client_printidprint_chat"You won +%i HP for placing the correct bet!"EXTRA_HEALTH )
        }
        
        case 
4// respawn
        
{
            
b_Respawn[id] = true
            
            client_print
idprint_chat"You won an extra respawn for the round!" )
        }
    }
    
    return 
PLUGIN_HANDLED;
}
        
public 
TASK_Reviveid )
{
    if( !
is_user_aliveid ) )
        
ExecuteHamBHam_CS_RoundRespawnid )
        
    
b_Respawn[id] = false
}

GetTeamsCsTeams:iTeam )
{
    new 
iPlayers[32]
    new 
iNum
    
    get_players
iPlayersiNum )
    
    new 
goodteam
    
    
for( new 0iNumi++ )
    {
        if( 
cs_get_user_teamiPlayers[i] ) == iTeam )
        {
            
goodteam++
        }
    }
    
    return 
goodteam;

__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT

Last edited by wrecked_; 03-31-2010 at 02:30.
wrecked_ is offline
AirShot
Veteran Member
Join Date: Sep 2009
Location: Belgium
Old 03-06-2011 , 06:01   Re: Last man bet for HnS
Reply With Quote #5

I still intersted in that plugin even if it was made a long time ago but the last version made by wrecked_ is not 100% working.

Some bug :
- If the Terrorist is alone in his team at round beginning, the menu won't show during the whole game.
- Sometimes menu don't show up when a terrorist is last surviving for unknow reason.
- Sometimes people don't get their rewards.
- When the menu show, the Terrorist name doesn't appear

I think also that the plugin need some client_print :
one client_print to announce when a Terrorist is the last surviving, like :
Airshot is the last terrorist. Can he win againts CTs?

and a client_print when all players have voted or 10 seconds after the votes like :
Bet has done : 7 players bet Airshot will win - 3 players bet The CT's will win. - 1 Player didn't know - 3 Players didn't bet


I still believe that this plugins is a good idea for hidenseek gameplay.
__________________

Last edited by AirShot; 03-06-2011 at 08:19.
AirShot is offline
GANGSTA_
Senior Member
Join Date: Nov 2010
Location: IR/ Romania
Old 04-26-2011 , 05:20   Re: Last man bet for HnS
Reply With Quote #6

Don't work ..
__________________
Quitted! Cya xD
GANGSTA_ is offline
Send a message via Yahoo to GANGSTA_
AirShot
Veteran Member
Join Date: Sep 2009
Location: Belgium
Old 03-22-2011 , 11:11   Re: Last man bet for HnS
Reply With Quote #7

bump
__________________
AirShot is offline
Old 03-27-2011, 10:27
DARKKKIS
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
Old 03-27-2011, 10:30
gtpunkt
This message has been deleted by Exolent[jNr]. Reason: Don't bump until 2 weeks have passed since last post.
AirShot
Veteran Member
Join Date: Sep 2009
Location: Belgium
Old 04-08-2011 , 15:53   Re: Last man bet for HnS
Reply With Quote #10

bump again
I've pm wrecked_ but he is not answering

PS: I don't get why last 2 messages have been deleted. It wasn't really bumps.
They were just asking for the plugin too.
__________________
AirShot is offline
Reply



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


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