Русское сообщество по скриптингу

Help no give kill points when kill player

Scripting help for english speaking users. While not very active, you still have a chance to get help here.
Правила форума
We cannot maintain english version version of our forum rules, but shortly (it's simple) - Don't be a dick. If you really want to know our rules you should check appropriate thread.

Help no give kill points when kill player

Сообщение VenomIvanof » 26 авг 2016, 13:20

The plugin give 2 warning while is compilating. And it dont give points when someone kill a player. Its stuck ..

Код: Выделить всё
#include < amxmodx >
#include < amxmisc >
#include < fakemeta >
#include < engine >
#include < colorchat >
#include < hamsandwich >
#include < fun >
#include < nvault >

#define MAXRANKS 11
#define PLUGIN "Rankings"
#define VERSION "1.3"
#define AUTHOR "BetterPlay / Summerheat's "

//??????????
new PlayerRank[33]
new 
g_AdminListen,  g_AdminListenFlagg_MsgHudgVault
new gPlayerPoints[33], give[33],iTarget[33]

const 
PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
const 
SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE)
const 
MELEE_WEAPONS_BIT_SUM = (1<<CSW_KNIFE)

new const 
rankNames[MAXRANKS][] =
{
"-Unranked-",
"-Newbie-"
"-Medium-"
"-Pro-"
"-Expert-"
"-Professional-"
"-Sensei-"
"-Master-"
"-Unstoppable-",
"-Deadly-",  
"-GOD-"
}

new const 
rankXP[MAXRANKS] =
{
501002005001000150020002500300050007000
}
public 
plugin_init()
{
register_plugin(PLUGINVERSIONAUTHOR)

g_AdminListen register_cvar("amx_listen""1")
g_AdminListenFlag register_cvar("amx_listen_flag""d")


register_clcmd("say /myrank""cmdJumpRank")
register_clcmd("say_team /myrank""cmdJumpRank")
register_clcmd("say /checkrank""cmdCheckLevel")
register_clcmd("say_team /checkrank""cmdCheckLevel")
register_clcmd("say /info""cmdInfo")
register_clcmd("say_team /info""cmdInfo")
register_clcmd("say /rankmenu""cmdRankMenu"ADMIN_RCON)
register_clcmd("say_team /rankmenu""cmdRankMenu"ADMIN_RCON)

register_concmd("Points_Amount""cmdTyped"ADMIN_RCON);

g_MsgHud CreateHudSyncObj()


RegisterHam(Ham_Spawn"player""player_spawn"1);

set_task(1.0"taskHud"0__"b")

gVault nvault_open"PlayerRanks" );
}

public 
player_spawn(id)
{
new 
team get_user_team(id

if( !
is_user_aliveid ) ) 
return;

if(
MAXRANKS == PlayerRank[id]+1)
    
ColorChat(idRED"[MC Level Mod]^x01 Your level is ^x04#%d ^x01with rank ^x04%s ^x01. You have got ^x03 %d points"PlayerRank[id]+1rankNames[PlayerRank[id]], gPlayerPoints[id])
    else
    
ColorChat(idRED"[MC Level Mod]^x01 Your level is ^x04#%d ^x01with rank ^x04%s^x01. You have got ^x03 %d^x01 /^x04 %d^x01 points to become^x04 %s^x01."PlayerRank[id]+1rankNames[PlayerRank[id]], gPlayerPoints[id], rankXP[PlayerRank[id]+1], rankNames[PlayerRank[id]+1])
    
switch( 
PlayerRankid ] )
    {
        case 
1:
        {
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 1")
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 2")
        if(!
is_user_alive(id)) return;
            
give_item(id,"weapon_flashbang")
        }
        case 
2:
        {
            
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 2")
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 2")
        if(!
is_user_alive(id)) return;
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_flashbang")
        }
        case 
3
        {
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 3")
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You get 1 HE + x2 Flash + 1 SM")
        if(!
is_user_alive(id)) return;
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_flashbang")
            
give_item(id,"weapon_flashbang")
            
give_item(id,"weapon_smokegrenade")
        }
        case 
4
        {
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 4")
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You get 1 HE + 2 Flash + 1 SM + Deagle")
        if(!
is_user_alive(id)) return;
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_flashbang")
            
give_item(id,"weapon_flashbang")
            
give_item(id,"weapon_smokegrenade")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
        }        
        case 
5:
        { 
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 5")
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You get x2 HE 1 Flash 1 SM + Deagle")
        if(!
is_user_alive(id)) return;
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_flashbang")
            
give_item(id,"weapon_flashbang")
            
give_item(id,"weapon_smokegrenade")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae"
        }
        case 
6
        {
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 6")
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 2")
        if(!
is_user_alive(id)) return;
            if (
team == 1)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_ak47")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 6")
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 2")
        if(!
is_user_alive(id)) return;
            if (
team == 2)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_m4a1")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
        }  
        case 
