AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Jailbreak Last Request Problem (https://forums.alliedmods.net/showthread.php?t=187391)

MokeN 06-12-2012 15:11

Jailbreak Last Request Problem
 
I'm coding this plugin for my Jailbreak Server & im kinda new for jailbreak, so
could you help me with this prob?:)

ERROR:

http://i46.tinypic.com/295dfnl.png

This is the error lines
PHP Code:

public  StartDodgeBall()
{
    if( 
StartTimerCB )
    {
        
set_hudmessage 255255255, -1.00.3500.11.00.10.1)
        
show_hudmessage 0"DodgeBall Explosive Duel starting in %i...."StartTimerCB )
        
        
StartTimerCB--
    }
    else
    {
        
strip_user_weapons iPlayer_LastGuard )
        
set_user_health iPlayer_LastGuard100 )
        
give_item iPlayer_LastGuard"weapon_knife" )
        
give_item iPlayer_LastGuard"weapon_hegrenade" )
        
cs_set_user_bpammo iPlayer_LastGuardCSW_HEGRENADE100 )
        
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
                                    
set_pev(idpev_viewmodel2g_szDodgeball );
                                                               
set_pev(idpev_weaponmodel2g_szDodgeball2 );
        
        
strip_user_weapons iPlayer_LastPrisoner )
        
set_user_health iPlayer_LastPrisoner100 )
        
give_item iPlayer_LastPrisoner"weapon_knife" )
        
give_item iPlayer_LastPrisoner"weapon_hegrenade" )
        
cs_set_user_bpammo iPlayer_LastPrisonerCSW_HEGRENADE100)
        
cs_set_user_armor iPlayer_LastPrisoner100CS_ARMOR_VESTHELM )
        
set_pev(idpev_viewmodel2g_szDodgeball );
                                                                
set_pev(idpev_weaponmodel2g_szDodgeball2 );
    }
    return 
PLUGIN_HANDLED


What should i set instead of "id"?

Thanks

<VeCo> 06-12-2012 15:22

Re: Jailbreak Last Request Problem
 
iPlayer_LastPrisoner

MokeN 06-12-2012 15:32

Re: Jailbreak Last Request Problem
 
Quote:

Originally Posted by <VeCo> (Post 1727452)
iPlayer_LastPrisoner

Already tried that..

Got 17 errors when compile then :s

<VeCo> 06-12-2012 15:37

Re: Jailbreak Last Request Problem
 
Actually the first 2 set_pevs should have iPlayer_LastGuard indexes.

There's no other error in these lines. Attach the full code.

MokeN 06-12-2012 15:49

Re: Jailbreak Last Request Problem
 
Well, add me on steam, whyso5erious

I don't want to release it here..

mottzi 06-12-2012 16:52

Re: Jailbreak Last Request Problem
 
You wont get help for code which you don't post.

MokeN 06-12-2012 16:56

Re: Jailbreak Last Request Problem
 
Quote:

Originally Posted by mottzi (Post 1727507)
You wont get help for code which you don't post.

If someone is really kind, they could :) maybe <VeCo>..

YamiKaitou 06-12-2012 17:29

Re: Jailbreak Last Request Problem
 
PHP Code:

public  StartDodgeBall() 

    if( 
StartTimerCB 
    { 
        
set_hudmessage 255255255, -1.00.3500.11.00.10.1
        
show_hudmessage 0"DodgeBall Explosive Duel starting in %i...."StartTimerCB 
         
        
StartTimerCB-- 
    } 
    else 
    { 
        
strip_user_weapons iPlayer_LastGuard 
        
set_user_health iPlayer_LastGuard100 
        
give_item iPlayer_LastGuard"weapon_knife" 
        
give_item iPlayer_LastGuard"weapon_hegrenade" 
        
cs_set_user_bpammo iPlayer_LastGuardCSW_HEGRENADE100 
        
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM 
        
set_peviPlayer_LastGuardpev_viewmodel2g_szDodgeball ); 
        
set_peviPlayer_LastGuardpev_weaponmodel2g_szDodgeball2 ); 
         
        
strip_user_weapons iPlayer_LastPrisoner 
        
set_user_health iPlayer_LastPrisoner100 
        
give_item iPlayer_LastPrisoner"weapon_knife" 
        
give_item iPlayer_LastPrisoner"weapon_hegrenade" 
        
cs_set_user_bpammo iPlayer_LastPrisonerCSW_HEGRENADE100
        
cs_set_user_armor iPlayer_LastPrisoner100CS_ARMOR_VESTHELM 
        
set_peviPlayer_LastPrisonerpev_viewmodel2g_szDodgeball ); 
        
set_peviPlayer_LastPrisonerpev_weaponmodel2g_szDodgeball2 ); 
    } 
    return 
PLUGIN_HANDLED 


Compile errors gone

MokeN 06-13-2012 03:55

Re: Jailbreak Last Request Problem
 
Quote:

Originally Posted by YamiKaitou (Post 1727529)
PHP Code:

public  StartDodgeBall() 

    if( 
StartTimerCB 
    { 
        
set_hudmessage 255255255, -1.00.3500.11.00.10.1
        
show_hudmessage 0"DodgeBall Explosive Duel starting in %i...."StartTimerCB 
         
        
StartTimerCB-- 
    } 
    else 
    { 
        
strip_user_weapons iPlayer_LastGuard 
        
set_user_health iPlayer_LastGuard100 
        
give_item iPlayer_LastGuard"weapon_knife" 
        
give_item iPlayer_LastGuard"weapon_hegrenade" 
        
cs_set_user_bpammo iPlayer_LastGuardCSW_HEGRENADE100 
        
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM 
        
set_peviPlayer_LastGuardpev_viewmodel2g_szDodgeball ); 
        
set_peviPlayer_LastGuardpev_weaponmodel2g_szDodgeball2 ); 
         
        
strip_user_weapons iPlayer_LastPrisoner 
        
set_user_health iPlayer_LastPrisoner100 
        
give_item iPlayer_LastPrisoner"weapon_knife" 
        
give_item iPlayer_LastPrisoner"weapon_hegrenade" 
        
cs_set_user_bpammo iPlayer_LastPrisonerCSW_HEGRENADE100
        
cs_set_user_armor iPlayer_LastPrisoner100CS_ARMOR_VESTHELM 
        
set_peviPlayer_LastPrisonerpev_viewmodel2g_szDodgeball ); 
        
set_peviPlayer_LastPrisonerpev_weaponmodel2g_szDodgeball2 ); 
    } 
    return 
PLUGIN_HANDLED 


Compile errors gone

Nope, it's not in StartDodgeBall the problem is, it's the forward action.
Someone needs to help me private :)

MokeN 06-13-2012 07:52

