| FireJinTW |
06-03-2015 11:35 |
[REQ] Pts System
PHP Code:
#include <amxmodx> #include <amxmisc>
new PlayerPoints[33] new PointSystem_On, Point_Kill, Point_Hs, Point_Knife, Point_KnifeHs, Point_Die, Point_DHs, Point_DKnife, Point_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( 1 ) new iVictim = read_data( 2 ) new headshot = read_data( 3 ) new clip, ammo, weapon = 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(0, 255, 0, -1.0, 0.78, 0, 6.0, 7.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
|