How to make so its Only For Admins whit Reservation flag?
PHP Code:
#pragma semicolon 1
#include <sourcemod>
#include <sdkhooks>
#define PLUGIN_VERSION "1.0.0.3"
//infandor
new bool:roundend=false;
new String:strDate[5];
new ActiveWeapon;
public Plugin:myinfo = {
name = "Infinite Ammo",
author = "Cooltad",
description = "gives all players infinite ammo.",
version = PLUGIN_VERSION,
url = "www.thetoptiers.com"
};
public OnPluginStart()
{
for (new client=1;client<=MaxClients;client++)
{
if (IsClientInGame(client))
{
SDKHook(client, SDKHook_PreThink, OnPreThink);
}
}
HookEvent("teamplay_round_win", Event_RoundEnd, EventHookMode_PostNoCopy);
HookEvent("teamplay_round_active", Event_RoundStart, EventHookMode_PostNoCopy);
}
public OnClientPostAdminCheck(client)
{
SDKHook(client, SDKHook_PreThink, OnPreThink);
}
public OnPreThink(client)
{
if (!roundend)
{
for(client=0;client<=MaxClients;client++)
{
if(IsValidEntity(client))
{
ActiveWeapon=GetEntDataEnt2(client,FindSendPropOffs("CTFPlayer", "m_hActiveWeapon"));
if(IsValidEntity(ActiveWeapon))
{
SetEntData(ActiveWeapon,FindSendPropOffs("CBaseCombatWeapon", "m_iClip1"),5,4);
SetEntData(client,FindSendPropOffs("CTFPlayer", "m_iAmmo")+4,5,4);
SetEntData(client,FindSendPropOffs("CTFPlayer", "m_iAmmo")+8,5,4);
}
}
}
}
}
public Event_RoundEnd(Handle:event,const String:name[],bool:dontBroadcast)
{
roundend=true;
}
public Event_RoundStart(Handle:event,const String:name[],bool:dontBroadcast)
{
roundend=false;
}