Re: Jailbreak Last Request Problem
 
I attached the .sma so you could help me.


PHP Code:

#include < amxmodx >
#include < amxmodx >
#include < amxmisc >
#include < cstrike >
#include < hamsandwich >
#include < fun >
#include < fakemeta >
#include < xs >
#include < colorchat >

new StartTimer 5
new StartTimerCB 5
new StartTimerDB 5
new iPlayer_LastPrisoner
new iPlayer_LastGuard

new g_pEnabled
new g_pInterval
new g_iSound [ ] = "buttons/blip1.wav"
new g_iSpritePart [ ] = "sprites/white.spr"
new g_iSprite

new Floatg_flLastBeaconThink 33 ]
new 
Beacon 33 ]

new 
boole_LR
new boole_Rambo
new boole_S4S
new boole_Knife
new boole_SC
new boole_GT
new boole_CB
new boole_DB
new boole_Boxing

new lr_hp

new const g_szDodgeball[ ] = "models/scandic-gamers/v_dodgeball.mdl";
new const 
g_szDodgeball2[ ] = "models/scandic-gamers/dodgeball2.mdl";
new const 
g_szKnife[ ] = "models/scandic-gamers/v_knife.mdl";
new const 
g_szKnife2[ ] = "models/scandic-gamers/p_knife.mdl";
new const 
g_szDeagle[ ] = "models/scandic-gamers/ragingbull.mdl";
new const 
g_szDeagle2[ ] = "models/scandic-gamers/ragingbull2.mdl";
new const 
g_szRambo[ ] = "models/scandic-gamers/v_m249.mdl";
new const 
g_szRambo2[ ] = "models/scandic-gamers/p_m249.mdl";
new const 
g_szFists[ ] = "models/scandic-gamers/v_fists.mdl";

new const 
prefix [ ] = "^4[SG] Last Request^3:"

public plugin_init()
{
    
register_plugin "JB Last Request""1.0""-" )
    
    
register_clcmd "say /lr""MainMenu" )
    
    
register_logevent "EventRoundStart"2"1=Round_Start" )
    
register_logevent "EventRoundEnd"2"1=Round_End" )
    
register_event"23""EventSpray""a""1=112" )
    
register_event"DeathMsg""event_DeathMsg""a" )
    
    
g_pEnabled register_cvar "amx_beacon""1" )
    
g_pInterval register_cvar "amx_beacon_interval""2.0" )
    
register_forward FM_CmdStart"fwdCmdStart" )
    
    
RegisterHam Ham_Weapon_PrimaryAttack"weapon_deagle""Event_Primary_Attack_Deagle")
    
    
server_cmd "decalfrequency 15" )
}

public 
plugin_precache ( )
{
    
precache_sound g_iSound )
    
g_iSprite precache_model g_iSpritePart )
    
                                
precache_modelg_szDodgeball);
                                
precache_modelg_szDodgeball2);
                                
precache_modelg_szKnife);
                                
precache_modelg_szKnife2);
                                
precache_modelg_szDeagle);
                                
precache_modelg_szDeagle2);
                                
precache_modelg_szRambo);
                                
precache_modelg_szRambo2);
                                
precache_modelg_szFists);
}

public 
fwdCmdStartiPlayeriHandle )
{
    new 
Float:flGameTime get_gametime();
    if( 
g_flLastBeaconThink iPlayer ] < flGameTime )
    {
        if( !
is_user_aliveiPlayer ) || !get_pcvar_numg_pEnabled ) )
            return 
FMRES_IGNORED
            
        
if ( Beacon iPlayer ] )
        {
            
show_beacon iPlayer )
            
g_flLastBeaconThink iPlayer ] = flGameTime get_pcvar_float g_pInterval )
        }
    }
    return 
FMRES_IGNORED
}

public 
show_beacon iPlayer )
{
    static 
vOrigin ]
    
emit_sound iPlayerCHAN_ITEMg_iSound0.4ATTN_NORM0PITCH_NORM )
    
    
get_user_origin iPlayervOrigin )
    
    
message_begin MSG_BROADCASTSVC_TEMPENTITY )
    
write_byte TE_BEAMCYLINDER )
    
write_coord vOrigin ] )        //position.x
    
write_coord vOrigin ] )        //position.y
    
write_coord vOrigin ] - ( pev iPlayerpev_button ) & IN_DUCK 25 ) )    //position.z
    
    
write_coord vOrigin ] )        //axis.x
    
write_coord vOrigin ] )        //axis.y
    
write_coord vOrigin ] + 140 )    //axis.z
    
    
write_short g_iSprite )    //sprite index
    
write_byte )               //starting frame
    
write_byte )               //frame rate in 0.1's
    
write_byte )         //life in 0.1's
    
write_byte 10 )        //line width in 0.1's
    
write_byte )            //noise amplitude in 0.01's

    
if ( iPlayer == iPlayer_LastPrisoner )
    {
        
write_byte 255 )    // r
        
write_byte )        // g
        
write_byte )        // b
    
}
    
    if ( 
iPlayer == iPlayer_LastGuard )
    {
        
write_byte )        // r
        
write_byte )        // g
        
write_byte 255 )    // b
    
}
    
    
write_byte 255 )        // brightness
    
write_byte )            // scroll speed in 0.1's
    
message_end ( )
}

public 
MainMenu iPlayer )
{            
    if ( !
e_LR )
    {
        
ColorChat iPlayerGREY"%s There is too many^4 Prisoners^3 alive!"prefix )
        return 
PLUGIN_HANDLED
    
}
    
    if ( 
cs_get_user_team iPlayer ) != CS_TEAM_T )
    {
        
ColorChatiPlayerGREY"%s You need to be a^4 Prisoner^3 to use Last Request!"prefix )
        return 
PLUGIN_HANDLED
    
}
    
    if ( !
is_user_alive iPlayer ) )
    {
        
ColorChat iPlayerGREY"%s You must be^4 alive^3 to use^4 Last Request^3"prefix )
        return 
PLUGIN_HANDLED
    
}
    
    
iPlayer_LastPrisoner iPlayer
    
    
new MainMenu menu_create "[SG] Last Request Menu^nMain Menu""MainMenu_Handle" )
    
    
menu_additem MainMenu"Ninja Duel""1")
    
menu_additem MainMenu"Raging Bull Shot 4 Shot""2")
    
menu_additem MainMenu"1337 Duel""3")
    
menu_additem MainMenu"Gun Toss""4")
    
menu_additem MainMenu"Spray Olympia""5")
    
menu_additem MainMenu"Rambo Attack""6")
    
menu_additem MainMenu"Dodgeball Explosive""7")
    
menu_additem MainMenu"300(500) & Fists""8")
    