7:
        {
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 7")
        
ColorChat(idRED,"^4[^3Auto Reward^4]^3 You get + 8 HP + aj47 + Deagle + x2 HE + x2 Flash")
        if(!
is_user_alive(id)) return;
            if (
team == 1)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_ak47")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 7")
        
ColorChat(idRED,"^4[^3Auto Reward^4]^3 You get + 8 HP + m4a1 + Deagle + x2 HE + x2 Flash")
        if(!
is_user_alive(id)) return;
            if (
team == 2)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_m4a1")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
        }  
        case 
8
        {
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 8")
        
ColorChat(idRED,"^4[^3Auto Reward^4]^3 You get + 10 HP + ak47 + Deagle + x2 HE + x2 Flash")
        if(!
is_user_alive(id)) return;
            
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + 10 );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_ak47")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
give_item(id"item_assaultsuit")
        }
        case 
9
        {
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 9")
        
ColorChat(idRED,"^4[^3Auto Reward^4]^3 You get 10 HP/AP + m4a1 + Deagle + x2 He + x2 Flash + SM")
        if(!
is_user_alive(id)) return;
            if (
team == 1)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + 10 );
        
set_user_armor(idget_user_armorid ) + 10 );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_ak47")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_smokegrenade")
            
give_item(id"item_assaultsuit")
            
        
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 9")
        
ColorChat(idRED,"^4[^3Auto Reward^4]^3 You get 10 HP/AP + m4a1 + Deagle + x2 He + x2 Flash + SM")
        if(!
is_user_alive(id)) return;
            if (
team == 2)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + 10 );
        
set_user_armor(idget_user_armorid ) + 10 );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_m4a1")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_smokegrenade")
            
give_item(id"item_thighpack")
            
give_item(id"item_assaultsuit")
        }  
        
        case 
10
        {
            
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 10")
        
ColorChat(idRED,"^4[^3Auto Reward^4]^3 You get M4a1 + Deagle +x2 HE + x2 Flash + SM ")
        if(!
is_user_alive(id)) return;
            if (
team == 1)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + 20 );
        
set_user_armor(idget_user_armorid ) + 20 );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_ak47")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"ammo_762nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_smokegrenade")
            
give_item(id"item_assaultsuit")
            
        
        
ColorChat(idRED,"^4[^3Maina City^4]^3 You are level 10")
        
ColorChat(idRED,"^4[^3Auto Reward^4]^3 You get M4a1 + Deagle +x2 HE + x2 Flash + SM + KIT")
        if(!
is_user_alive(id)) return;
            if (
team == 2)
                
strip_user_weapons (id)
            
set_user_healthidget_user_healthid ) + 20 );
        
set_user_armor(idget_user_armorid ) + 20 );
        
give_item(id"weapon_knife")
            
give_item(id,"weapon_m4a1")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"ammo_556nato")
            
give_item(id,"weapon_deagle")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"ammo_50ae")
            
give_item(id,"weapon_hegrenade")
            
give_item(id,"weapon_hegrenade")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_flashbang")
            
give_item(id"weapon_smokegrenade")
            
give_item(id"item_thighpack")
            
give_item(id"item_assaultsuit")
        }  
    }
}

