View Single Post
LenHard
Senior Member
Join Date: Jan 2016
Old 05-15-2018 , 04:32   Re: deathmatch (5 minutes =ak, 10 minutes = awp, 15 minutes = usp)
Reply With Quote #3

Quote:
Originally Posted by folubek View Post
hi, i looking for a plugin whose can add deatchmatch (ex. 0-5 minut = only AK, 5-10 = Only AWP, 10-15 = only usp)
PHP Code:
#include <sourcemod>
#include <sdkhooks>

#pragma semicolon 1
#pragma newdecls required

int gI_Weapon 0;

public 
void OnMapStart()
{
    
gI_Weapon 0;
    
CreateTimer(300.0Timer_RepeatINVALID_HANDLETIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);    
}

public 
void OnClientPutInServer(int client)
{
    if (!
IsFakeClient(client)) {
        
SDKHook(clientSDKHook_WeaponCanUseOnWeaponDecideUse);
    }
}

public 
Action Timer_Repeat(Handle hTimer)
{
    ++
gI_Weapon;
}

public 
Action OnWeaponDecideUse(int clientint iWeapon)
{
    if (
IsValidEdict(iWeapon) && IsClientInGame(client))
    {
        
char[] sWeapon = new char[32];
        
GetEdictClassname(iWeaponsWeapon32);
        
        switch (
gI_Weapon)
        {
            case 
1// Ak only
            
{
                if (
sWeapon[7] != 'a' && sWeapon[8] != 'k')
                    return 
Plugin_Handled;
            }
            case 
2// Next weapon
            
{
                
// etc...    
            
}
        }
    }
    return 
Plugin_Continue;

This is what you requested?
__________________
LenHard is offline