menu_setprop MainMenuMPROP_EXITMEXIT_ALL )
    
menu_display iPlayerMainMenu)
    
    return 
PLUGIN_HANDLED
}

public 
MainMenu_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED
    
}
    
    new 
data ], name 64 ]
    new 
accesscallback
    
    menu_item_getinfo 
menuitemaccessdata6name63callback )
    new 
key str_to_num data )
    
    switch ( 
key )
    {
        case 
1KnifeMenu iPlayer )
        case 
2S4SMenu iPlayer )
        case 
3CowboyMenu iPlayer )
        case 
4GunTossMenu iPlayer )
        case 
5SprayContestMenu iPlayer )
        case 
6CmdRambo iPlayer )
        case 
7DodgeBallMenu iPlayer )
        case 
8BoxingMenu iPlayer )
    }
    return 
PLUGIN_CONTINUE
}

public 
KnifeMenu iPlayer )
{
    if ( 
e_LR )
    {
        new 
KnifeMenu menu_create "[SG] Last Request Menu^nNinja Duel^nPick amount of HP!""KnifeMenu_Handle" )
        
        
menu_additem KnifeMenu"35 HP""1")
        
menu_additem KnifeMenu"100 HP""2")
        
menu_setprop KnifeMenuMPROP_EXITMEXIT_ALL )
        
menu_display iPlayerKnifeMenu)
    }
}

public 
KnifeMenu_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED
    
}
    
    new 
data 8], name 64 ]
    new 
accesscallback
    
    menu_item_getinfo 
menuitemaccessdata7name63callback )
    new 
key str_to_num data )
    
    switch ( 
key )
    {
        case 
1:
        {
            
KnifeMenu2 iPlayer )
            
lr_hp 35
        
}
        case 
2:
        {
            
KnifeMenu2 iPlayer )
            
lr_hp 100
        
}
    }
    return 
PLUGIN_CONTINUE
}

public 
KnifeMenu2 iPlayer )
{
    new 
KnifeMenu menu_create "[SG] Last Request Menu^nNinja Duel^nPick an opponent!""KnifeMenu2_Handle" )

    new 
numplayers[32], tempidszTempID 10 ], tempname 32 ]
    
get_players playersnum"a" )
    
    for ( new 
0numi++ )
    {
        
tempid players ]
        
        if ( 
cs_get_user_team tempid ) != CS_TEAM_CT )
            continue
        
        
get_user_name tempidtempname31 )
        
num_to_str tempidszTempID)
        
menu_additem KnifeMenutempnameszTempID)
                    
    }
    
    
menu_display iPlayerKnifeMenu )
    return 
PLUGIN_HANDLED
}

public 
KnifeMenu2_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED;
    }
    
    new 
data ], iName 64 ]
    new 
accesscallback
    menu_item_getinfo 
menuitemaccessdata,7iName63callback )
    
    new 
tempid str_to_num data )
    
strip_user_weapons tempid )
    
strip_user_weapons iPlayer )
    
set_user_health tempidlr_hp )
    
set_user_health iPlayerlr_hp )
    
give_item tempid"weapon_knife" )
    
give_item iPlayer"weapon_knife" )
    
set_pev(iPlayer_LastGuardpev_viewmodel2g_szKnife );
    
set_pev(iPlayer_LastGuardpev_weaponmodel2g_szKnife2 );
    
set_pev(iPlayer_LastPrisonerpev_viewmodel2g_szKnife );
    
set_pev(iPlayer_LastPrisonerpev_weaponmodel2g_szKnife2 );


    new 
tempname 32 ], tempname2 32 ]
    
get_user_name iPlayertempname31 )
    
get_user_name tempidtempname231 )
    
ColorChat 0GREY"%s >^4 %s^3 < chose^4 Ninja Duel^3 [^4 %i HP^3 ] as his last request vs >^4 %s^3 <"prefixtempnamelr_hptempname2 )
    
    
e_LR false
    e_Knife 
true
    iPlayer_LastGuard 
tempid
    
    Beacon 
iPlayer_LastGuard ] = true
    Beacon 
iPlayer_LastPrisoner ] = true
    
    menu_destroy
(menu);
    return 
PLUGIN_HANDLED;
}

public 
S4SMenu iPlayer )
{
    if ( 
e_LR )
    {
        new 
S4SMenu menu_create "[SG] Last Request Menu^nRaging Bull Shot 4 Shot^nPick an opponent!""S4SMenu_Handle" )
        
        new 
numplayers[32], tempidszTempID 10 ], tempname 32 ]
        
get_players playersnum"a" )
        
        for ( new 
0numi++ )
        {
            
tempid players ]
            
            if ( 
cs_get_user_team tempid ) != CS_TEAM_CT )
                continue
            
            
get_user_name tempidtempname31 )
            
num_to_str tempidszTempID)
            
menu_additem S4SMenutempnameszTempID)
                        
        }
        
        
menu_display iPlayerS4SMenu )
    }
    return 
PLUGIN_HANDLED
}

public 
S4SMenu_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED;
    }
    
    new 
data ], iName 64 ]
    new 
accesscallback
    menu_item_getinfo 
menuitemaccessdata,7iName63callback )
    
    new 
tempid str_to_num data )
    
    
strip_user_weapons tempid )
    
set_user_health tempid100 )
    
set_pev(iPlayer_LastGuardpev_viewmodel2g_szDeagle );
    
set_peviPlayer_LastGuardpev_weaponmodel2g_szDeagle2 );
    
    
strip_user_weapons iPlayer )
    
set_user_health iPlayer100 )
    
give_item iPlayer"weapon_knife" )
    
cs_set_weapon_ammo give_itemiPlayer"weapon_deagle" ), )
    
cs_set_user_bpammo iPlayerCSW_DEAGLE)
    
set_pev(iPlayer_LastPrisonerpev_viewmodel2g_szDeagle );
    
set_peviPlayer_LastPrisonerpev_weaponmodel2g_szDeagle2 );

    new 
tempname 32 ], tempname2 32 ]
    
get_user_name iPlayertempname31 )
    
get_user_name tempidtempname231 )
    
ColorChat 0GREY"%s >^4 %s^3 < chose^4 Raging Bull Shot 4 Shot^3 as his last request vs >^4 %s^3 <!"prefixtempnametempname2 )
    
    
e_LR false
    e_S4S 
true
    iPlayer_LastGuard 
tempid
    
    Beacon 
iPlayer_LastGuard ] = true
    Beacon 
iPlayer_LastPrisoner ] = true
    
    menu_destroy
(menu);
    return 
PLUGIN_HANDLED;
}