public 
cmdCheckLevel(id)
{
    new 
iMenu menu_create("\yRanks \d- \wChoose Player\r:""checklevel_menu_handler")
    
    new 
iPlayers[32], iNumiTarget;
    new 
UserName[34], szTempID[10];
    
get_players(iPlayersiNum);
    for(new 
iiNumi++)
    {
        
iTarget iPlayers[i];
        if(!
is_user_connected(iTarget))
            continue;
        
get_user_name(iTargetUserNamesizeof UserName 1);
        
num_to_str(iTargetszTempIDcharsmax(szTempID));
        
menu_additem(iMenuUserNameszTempID);
    }
    
menu_setprop(iMenuMPROP_EXITMEXIT_ALL);
    
menu_display(idiMenu0);
}

public 
cmdInfo(id)
{
    
show_motd(id"info.txt")
}

public 
checklevel_menu_handler(idiMenuItem)
{
    if(
Item == MENU_EXIT)
    {
        
menu_destroy(iMenu);
        return 
PLUGIN_HANDLED;
    }
    new 
iData[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(iMenuItemaccessiDatacharsmax(iData), iNamecharsmax(iName), callback);
    new 
target str_to_num(iData);
    if(!
is_user_connected(target))
    {
        
ColorChat(idGREEN"[MC Level Mod]^x01 The player you chose is not in the server.")
        
menu_destroy(iMenu);
        
cmdCheckLevel(id);
        return 
PLUGIN_HANDLED;
    }
    
menu_destroy(iMenu);
    new 
szText[256], player_name[32];
    
get_user_name(targetplayer_name31);
    if(
MAXRANKS == PlayerRank[target]+1)
        
formatex(szTextcharsmax(szText), "<html><head></head><body><br/>Name: %s<br/>Points: %d<br/>Level: %d/%d<br/>Rank: %s<br/></body></html>"player_namegPlayerPoints[target], PlayerRank[target]+1MAXRANKSrankNames[PlayerRank[target]]);
    else
        
formatex(szTextcharsmax(szText), "<html><head></head><body><br/>Name: %s<br/>Points: %d/%d<br/>Level: %d/%d<br/>Rank: %s<br/>Next Rank: %s</body></html>"player_namegPlayerPoints[target], rankXP[PlayerRank[target]+1], PlayerRank[target]+1MAXRANKSrankNames[PlayerRank[target]], rankNames[PlayerRank[target]+1]);
    
show_motd(idszText"Rank System");
    
cmdCheckLevel(id);
    return 
PLUGIN_HANDLED;
}

public 
taskHud()
{
    new 
iPlayers[32], iNumiTarget;
    
get_players(iPlayersiNum);
    for(new 
iiNumi++)
    {
        
iTarget iPlayers[i];
        if(!
is_user_connected(iTarget))
            continue;
        
        
set_hudmessage(255000.020.1716.012.0)
        if(
MAXRANKS == PlayerRank[iTarget]+1)
            
ShowSyncHudMsg(iTargetg_MsgHud"Level: [%d/%d] Rank : [%s] Kills : [%d]",PlayerRank[iTarget]+1MAXRANKSrankNames[PlayerRank[iTarget]], gPlayerPoints[iTarget])
        else
            
ShowSyncHudMsg(iTargetg_MsgHud"Level: [%d/%d] Rank : [%s] Kills : [%d/%d]",PlayerRank[iTarget]+1MAXRANKSrankNames[PlayerRank[iTarget]], gPlayerPoints[iTarget], rankXP[PlayerRank[iTarget]+1])
    }
}

public 
cmdJumpRank(id)
{
    if(
MAXRANKS == PlayerRank[id]+1)
        
ColorChat(idRED"[MC Level Mod]^x01 Your level is ^x04#%d ^x01| Rank ^x04%s ^x01| Kills:^x03 %d"PlayerRank[id]+1rankNames[PlayerRank[id]], gPlayerPoints[id])
    else
        
ColorChat(idRED"[MC Level Mod]^x01 Your level is ^x04#%d ^x01| Rank ^x04%s ^x01| Points:^x03 %d^x01 /^x04 %d^x01 to become^x04 %s^x01."PlayerRank[id]+1rankNames[PlayerRank[id]], gPlayerPoints[id], rankXP[PlayerRank[id]+1], rankNames[PlayerRank[id]+1])
}

public 
cmdRankMenu(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED;
    new 
iMenu menu_create("Rank Menu""rankmenu_menu_handler")
    
menu_additem(iMenu"Give Points""1");
    
menu_additem(iMenu"Take Points""2");
    
menu_setprop(iMenuMPROP_EXITMEXIT_ALL);
    
menu_display(idiMenu0);
    return 
PLUGIN_CONTINUE;
}

public 
rankmenu_menu_handler(idiMenuItem)
{
    if(
Item == MENU_EXIT)
    {
        
menu_destroy(iMenu);
        return 
PLUGIN_HANDLED;
    }
    new 
iData[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(iMenuItemaccessiDatacharsmax(iData), iNamecharsmax(iName), callback);
    
give[id] = str_to_num(iData);
    
GiveTakeMenu(id);
    return 
PLUGIN_HANDLED;
}

public 
GiveTakeMenu(id)
{
    static 
szText[64]
    
formatex(szText63"%s Points"give[id] == "Give" "Take")
    new 
iMenu menu_create(szText"givetake_menu_handler")
    
    new 
iPlayers[32], iNumiTarget;
    new 
UserName[34], szTempID[10];
    
get_players(iPlayersiNum);
    for(new 
iiNumi++)
    {
        
iTarget iPlayers[i];
        if(!
is_user_connected(iTarget))
            continue;
        
get_user_name(iTargetUserNamesizeof UserName 1);
        
num_to_str(iTargetszTempIDcharsmax(szTempID));
        
menu_additem(iMenuUserNameszTempID);
    }
    
menu_setprop(iMenuMPROP_EXITMEXIT_ALL);
    
menu_display(idiMenu0);
}

public 
givetake_menu_handler(idiMenuItem)
{
    if(
Item == MENU_EXIT)
    {
        
menu_destroy(iMenu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
iData[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(iMenuItemaccessiDatacharsmax(iData), iNamecharsmax(iName), callback);
    
iTarget[id] = str_to_num(iData);
    if(!
is_user_connected(iTarget[id]))
    {
        
iTarget[id] = 0
        ColorChat
(idGREEN"[MC Rank System]^x01 The player you chose is not in the server.")
        return 
PLUGIN_HANDLED;
    }
    
menu_destroy(iMenu);
    
client_cmd(id"messagemode Points_Amount");
    return 
PLUGIN_HANDLED;
}

public 
cmdTyped(idlevelcid)
{
    if(!
cmd_access(idlevelcid1))
        return 
PLUGIN_HANDLED;
    
    if(!
iTarget[id] || give[id] <= 0)
        return 
PLUGIN_HANDLED;
    if(!
is_user_connected(iTarget[id]))
    {
        
ColorChat(idRED"[MC Rank System]^x01 The player you chose is not in the server.")
        return 
PLUGIN_HANDLED;
    }
    
    new 
iTyped[12];
    
read_argv(1iTypedsizeof iTyped 1);
    new 
g_points str_to_num(iTyped)
    new 
AdminName[32], PlayerName[32];
    
get_user_name(idAdminName31)
    
get_user_name(iTarget[id], PlayerName31)
    if(
give[id] == 1)
    {
        
gPlayerPoints[iTarget[id]] += g_points
        ColorChat
(0GREEN,"[MC Rank System]^x03 %s^x01 gave^x04 %d^x01 rank points to^x03 %s^x01."AdminNameg_pointsPlayerName)
    }
    else
    {
        if(
g_points gPlayerPoints[iTarget[id]])
            
gPlayerPoints[iTarget[id]] = 0
        
else
            
gPlayerPoints[iTarget[id]] -= g_points;
        
ColorChat(0GREEN,"[MC Rank System]^x03 %s^x01 took^x04 %d^x01 rank points from^x03 %s^x01."AdminNameg_pointsPlayerName)
    }
    new 
currentPlayerRank 0;
    while(
currentPlayerRank < (MAXRANKS 1))
    {       
        if(
gPlayerPoints[iTarget[id]] >= rankXP[currentPlayerRank 1])
            ++
currentPlayerRank;     
        else         
            break;
    }
    
PlayerRank[iTarget[id]] = currentPlayerRank;
    
iTarget[id] = 0;
    
GiveTakeMenu(id);
    
Saveid );
    return 
PLUGIN_HANDLED;
}

public 
client_authorizedid )
{
    
Loadid );
}

public 
client_disconnectid )
{
    
Saveid );
}

