AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   want id of player who gets my bonus (https://forums.alliedmods.net/showthread.php?t=230113)

xxxperts 11-20-2013 02:46

want id of player who gets my bonus
 
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....:D:D

xxxperts 11-20-2013 02:51

Re: want id of player who gets my bonus
 
sorry but i cant get you...and pls explain me i am beginner

xxxperts 11-20-2013 04:12

Re: want id of player who gets my bonus
 
Quote:

Originally Posted by LordOfNothing (Post 2063121)
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); 



:nono: 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

xxxperts 11-20-2013 06:54

Re: want id of player who gets my bonus
 
from where the admin command came between


All times are GMT -4. The time now is 23:13.

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