Raised This Month: $ Target: $400
 0% 

Only For Reservation


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oscaronlir
Senior Member
Join Date: Apr 2013
Old 11-03-2013 , 19:02   Only For Reservation
Reply With Quote #1

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(clientSDKHook_PreThinkOnPreThink);
        }
    }
    
HookEvent("teamplay_round_win"Event_RoundEndEventHookMode_PostNoCopy);
    
HookEvent("teamplay_round_active"Event_RoundStartEventHookMode_PostNoCopy);
}

public 
OnClientPostAdminCheck(client)
{
    
SDKHook(clientSDKHook_PreThinkOnPreThink);
}

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;

oscaronlir is offline
RU_6uK
SourceMod Donor
Join Date: May 2010
Old 11-03-2013 , 19:35   Re: Only For Reservation
Reply With Quote #2

PHP Code:
public OnClientPostAdminCheck(client

    if(
GetUserFlagBits(client) & ADMFLAG_RESERVATION) {
        
SDKHook(clientSDKHook_PreThinkOnPreThink);
    }

RU_6uK 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 02:06.


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