public 
CowboyMenu iPlayer )
{
    if ( 
e_LR )
    {
        new 
CowboyMenu menu_create "[SG] Last Request Menu^n1337 Duel^nPick an opponent!""CowboyMenu_Handle" )
        
        new 
numplayers[32], tempidszTempID 10 ], tempname 32 ]
        
get_players playersnum"a" )
        
        for ( new 
0numi++ )
        {
            
tempid players ]
            
            if ( 
cs_get_user_team tempid ) != CS_TEAM_CT )
                continue
            
            
get_user_name tempidtempname31 )
            
num_to_str tempidszTempID)
            
menu_additem CowboyMenutempnameszTempID)
                        
        }
        
        
menu_display iPlayerCowboyMenu )
    }
    return 
PLUGIN_HANDLED
}

public 
CowboyMenu_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED;
    }
    
    new 
data ], iName 64 ]
    new 
accesscallback
    menu_item_getinfo 
menuitemaccessdata,7iName63callback )
    
    new 
tempid str_to_num data )

    new 
tempname 32 ], tempname2 32 ]
    
get_user_name iPlayertempname31 )
    
get_user_name tempidtempname231 )
    
ColorChat 0GREY"%s >%s< chose^4 1337 Duel^3 vs^4 %s^3 and will start in^4 5 seconds^3!"prefixtempnametempname2 )
    
    
e_LR false
    e_CB 
true
    iPlayer_LastGuard 
tempid
    
    strip_user_weapons 
iPlayer_LastPrisoner )
    
strip_user_weapons iPlayer_LastGuard )
    
    
Beacon iPlayer_LastGuard ] = true
    Beacon 
iPlayer_LastPrisoner ] = true
    
    set_task
1.0"StartCowboy"___"a"StartTimerCB )
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
StartCowboy ( )
{
    if( 
StartTimerCB )
    {
        
set_hudmessage 255255255, -1.00.3500.11.00.10.1)
        
show_hudmessage 0"1337 Duel starting in %i...."StartTimerCB )
        
        
StartTimerCB--
    }
    else
    {
        
strip_user_weapons iPlayer_LastGuard )
        
set_user_health iPlayer_LastGuard100 )
        
give_item iPlayer_LastGuard"weapon_knife" )
        
give_item iPlayer_LastGuard"weapon_elite" )
        
cs_set_user_bpammo iPlayer_LastGuardCSW_ELITE120 )
        
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
        
        
strip_user_weapons iPlayer_LastPrisoner )
        
set_user_health iPlayer_LastPrisoner100 )
        
give_item iPlayer_LastPrisoner"weapon_knife" )
        
give_item iPlayer_LastPrisoner"weapon_elite" )
        
cs_set_user_bpammo iPlayer_LastPrisonerCSW_ELITE120 )
        
cs_set_user_armor iPlayer_LastPrisoner100CS_ARMOR_VESTHELM )
    }
    return 
PLUGIN_HANDLED
}

public 
GunTossMenu iPlayer )
{
    if ( 
e_LR )
    {
        new 
GunTossMenu menu_create "[SG] Last Request Menu^nGun Toss^nPick an opponent!""GunTossMenu_Handle" )
        
        new 
numplayers[32], tempidszTempID 10 ], tempname 32 ]
        
get_players playersnum"a" )
        
        for ( new 
0numi++ )
        {
            
tempid players ]
            
            if ( 
cs_get_user_team tempid ) != CS_TEAM_CT )
                continue
            
            
get_user_name tempidtempname31 )
            
num_to_str tempidszTempID)
            
menu_additem GunTossMenutempnameszTempID)
                        
        }
        
        
menu_display iPlayerGunTossMenu )
    }
    return 
PLUGIN_HANDLED
}

public 
GunTossMenu_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED;
    }
    
    new 
data ], iName 64 ]
    new 
accesscallback
    menu_item_getinfo 
menuitemaccessdata,7iName63callback )
    
    new 
tempid str_to_num data )
    
    
strip_user_weapons tempid )
    
set_user_health tempid100 )
    
give_item tempid"weapon_knife" )
    
give_item tempid"weapon_deagle" )
    
cs_set_user_bpammo tempidCSW_DEAGLE,)
    
    
strip_user_weapons iPlayer )
    
set_user_health iPlayer100 )
    
give_item iPlayer"weapon_knife" )
    
give_item iPlayer"weapon_deagle" )
    
cs_set_user_bpammo iPlayerCSW_DEAGLE)

    new 
tempname 32 ], tempname2 32 ]
    
get_user_name iPlayertempname31 )
    
get_user_name tempidtempname231 )
    
ColorChat 0GREY"%s >^4 %s^3 < chose^4 Gun Toss^3 as his last request vs >^4 %s^3 <!"prefixtempnametempname2 )
    
    
e_LR false
    e_GT 
true
    iPlayer_LastGuard 
tempid
    
    Beacon 
iPlayer_LastGuard ] = true
    Beacon 
iPlayer_LastPrisoner ] = true
    
    menu_destroy 
menu )
    return 
PLUGIN_HANDLED
}

public 
SprayContestMenu iPlayer )
{
    if ( 
e_LR )
    {
        new 
SprayContestMenu menu_create "[SG] Last Request Menu^nSpray Olympia^nPick an opponent!""SprayContestMenu_Handle" )
        
        new 
numplayers[32], tempidszTempID 10 ], tempname 32 ]
        
get_players playersnum"a" )
        
        for ( new 
0numi++ )
        {
            
tempid players ]
            
            if ( 
cs_get_user_team tempid ) != CS_TEAM_CT )
                continue
            
            
get_user_name tempidtempname31 )
            
num_to_str tempidszTempID)
            
menu_additem SprayContestMenutempnameszTempID)
                        
        }
        
        
menu_display iPlayerSprayContestMenu )
    }
    return 
PLUGIN_HANDLED
}

public 
SprayContestMenu_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED;
    }
    
    new 
data ], iName 64 ]
    new 
accesscallback
    menu_item_getinfo 
menuitemaccessdata,7iName63callback )
    
    new 
tempid str_to_num data )
    
    
strip_user_weapons tempid )
    
set_user_health tempid100 )
    
give_item tempid"weapon_knife" )
    
    
strip_user_weapons iPlayer )
    
set_user_health iPlayer100 )
    
give_item iPlayer"weapon_knife" )

    new 
tempname 32 ], tempname2 32 ]
    
get_user_name iPlayertempname31 )
    
get_user_name tempidtempname231 )
    
ColorChat 0GREY"%s >^4 %s^3 < chose^4 Spray Olympia^3 as his last request vs >^4 %s^3 <!"prefixtempnametempname2 )
    
    
server_cmd "decalfrequency 5" )
    
    
e_LR false
    e_SC 
true
    iPlayer_LastGuard 
tempid
    
    Beacon 
iPlayer_LastGuard ] = true
    Beacon 
