AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQ] Pts System (https://forums.alliedmods.net/showthread.php?t=263853)

FireJinTW 06-03-2015 11:35

[REQ] Pts System
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

new PlayerPoints[33]
new 
PointSystem_OnPoint_KillPoint_HsPoint_KnifePoint_KnifeHsPoint_DiePoint_DHsPoint_DKnifePoint_DKnifeHS

public plugin_init()
{
    
register_plugin("Points System""1.1""Fxfighter/Jhob94")
    
    
register_event("DeathMsg""eDeath""a")
    
    
PointSystem_On=register_cvar("amx_ps""1"// Turn 0 To Desactivate The Plugin
    
    
Point_Kill=register_cvar("Points_kill""1")
    
Point_Hs=register_cvar("Points_kill_hs","2.5")
    
Point_Knife=register_cvar("Points_kill_knife","5")
    
Point_KnifeHs=register_cvar("Points_kill_knifehs","10")
        
    
// If You Dont Want Remove Points When Player Die, Set This Cvars To 0
    
Point_Die=register_cvar("Points_die","0.5")
    
Point_DHs=register_cvar("Points_die_hs","1")
    
Point_DKnife=register_cvar("Points_die_knife","2.5")
    
Point_DKnifeHS=register_cvar("Points_die_knifehs","7")
    
    
register_clcmd("say /points""ShowPoints")
    
register_clcmd("say_team /points""ShowPoints")
    
register_clcmd("say points""ShowPoints")
    
register_clcmd("say_team points""ShowPoints")
}

public 
eDeath(  ) 
{
    if (
get_pcvar_num(PointSystem_On))
    {
        new 
attacker read_data)
        new 
iVictim read_data)
        new 
headshot read_data)
        new 
clipammoweapon get_user_weapon(attacker,clip,ammo);
 
        if(!
headshot && !(weapon == CSW_KNIFE))
        {
            
PlayerPoints[attacker] += get_pcvar_num(Point_Kill)
            if(
PlayerPoints[iVictim] > Point_Die)
            {
                
PlayerPoints[iVictim] -= get_pcvar_num(Point_Die)
            }
            else if(
PlayerPoints[iVictim] <= Point_Die)
            {
                
PlayerPoints[iVictim] = 0
            
}
        }
    
        if(
headshot && !(weapon == CSW_KNIFE))
        {
            
PlayerPoints[attacker] += get_pcvar_num(Point_Hs)
            if(
PlayerPoints[iVictim] > Point_DHs)
            {
                
PlayerPoints[iVictim] -= get_pcvar_num(Point_DHs)
            }
            else if(
PlayerPoints[iVictim] <= Point_DHs)
            {
                
PlayerPoints[iVictim] = 0
            
}
        }
        
        if(
weapon == CSW_KNIFE && !headshot)
        {
            
PlayerPoints[attacker] += get_pcvar_num(Point_Knife)
            if(
PlayerPoints[iVictim] > Point_DKnife)
            {
                
PlayerPoints[iVictim] -= get_pcvar_num(Point_DKnife)
            }
            else if(
PlayerPoints[iVictim] <= Point_DKnife)
            {
                
PlayerPoints[iVictim] = 0
            
}
        }
        
        if(
headshot && weapon == CSW_KNIFE)
        {
            
PlayerPoints[attacker] += get_pcvar_num(Point_KnifeHs)
            if(
PlayerPoints[iVictim] > Point_DKnifeHS)
            {
                
PlayerPoints[iVictim] -= get_pcvar_num(Point_DKnifeHS)
            }
            else if(
PlayerPoints[iVictim] <= Point_DKnifeHS)
            {
                
PlayerPoints[iVictim] = 0
            
}
        }
        
        
ShowPoints(attacker)
    }
}

public 
ShowPoints(id)
{
    if (
get_pcvar_num(PointSystem_On))
    {
        
set_hudmessage(02550, -1.00.7806.07.0)
        
show_hudmessage(id"Points: %i",PlayerPoints[id])
    }
}

public 
client_connect(id)
{
    if (
get_pcvar_num(PointSystem_On))
    {
        
PlayerPoints[id] = 0
    
}
}

public 
client_disconnect(id)
{
    if (
get_pcvar_num(PointSystem_On))
    {
        
PlayerPoints[id] = 0
    
}


I am just wondering that can this point system apply showing as Kill Number on Scroeboard?
Or anything that make it shows on scoreboard

Thanks


All times are GMT -4. The time now is 20:17.

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