public 
client_putinserver(id)
{
    new 
currentPlayerRank 0;
    while(
currentPlayerRank < (MAXRANKS 1))
    {       
        if(
gPlayerPoints[id] >= rankXP[currentPlayerRank 1])
            ++
currentPlayerRank;     
        else         
            break;
    }
    
PlayerRank[id] = currentPlayerRank;
}

public 
Loadid )
{
    if( !
is_user_botid ) && !is_user_hltvid ) )
    {
        new 
vaultkey64 ], vaultdata256 ], points33 ], UserName33 ];
        
get_user_nameidUserNamecharsmaxUserName ) );
        
        
formatvaultkeycharsmaxvaultkey ), "%s"UserName );
        
formatvaultdatacharsmaxvaultdata ), "%i#"gPlayerPointsid ] );
        
        
nvault_getgVaultvaultkeyvaultdata255 );
        
replace_allvaultdata255"#"" " );
        
        
parsevaultdatapoints32 );
        
gPlayerPointsid ] = str_to_numpoints );
    }
}

public 
Saveid )
{
    if( !
is_user_botid ) && !is_user_hltvid ) )
    {
        new 
vaultkey64 ], vaultdata256 ], UserName33 ];
        
get_user_nameidUserNamecharsmaxUserName ) );
        
        
formatvaultkeycharsmaxvaultkey ), "%s"UserName );
        