iPlayer_LastPrisoner ] = true
    
    menu_destroy
(menu);
    return 
PLUGIN_HANDLED;
}

public 
CmdRambo iPlayer )
{
    if ( 
e_LR )
    {
        new 
plr 32 ]
        
get_user_name iPlayerplr31 )
        
ColorChat 0GREY"%s >%s< chose Rambo mode and will start in^4 5 seconds^3!"prefixplr )
    
        
set_task1.0"StartRambo"___"a"StartTimer )
        
e_LR false
        
        
new ct_countnumplayers[32], tempid
        get_players 
playersnum )

        for ( new 
0numi++ )
        {
            
tempid players ]
                
            if ( 
cs_get_user_team tempid ) == CS_TEAM_CT && is_user_alive tempid ) )
                
ct_count++
                
            
strip_user_weapons tempid )
        }
        
strip_user_weapons iPlayer )
    }
}

public 
StartRambo iPlayer)
{        
    if( 
StartTimer )
    {
        
set_hudmessage 255255255, -1.00.3500.11.00.10.1)
        
show_hudmessage 0"Rambo starting in %i...."StartTimer )
        
        
StartTimer--
    }
    else
    {
        new 
ct_countnumplayers[32], tempid
        get_players 
playersnum )

        for ( new 
0numi++ )
        {
            
tempid players ]
                
            if ( 
cs_get_user_team tempid ) == CS_TEAM_CT && is_user_alive tempid ) )
            {
                
ct_count++
                
set_user_health tempid100 )
                
give_item tempid"weapon_knife" )
                
give_item tempid"weapon_deagle" )
                
cs_set_user_bpammo tempidCSW_DEAGLE35 )
                
give_item tempid"weapon_m4a1" )
                
cs_set_user_bpammo tempidCSW_M4A190 )
                
cs_set_user_armor tempid100CS_ARMOR_VESTHELM )
            }
        }
        
        
        
set_user_health iPlayer_LastPrisoner150 ct_count )
        
give_item iPlayer_LastPrisoner"weapon_knife" )
        
give_item iPlayer_LastPrisoner"weapon_m249" )
        
cs_set_user_bpammo iPlayer_LastPrisonerCSW_M249200 )
        
cs_set_user_armor iPlayer_LastPrisoner100CS_ARMOR_VESTHELM )
        
set_pev(iPlayer_LastPrisonerpev_viewmodel2g_szRambo );
                                                                
set_pev(iPlayer_LastPrisonerpev_weaponmodel2g_szRambo2 );
        
        
Beacon iPlayer_LastPrisoner ] = true
        
        e_Rambo 
true
    
}
    return 
PLUGIN_HANDLED
}

public 
DodgeBallMenuiPlayer )
{
    if ( 
e_LR )
    {
        new 
DodgeBallMenu menu_create "[SG] Last Request Menu^nDodgeBall Explosive^nPick an opponent!""DodgeBallMenu_Handle" )
        
        new 
numplayers[32], tempidszTempID 10 ], tempname 32 ]
        
get_players playersnum"a" )
        
        for ( new 
0numi++ )
        {
            
tempid players ]
            
            if ( 
cs_get_user_team tempid ) != CS_TEAM_CT )
                continue
            
            
get_user_name tempidtempname31 )
            
num_to_str tempidszTempID)
            
menu_additem (DodgeBallMenutempnameszTempID)
                        
        }
        
        
menu_display iPlayerDodgeBallMenu )
    }
    return 
PLUGIN_HANDLED
}

public 
DodgeBallMenu_HandleiPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED;
    }
    
    new 
data ], iName 64 ]
    new 
accesscallback
    menu_item_getinfo 
menuitemaccessdata,7iName63callback )
    
    new 
tempid str_to_num data )

    new 
tempname 32 ], tempname2 32 ]
    
get_user_name iPlayertempname31 )
    
get_user_name tempidtempname231 )
    
ColorChat 0GREY"%s >%s< chose^4 DodgeBall Explosive^3 vs^4 %s^3 and will start in^4 5 seconds^3!"prefixtempnametempname2 )
    
    
e_LR false
    e_DB 
true
    iPlayer_LastGuard 
tempid
    
    strip_user_weapons 
iPlayer_LastPrisoner )
    
strip_user_weapons iPlayer_LastGuard )
    
    
Beacon iPlayer_LastGuard ] = true
    Beacon 
iPlayer_LastPrisoner ] = true
    
    set_task
1.0"StartDodgeBall"___"a"StartTimerDB )
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public  
StartDodgeBall()  
{  
    if( 
StartTimerDB)  
    {  
        
set_hudmessage 255255255, -1.00.3500.11.00.10.1)  
        
show_hudmessage 0"DodgeBall Explosive Duel starting in %i...."StartTimerDB )  
          
        
StartTimerDB--  
    }  
    else  
    {  
        
strip_user_weapons iPlayer_LastGuard )  
        
set_user_health iPlayer_LastGuard100 )  
        
give_item iPlayer_LastGuard"weapon_knife" )  
        
give_item iPlayer_LastGuard"weapon_hegrenade" )  
        
cs_set_user_bpammo iPlayer_LastGuardCSW_HEGRENADE100 )  
        
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )  
        
set_peviPlayer_LastGuardpev_viewmodel2g_szDodgeball );  
        
set_peviPlayer_LastGuardpev_weaponmodel2g_szDodgeball2 );  
          
        
strip_user_weapons iPlayer_LastPrisoner )  
        
set_user_health iPlayer_LastPrisoner100 )  
        
give_item iPlayer_LastPrisoner"weapon_knife" )  
        
give_item iPlayer_LastPrisoner"weapon_hegrenade" )  
        
cs_set_user_bpammo iPlayer_LastPrisonerCSW_HEGRENADE100)  
        
cs_set_user_armor iPlayer_LastPrisoner100CS_ARMOR_VESTHELM )  
        
set_peviPlayer_LastPrisonerpev_viewmodel2g_szDodgeball );  
        
set_peviPlayer_LastPrisonerpev_weaponmodel2g_szDodgeball2 );  
    }  
    return 
PLUGIN_HANDLED  


public 
BoxingMenuiPlayer )
{
    if ( 
e_LR )
    {
        new 
BoxingMenu menu_create "[SG] Last Request Menu^n300(500) & Fists Duel^nPick amount of HP!""BoxingMenu_Handle" )
        
        
menu_additem BoxingMenu"300 HP""1")
        
menu_additem BoxingMenu"500 HP""2")
        
menu_setprop BoxingMenuMPROP_EXITMEXIT_ALL )
        
menu_display iPlayerBoxingMenu)
    }
}

public 
BoxingMenu_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED
    
}
    
    new 
