Raised This Month: $ Target: $400
 0% 

want id of player who gets my bonus


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 11-20-2013 , 02:46   want id of player who gets my bonus
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <engine>

#define PLUGIN        "Spec Bonus HP"
#define VERSION        "1.0"
#define AUTHOR        "Shooting King"

new bool:g_bonusGiven[33];
new 
bool:g_bonusOver[33];
new 
pcvar_hp;

public 
plugin_init()
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
register_clcmd"say /givehp""cmd_GiveHp" );
    
register_clcmd"say_team /givehp""cmd_GiveHp" );
    
    
pcvar_hp register_cvar"amx_sk_sbhp""50" );
    
    
register_event"HLTV""event_NewRound""a""1=0""2=0" );
}

public 
event_NewRound()
{
    for( new 
i=133i++ )
    {
        
g_bonusGiven[i] = false;
        
g_bonusOver[i] = false;
    }
}

public 
client_putinserver(id)
{
    
g_bonusGiven[id] = false;
    
g_bonusOver[id] = false;
}

public 
cmd_GiveHp(id)
{
    new 
iSpecMode entity_get_int(idEV_INT_iuser1);
    if(
iSpecMode == || iSpecMode == 3)
    {
        
client_printidprint_chat"You are not a Spectating a player." );
        return 
PLUGIN_CONTINUE;
    }
    
    if(
g_bonusOver[id])
    {
        
client_printidprint_chat"You have already given hp to some other player this round. Try again next round" );
        return 
PLUGIN_CONTINUE;
    }
    
    new 
iSpec entity_get_int(idEV_INT_iuser2);
    
    if(
g_bonusGiven[iSpec])
    {
        
client_printidprint_chat"Bonus to this player has already been given by some other player." );
        return 
PLUGIN_CONTINUE;
    }
    
    
entity_set_floatiSpecEV_FL_health, (entity_get_float(iSpecEV_FL_health)+get_pcvar_float(pcvar_hp)));
        
    
g_bonusGiven[id] = true;
    
g_bonusOver[id] = true;
    return 
PLUGIN_CONTINUE;

i want the name of player who get my bonus....
xxxperts is offline
 



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 23:13.


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