Raised This Month: $51 Target: $400
 12% 

want id of player who gets my bonus


Post New Thread Reply   
 
Thread Tools Display Modes
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
Old 11-20-2013, 02:50
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: stop please last warnings
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 11-20-2013 , 02:51   Re: want id of player who gets my bonus
Reply With Quote #2

sorry but i cant get you...and pls explain me i am beginner

Last edited by xxxperts; 11-20-2013 at 02:52.
xxxperts is offline
Old 11-20-2013, 03:46
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: stop please last warnings
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 11-20-2013 , 04:12   Re: want id of player who gets my bonus
Reply With Quote #3

Quote:
Originally Posted by LordOfNothing View Post
PHP Code:
new szName[33];
get_user_name(idszName32); 
// Then put in a msg

PHP Code:
client_print(idprint_chat"Your name is : %s ",szName); 

not this one if we both are playing and if i give bonus to u than message should come that

xxxperts give bonus to lordofnothing

Last edited by xxxperts; 11-20-2013 at 04:14.
xxxperts is offline
Old 11-20-2013, 05:03
LordOfNothing
This message has been deleted by ConnorMcLeod. Reason: stop please last warnings
xxxperts
Senior Member
Join Date: Oct 2013
Location: India
Old 11-20-2013 , 06:54   Re: want id of player who gets my bonus
Reply With Quote #4

from where the admin command came between
xxxperts 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 18:40.


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