Raised This Month: $32 Target: $400
 8% 

VIP Cash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
oscaronlir
Senior Member
Join Date: Apr 2013
Old 10-14-2013 , 12:41   VIP Cash
Reply With Quote #1

How to make so its only for players whit Custom1

PHP Code:
public OnPluginStart()
{
    
g_iAccount FindSendPropOffs("CCSPlayer""m_iAccount");
    Switch = 
CreateConVar("extra_Cash_on","1","1 turns plugin on 0 is off",FCVAR_NOTIFY);
    
Cash CreateConVar("extra_cash_amount","16000","Sets Amount OF Money Given On Spawn",FCVAR_NOTIFY);
    
HookEvent("player_spawn" Spawn);
}

public 
Spawn(Handleevent , const Stringname[] , booldontBroadcast)
{
    new 
clientID GetEventInt(event,"userid");
    new 
client GetClientOfUserId(clientID);
    if(
GetConVarInt(Switch))
    {
        
SetMoney(client,GetConVarInt(Cash));
    }
}

public 
SetMoney(clientamount)
{
    if (
g_iAccount != -1)
    {
        
SetEntData(clientg_iAccountamount);
    }    


Last edited by oscaronlir; 10-14-2013 at 13:10.
oscaronlir is offline
TnTSCS
AlliedModders Donor
Join Date: Oct 2010
Location: Undisclosed...
Old 10-14-2013 , 14:44   Re: VIP Cash
Reply With Quote #2

Quote:
Originally Posted by oscaronlir View Post
How to make so its only for players whit Custom1
PHP Code:
public OnPluginStart()
{
    
g_iAccount FindSendPropOffs("CCSPlayer""m_iAccount");
    Switch = 
CreateConVar("extra_Cash_on","1","1 turns plugin on 0 is off",FCVAR_NOTIFY);
    
Cash CreateConVar("extra_cash_amount","16000","Sets Amount OF Money Given On Spawn",FCVAR_NOTIFY);
    
HookEvent("player_spawn" Spawn);
}

public 
Spawn(Handleevent , const Stringname[] , booldontBroadcast)
{
    new 
clientID GetEventInt(event,"userid");
    new 
client GetClientOfUserId(clientID);
    if(
GetConVarInt(Switch) && CheckCommandAccess(client"vip_cash"ADMFLAG_CUSTOM1true))
    {
        
SetMoney(client,GetConVarInt(Cash));
    }
}

public 
SetMoney(clientamount)
{
    if (
g_iAccount != -1)
    {
        
SetEntData(clientg_iAccountamount);
    }    

CheckCommandAccess
__________________
View my Plugins | Donate

Last edited by TnTSCS; 10-14-2013 at 14:45.
TnTSCS is offline
Wazman
AlliedModders Donor
Join Date: Oct 2012
Location: Unknown place ????
Old 10-14-2013 , 15:15   Re: VIP Cash
Reply With Quote #3

Quote:
Originally Posted by TnTSCS View Post
PHP Code:
public OnPluginStart()
{
    
g_iAccount FindSendPropOffs("CCSPlayer""m_iAccount");
    Switch = 
CreateConVar("extra_Cash_on","1","1 turns plugin on 0 is off",FCVAR_NOTIFY);
    
Cash CreateConVar("extra_cash_amount","16000","Sets Amount OF Money Given On Spawn",FCVAR_NOTIFY);
    
HookEvent("player_spawn" Spawn);
}

public 
Spawn(Handleevent , const Stringname[] , booldontBroadcast)
{
    new 
clientID GetEventInt(event,"userid");
    new 
client GetClientOfUserId(clientID);
    if(
GetConVarInt(Switch) && CheckCommandAccess(client"vip_cash"ADMFLAG_CUSTOM1true))
    {
        
SetMoney(client,GetConVarInt(Cash));
    }
}

public 
SetMoney(clientamount)
{
    if (
g_iAccount != -1)
    {
        
SetEntData(clientg_iAccountamount);
    }    

CheckCommandAccess
You're on a roll, a lot of post I read, I see you reply with your own code lol.
Wazman 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 01:56.


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