Raised This Month: $51 Target: $400
 12% 

Deathmatch Day Weapon pickup!


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devu4
Member
Join Date: Apr 2012
Old 08-11-2013 , 13:33   Deathmatch Day Weapon pickup!
Reply With Quote #1

Ok, In my Jailbreak server, when a deathmatch is started users get a random weapon from const szWeapons which I have already specified.

PHP Code:
public do_specialday(id)
{
    static 
CsTeams:team

    
if(g_iDayHasStarted)
    {
        return 
PLUGIN_HANDLED
    
}
    if(
g_iDayTOTAL_DAYS ] == DAY_DEATHMATCH)
    {
        
iRandom randomsizeof(szWeapons) )
        
SaveWeapons(iPlayer)
        
give_item(iPlayerszWeapons[iRandom])  
        
cs_set_user_bpammo(iPlayeriWeaponId[iRandom], iBpAmmo[iRandom]) 
    
    }

I need to stop users picking up other weapons other than the random weapon they received when its deathmatch day.
I have tried this but it stops me picking up any guns or items. I just want to not be able to pick up anything else put the random weapon.

PHP Code:
public Fwd_PlayerWeaponTouch( const iEntity, const id )
{
    if(!(
<= id <= g_iMaxPlayers ))
        return 
HAM_IGNORED

    
new Model[32];
    
pev(iEntitypev_modelModel31)
        
    static 
CsTeams:team
    team 
cs_get_user_team(id)
    

    switch( 
g_iDayTOTAL_DAYS ] )
    {
        case 
DAY_DEATHMATCH:
            switch(
team)
            {
                case 
CS_TEAM_T:
                    if (!
equal(Model"iRandom"))
                        return 
HAM_SUPERCEDE
                
case CS_TEAM_CT:
                    if (!
equal(Model"iRandom"))
                        return 
HAM_SUPERCEDE
            
}
        }

Could someone help me?

Last edited by devu4; 08-11-2013 at 13:34.
devu4 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:57.


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