Raised This Month: $ Target: $400
 0% 

Clantag benefits


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
sim242
AlliedModders Donor
Join Date: Dec 2012
Location: England
Old 09-13-2017 , 13:38   Re: Clantag benefits
Reply With Quote #32

PHP Code:
#include <sourcemod>    
#include <cstrike>     
#include <sdktools>   
#include <multicolors>   

#define PLUGIN_TAG "nudonudo"   

public void OnPluginStart()   
{   
    
HookEvent("round_start"Event_RoundStart);   
}   

public 
Action Event_RoundStart(Event event, const char[] namebool dontBroadcast)   
{   
    
//Ignore warmup   
    
if (GameRules_GetProp("m_bWarmupPeriod") == 1)   
        return;   
      
    new 
rounds
    
rounds CS_GetTeamScore(3) + CS_GetTeamScore(2);  

    
//If rounds are < than 2 return    
    
if (rounds 1)   
        return;   
           
    for (
int i 1<= MaxClientsi++)   
    if (
IsValidClient(i))   
        
CheckTag(i);   
}   

void CheckTag(int client)   
{     
    
//If clients team is T or CT
    
if (GetClientTeam(client) > 1)
    {
        
//Clear Variables   
        
char sTag[256];   
       
        
//Get Client Clan Tag   
        
CS_GetClientClanTag(clientsTagsizeof(sTag));
        
        
//If Client Clan Tag Contains input from PLUGIN_TAG    
        
if (StrEqual(sTagPLUGIN_TAG))   
        {   
            
SetEntProp(clientProp_Send"m_iAccount"GetClientCash(client) + 200);   
            
CPrintToChat(client"You got $100 bonus for using our clantag, thank you!");   
        }   
        else   
        {   
            
CPrintToChat(client"Use our tag nudonudo for an in-game bonus!");   
        }
    }
}   

int GetClientCash(int client)   
{   
    return 
GetEntProp(clientProp_Send"m_iAccount");   
}   

stock bool IsValidClient(int client)   
{   
    return (
<= client <= MaxClients && IsClientInGame(client));   

That'll sort spectators being included. As for your translations I see no reference to a translation file anywhere in the code so I don't understand what you mean with translations.
__________________
Steam - Sim
Request a private plugin
Not accepting requests at this time
sim242 is offline
Send a message via Skype™ to sim242
 



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 05:03.


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