AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Deathmatch Day Weapon pickup! (https://forums.alliedmods.net/showthread.php?t=223268)

devu4 08-11-2013 13:33

Deathmatch Day Weapon pickup!
 
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?


All times are GMT -4. The time now is 15:46.

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