Quote:
Originally Posted by folubek
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.0, Timer_Repeat, INVALID_HANDLE, TIMER_REPEAT|TIMER_FLAG_NO_MAPCHANGE);
}
public void OnClientPutInServer(int client)
{
if (!IsFakeClient(client)) {
SDKHook(client, SDKHook_WeaponCanUse, OnWeaponDecideUse);
}
}
public Action Timer_Repeat(Handle hTimer)
{
++gI_Weapon;
}
public Action OnWeaponDecideUse(int client, int iWeapon)
{
if (IsValidEdict(iWeapon) && IsClientInGame(client))
{
char[] sWeapon = new char[32];
GetEdictClassname(iWeapon, sWeapon, 32);
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?
__________________