data ], name 64 ]
    new 
accesscallback
    
    menu_item_getinfo 
menuitemaccessdata7name63callback )
    new 
key str_to_num data )
    
    switch ( 
key )
    {
        case 
1:
        {
            
BoxingMenu2 iPlayer )
            
lr_hp 300
        
}
        case 
2:
        {
            
BoxingMenu2 iPlayer )
            
lr_hp 500
        
}
    }
    return 
PLUGIN_CONTINUE
}

public 
BoxingMenu2 iPlayer )
{
    new 
BoxingMenu menu_create "[SG] Last Request Menu^n300(500) & Fists Duel^nPick an opponent!""BoxingMenu2_Handle" )

    new 
numplayers[32], tempidszTempID 10 ], tempname 32 ]
    
get_players playersnum"a" )
    
    for ( new 
0numi++ )
    {
        
tempid players ]
        
        if ( 
cs_get_user_team tempid ) != CS_TEAM_CT )
            continue
        
        
get_user_name tempidtempname31 )
        
num_to_str tempidszTempID)
        
menu_additem BoxingMenutempnameszTempID)
                    
    }
    
    
menu_display iPlayerBoxingMenu)
    return 
PLUGIN_HANDLED
}

public 
BoxingMenu2_Handle iPlayermenuitem )
{
    if ( 
item == MENU_EXIT )
    {
        
menu_destroy menu )
        return 
PLUGIN_HANDLED;
    }
    
    new 
data ], iName 64 ]
    new 
accesscallback
    menu_item_getinfo 
menuitemaccessdata,7iName63callback )
    
    new 
tempid str_to_num data )
    
strip_user_weapons tempid )
    
strip_user_weapons iPlayer )
    
set_user_health tempidlr_hp )
    
set_user_health iPlayerlr_hp )
    
give_item tempid"weapon_knife" )
    
give_item iPlayer"weapon_knife" )
    
set_pev(iPlayer_LastGuardpev_viewmodel2g_szFists);
    
set_pev(iPlayer_LastGuardpev_viewmodel2g_szFists);
    
set_pev(iPlayer_LastPrisonerpev_viewmodel2g_szFists);
    
set_pev(iPlayer_LastPrisonerpev_viewmodel2g_szFists);

    new 
tempname 32 ], tempname2 32 ]
    
get_user_name iPlayertempname31 )
    
get_user_name tempidtempname231 )
    
ColorChat 0GREY"%s >^4 %s^3 < chose^4 300(500) & Fists Duel^3 [^4 %i HP^3 ] as his last request vs >^4 %s^3 <"prefixtempnamelr_hptempname2 )
    
    
e_LR false
    e_Boxing 
true
    iPlayer_LastGuard 
tempid
    
    Beacon 
iPlayer_LastGuard ] = true
    Beacon 
iPlayer_LastPrisoner ] = true
    
    menu_destroy
(menu);
    return 
PLUGIN_HANDLED;
}

public 
client_disconnect iPlayer )
{
    if ( 
iPlayer == iPlayer_LastGuard || iPlayer == iPlayer_LastPrisoner )
    {    
        
Beacon iPlayer_LastGuard ] = false
        Beacon 
iPlayer_LastPrisoner ] = false
        
        iPlayer_LastPrisoner 
= -1
        iPlayer_LastGuard 
= -1
    
        e_LR 
false
        e_Rambo 
false
        e_S4S 
false
        e_Knife 
false
        e_SC 
false
        e_GT 
false
        e_CB 
false
        e_DB 
false
        e_Boxing 
false
    
        StartTimer 
5
        StartTimerCB 
5
        StartTimerDB 
5
    
}
}

public 
event_DeathMsg iPlayer )
{
    new 
iKiller read_data )
    new 
iVictim read_data )
    
    new 
name_killer 32 ], name_victim 32 ]
    
get_user_name iKillername_killer31 )
    
get_user_name iVictimname_victim31 )
    
    new 
t_countct_countnumplayers[32], tempid
    get_players 
playersnum )

    for ( new 
0numi++ )
    {
        
tempid players ]

        if ( 
cs_get_user_team tempid ) == CS_TEAM_T && is_user_alive tempid ) )
            
t_count++
        
        if ( 
cs_get_user_team tempid ) == CS_TEAM_CT && is_user_alive tempid ) )
            
ct_count++
    }
    
    if ( !
e_Rambo )
    {
        if ( 
t_count == && ct_count 0)
        {
            
ColorChat 0GREY"%s The last^4 Prisoner^3 can now get a^4 Last Request^3 - Type^4 /lr^3 to open menu!"prefix )
            
e_LR true
        
}
        else 
e_LR false
    
}

    if ( 
e_Knife )
    {
        if ( 
iVictim == iPlayer_LastPrisoner || iVictim == iPlayer_LastGuard )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < won the^4 Ninja Duel^3 (^4 %i HP^3 ) against >^4 %s^3 <!"prefixname_killerlr_hpname_victim )
            
e_Knife false
            e_LR 
true
            
            Beacon 
iPlayer_LastGuard ] = false
            Beacon 
iPlayer_LastPrisoner ] = false
            
            
if ( is_user_alive iPlayer_LastPrisoner ) )
            {
                
strip_user_weapons iPlayer_LastPrisoner )
                
set_user_health iPlayer_LastPrisoner100 )
                
cs_set_user_armor iPlayer_LastPrisoner0CS_ARMOR_VESTHELM )
                
give_item iPlayer_LastPrisoner"weapon_knife" )
            }
            if ( 
is_user_alive iPlayer_LastGuard) )
            {
            
strip_user_weapons iPlayer_LastGuard )
            
set_user_health iPlayer_LastGuard100 )                
            
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
            
give_item iPlayer_LastGuard"weapon_knife" )
            
give_item iPlayer_LastGuard"weapon_deagle" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_DEAGLE35 )
            
give_item iPlayer_LastGuard"weapon_m4a1" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_M4A190 )
            }
        }
    }
    
    if ( 
e_S4S )
    {
        if ( 
iVictim == iPlayer_LastPrisoner || iVictim == iPlayer_LastGuard )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < won the^4 Raging Bull Shot 4 Shot^3 against >^4 %s^3 <!"prefixname_killername_victim )
            
e_S4S false
            e_LR 
true
            
            Beacon 
iPlayer_LastGuard ] = false
            Beacon 
iPlayer_LastPrisoner ] = false
            
            
if ( is_user_alive iPlayer_LastPrisoner ) )
            {
                
strip_user_weapons iPlayer_LastPrisoner )
                
set_user_health iPlayer_LastPrisoner100 )
                
cs_set_user_armor iPlayer_LastPrisoner0CS_ARMOR_VESTHELM )
                