formatvaultdatacharsmaxvaultdata ), "%i#"gPlayerPointsid ] );
        
        
nvault_setgVaultvaultkeyvaultdata );
    }
}


stock strip_weaponsi_Clienti_Type )
{
    new 
i_CurWpnID32 ], ii_WpnIDi_Num 0
    
get_user_weaponsi_Clienti_CurWpnIDi_Num )
    
    for ( 
0i_Numi++ )
    {
        
i_WpnID i_CurWpnID];
        
        if ( ( 
i_Type == && ((1<<i_WpnID) & PRIMARY_WEAPONS_BIT_SUM) ) || ( i_Type == && ( (1<<i_WpnID) & SECONDARY_WEAPONS_BIT_SUM) ) || ( i_Type == && ( (1<<i_WpnID) & MELEE_WEAPONS_BIT_SUM) ) )
        {
            new 
sz_WpnName[32]; get_weaponnamei_WpnIDsz_WpnNamecharsmaxsz_WpnName ) )
            
            new 
i_EntID;
            while ( ( 
i_EntID engfuncEngFunc_FindEntityByStringi_EntID"classname"sz_WpnName ) ) && pevi_EntIDpev_owner ) != i_Client ) {}
            if ( !
i_EntID 
                continue;
            
            if (
get_user_weapon(i_Client) == i_WpnID
            {
                
ExecuteHamBHam_Weapon_RetireWeaponi_EntID )
            }
            
            if ( !
ExecuteHamBHam_RemovePlayerItemi_Clienti_EntID ) ) 
                return;
            
            
ExecuteHamBHam_Item_Killi_EntID )
            
            
set_pevi_Clientpev_weaponspevi_Clientpev_weapons ) & ~(1<<i_WpnID))
        }
    }
}  
 
Аватара пользователя
VenomIvanof
 
Сообщения: 66
Зарегистрирован: 02 апр 2016, 13:26
Благодарил (а): 17 раз.
Поблагодарили: 1 раз.
Языки программирования: Counter-Strike 1.6

Re: Help no give kill points when kill player

Сообщение 6u3oН » 26 авг 2016, 22:45

Sorry for my english.

1. Errors are not critical, it is only warnings. You don't use tabulation.
Код: Выделить всё
client_print(idprint_chat"Hello World!")
  
client_print(idprint_chat"I am busy man!"

>>
Код: Выделить всё
client_print(idprint_chat"Hello World!")
client_print(idprint_chat"I am busy man!"


2. The event kill absent, so don't give points when someone kill a player.
Аватара пользователя
6u3oН
 
Сообщения: 25
Зарегистрирован: 04 июл 2016, 00:31
Откуда: de_westwood
Благодарил (а): 7 раз.
Поблагодарили: 3 раз.
Опыт программирования: Около года
Языки программирования: Pawn


Вернуться в Scripting

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1

cron