give_item iPlayer_LastPrisoner"weapon_knife" )
            }
            if ( 
is_user_alive iPlayer_LastGuard) )
            {
            
strip_user_weapons iPlayer_LastGuard )
            
set_user_health iPlayer_LastGuard100 )                
            
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
            
give_item iPlayer_LastGuard"weapon_knife" )
            
give_item iPlayer_LastGuard"weapon_deagle" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_DEAGLE35 )
            
give_item iPlayer_LastGuard"weapon_m4a1" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_M4A190 )
            }
        }
    }
    
    if ( 
e_CB )
    {
        if ( 
iVictim == iPlayer_LastPrisoner || iVictim == iPlayer_LastGuard )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < won the^4 1337 Duel^3 against >^4 %s^3 <!"prefixname_killername_victim )
            
e_CB false
            e_LR 
true
            
            StartTimerCB 
5
            
            Beacon 
iPlayer_LastGuard ] = false
            Beacon 
iPlayer_LastPrisoner ] = false
            
            
if ( is_user_alive iPlayer_LastPrisoner ) )
            {
                
strip_user_weapons iPlayer_LastPrisoner )
                
set_user_health iPlayer_LastPrisoner100 )
                
cs_set_user_armor iPlayer_LastPrisoner0CS_ARMOR_VESTHELM )
                
give_item iPlayer_LastPrisoner"weapon_knife" )
            }
            if ( 
is_user_alive iPlayer_LastGuard) )
            {
            
strip_user_weapons iPlayer_LastGuard )
            
set_user_health iPlayer_LastGuard100 )                
            
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
            
give_item iPlayer_LastGuard"weapon_knife" )
            
give_item iPlayer_LastGuard"weapon_deagle" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_DEAGLE35 )
            
give_item iPlayer_LastGuard"weapon_m4a1" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_M4A190 )
            }
        }
    }
    
    if ( 
e_GT )
    {
        if ( 
iVictim == iPlayer_LastPrisoner || iVictim == iPlayer_LastGuard )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < won the^4 Gun Toss^3 against >^4 %s^3 <!"prefixname_killername_victim )
            
e_GT false
            e_LR 
true
            
            Beacon 
iPlayer_LastGuard ] = false
            Beacon 
iPlayer_LastPrisoner ] = false
            
            
if ( is_user_alive iPlayer_LastPrisoner ) )
            {
                
strip_user_weapons iPlayer_LastPrisoner )
                
set_user_health iPlayer_LastPrisoner100 )
                
cs_set_user_armor iPlayer_LastPrisoner0CS_ARMOR_VESTHELM )
                
give_item iPlayer_LastPrisoner"weapon_knife" )
            }
            if ( 
is_user_alive iPlayer_LastGuard) )
            {
            
strip_user_weapons iPlayer_LastGuard )
            
set_user_health iPlayer_LastGuard100 )                
            
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
            
give_item iPlayer_LastGuard"weapon_knife" )
            
give_item iPlayer_LastGuard"weapon_deagle" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_DEAGLE35 )
            
give_item iPlayer_LastGuard"weapon_m4a1" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_M4A190 )
            }
        }
    }
    
    if ( 
e_SC )
    {
        if ( 
iVictim == iPlayer_LastPrisoner || iVictim == iPlayer_LastGuard )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < won the^4 Spray Olympia^3 against >^4 %s^3 <!"prefixname_killername_victim )
            
e_SC false
            e_LR 
true
            
            Beacon 
iPlayer_LastGuard ] = false
            Beacon 
iPlayer_LastPrisoner ] = false
            
            
if ( is_user_alive iPlayer_LastPrisoner ) )
            {
                
strip_user_weapons iPlayer_LastPrisoner )
                
set_user_health iPlayer_LastPrisoner100 )
                
cs_set_user_armor iPlayer_LastPrisoner0CS_ARMOR_VESTHELM )
                
give_item iPlayer_LastPrisoner"weapon_knife" )
            }
            if ( 
is_user_alive iPlayer_LastGuard) )
            {
            
strip_user_weapons iPlayer_LastGuard )
            
set_user_health iPlayer_LastGuard100 )                
            
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
            
give_item iPlayer_LastGuard"weapon_knife" )
            
give_item iPlayer_LastGuard"weapon_deagle" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_DEAGLE35 )
            
give_item iPlayer_LastGuard"weapon_m4a1" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_M4A190 )
            }
        }
    }
    if ( 
e_Rambo )
    {
        if ( 
iVictim == iPlayer_LastPrisoner )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < killed^4 Rambo^3!"prefixname_killer )
            
e_Rambo false
            
            Beacon 
iPlayer_LastPrisoner ] = false
            
            StartTimer 

        
}
        else if ( 
ct_count == )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < killed all the^4 guards^3 and won the^4 Rambo run^3!"prefixname_killer )
            
e_Rambo false
            
            Beacon 
iPlayer_LastPrisoner ] = false
            
            StartTimer 
5
                                         
}
                                    }
                                 }
                                if ( 
e_DB )
    {
        if ( 
iVictim == iPlayer_LastPrisoner || iVictim == iPlayer_LastGuard )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < won the^4 DodgeBall Explosive Duel^3 against >^4 %s^3 <!"prefixname_killername_victim )
            
e_DB false
            e_LR 
true
            
            StartTimerDB 
5
            
            Beacon 
iPlayer_LastGuard ] = false
            Beacon 
iPlayer_LastPrisoner ] = false
            
            
if ( is_user_alive iPlayer_LastPrisoner ) )
            {
                
strip_user_weapons iPlayer_LastPrisoner )
                
set_user_health iPlayer_LastPrisoner100 )
                
cs_set_user_armor iPlayer_LastPrisoner0CS_ARMOR_VESTHELM )
                
give_item iPlayer_LastPrisoner"weapon_knife" )
            }
            if ( 
is_user_alive iPlayer_LastGuard) )
            {
            
strip_user_weapons iPlayer_LastGuard )
            
set_user_health iPlayer_LastGuard100 )                
            
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
            
give_item iPlayer_LastGuard"weapon_knife" )
            
give_item iPlayer_LastGuard"weapon_deagle" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_DEAGLE35 )
            
give_item iPlayer_LastGuard"weapon_m4a1" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_M4A190 )
                                          }
                                      }
    
                                }
    if ( 
e_Boxing)
    {
        if ( 
iVictim == iPlayer_LastPrisoner || iVictim == iPlayer_LastGuard )
        {
            
ColorChat 0GREY"%s >^4 %s^3 < won the^4 300(500) & Fists Duel^3 (^4 %i HP^3 ) against >^4 %s^3 <!"prefixname_killerlr_hpname_victim )
            
e_Boxingfalse
            e_LR 
true
            
            Beacon 
iPlayer_LastGuard ] = false
            Beacon 
iPlayer_LastPrisoner ] = false
            
            
if ( is_user_alive iPlayer_LastPrisoner ) )
            {
                
strip_user_weapons iPlayer_LastPrisoner )
                
set_user_health iPlayer_LastPrisoner100 )
                
cs_set_user_armor iPlayer_LastPrisoner0CS_ARMOR_VESTHELM )
                
give_item iPlayer_LastPrisoner"weapon_knife" )
            }
            if ( 
is_user_alive iPlayer_LastGuard) )
            {
            
strip_user_weapons iPlayer_LastGuard )
            
set_user_health iPlayer_LastGuard100 )                
            
cs_set_user_armor iPlayer_LastGuard100CS_ARMOR_VESTHELM )
            
give_item iPlayer_LastGuard"weapon_knife" )
            
give_item iPlayer_LastGuard"weapon_deagle" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_DEAGLE35 )
            
give_item iPlayer_LastGuard"weapon_m4a1" )
            
cs_set_user_bpammo iPlayer_LastGuardCSW_M4A190 )
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
EventRoundStart iPlayer )
{
    new 
t_countct_countnumplayers[32], tempid
    get_players 
playersnum )

    for ( new 
0numi++ )
    {
        
tempid players ]

        if ( 
cs_get_user_team tempid ) == CS_TEAM_T && is_user_alive tempid ) )
            
t_count++
            
        if ( 
cs_get_user_team tempid ) == CS_TEAM_CT && is_user_alive tempid ) )
            
ct_count++
    }
    
    
Beacon iPlayer_LastGuard ] = false
    Beacon 
iPlayer_LastPrisoner ] = false
    
    iPlayer_LastPrisoner 
= -1
    iPlayer_LastGuard 
= -1
    
    e_LR 
false
    e_Rambo 
false
    e_S4S 
false
    e_Knife 
false
    e_SC 
false
    e_GT 
false
    e_CB 
false
    e_DB 
false
    e_Boxing 
false
    
    client_cmd 
iPlayer"slot10" )
    
    if ( !( 
t_count != && ct_count ) )
    {
        
e_LR false
        
return PLUGIN_HANDLED
    
}
    
    
ColorChat 0GREY"%s The last^4 Prisoner^3 can now get a^4 Last Request^3 - Type^4 /lr^3 to open menu!"prefix )
    
e_LR true
    
    
return PLUGIN_CONTINUE
}

public 
EventRoundEnd iPlayer )
{    
    
Beacon iPlayer_LastGuard ] = false
    Beacon 
iPlayer_LastPrisoner ] = false
    
    iPlayer_LastPrisoner 
= -1
    iPlayer_LastGuard 
= -1
    
    e_LR 
false
    e_Rambo 
false
    e_S4S 
false
    e_Knife 
false
    e_SC 
false
    e_GT 
false
    e_CB 
false
    e_DB 
false
    e_Boxing 
false
    
    StartTimer 
5
    
    client_cmd 
iPlayer"slot10" )
}

public 
EventSpray ( )
{
    new 
iOrigin];
    
iOrigin] = read_data);
    
iOrigin] = read_data);
    
iOrigin] = read_data);
        
    new 
Float:vecOrigin];
    
IVecFVeciOriginvecOrigin );
    
    new 
iPlayer read_data);
    
    
// get direction player is aiming
    
new Float:vecDirection];
    
velocity_by_aimiPlayer5vecDirection );
    
    
// add the aim direction into the wall for a stop origin
    
new Float:vecStop];
    
xs_vec_addvecOriginvecDirectionvecStop );
    
    
// reverse the direction to go away from wall
    
xs_vec_mul_scalarvecDirection, -1.0vecDirection );
    
    
// add the aim direction way from the wall for a start origin
    
new Float:vecStart];
    
xs_vec_addvecOriginvecDirectionvecStart );
    
    
// trace from start to stop to get where the wall position is
    
engfuncEngFunc_TraceLinevecStartvecStopIGNORE_MONSTERS, -1);
    
    
// find the normal vector of the wall
    
get_tr20TR_vecPlaneNormalvecDirection );
    
    
// remove and up/down direction from the normal vector
    
vecDirection] = 0.0;
    
    
// normalize the direction so scaling it will be correct
    
xs_vec_normalizevecDirectionvecDirection );
    
    
// get direction perpendicular away from the wall
    
xs_vec_mul_scalarvecDirection5.0vecDirection );
    
    
// add direction away from wall to spray origin for a safe area to trace to floor
    
xs_vec_addvecOriginvecDirectionvecStart );
    
    
// set the stop origin 9999.0 units below the start origin
    
xs_vec_copyvecStartvecStop );
    
vecStop] -= 9999.0;
    
    
engfuncEngFunc_TraceLinevecStartvecStopIGNORE_MONSTERS, -1);
    
    
get_tr20TR_vecEndPosvecStop );
    
    new 
szName32 ];
    
get_user_nameiPlayerszNamecharsmaxszName ) );
    
    if ( 
e_SC && iPlayer == iPlayer_LastGuard || iPlayer_LastPrisoner ColorChat 0GREY"^4[SG] Spray Distance^3: %s sprayed^4 %f^3 units above the ground!"szName, ( vecStart] - vecStop] ) )
    
//client_print( 0, print_chat, "%s sprayed %f units above the ground", szName, ( vecStart[ 2 ] - vecStop[ 2 ] ) );
    
    
return PLUGIN_CONTINUE
}

public 
Event_Primary_Attack_Deagle ent )
{
    if( !
e_S4S || CSW_DEAGLE 
        return 
HAM_IGNORED
    
    
new iPlayer peventpev_owner );
    
    if( ( 
iPlayer != iPlayer_LastGuard ) && ( iPlayer != iPlayer_LastPrisoner ) || !is_user_aliveiPlayer ) )
        return 
HAM_IGNORED
    
    swap_weapons
iPlayeriPlayer == iPlayer_LastPrisoner iPlayer_LastGuard iPlayer_LastPrisoner"weapon_deagle" )
    
    return 
HAM_HANDLED
    
}

public 
swap_weapons iPlayeriPlayer2, const weapon[] )
{    
    if ( 
is_user_aliveiPlayer2 ) )
    {
        
strip_user_weaponsiPlayer2 )
        
give_item iPlayer2"weapon_knife" )
        
cs_set_weapon_ammo give_itemiPlayer2"weapon_deagle" ), )
        
cs_set_user_bpammo iPlayer2CSW_DEAGLE)
        
strip_user_weapons iPlayer )
        
give_item iPlayer"weapon_knife" )
    }
    return 
PLUGIN_HANDLED




All times are GMT -4. The time now is 06:11.

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