BANNED
Join Date: Sep 2005
Location: LOL
|
07-03-2007
, 14:01
Re: Player Points
|
#84
|
Ahh thanks... I just don't have the time anymore.
Just to let you all know. In mine, each kill, depending on what type of kill it was, with what, and headshot or not, is a different calculation for how many points they get.
The calculations are a bit trippy if you ask me. It does calculations between the killers and the victims points.
BTW: If you are still looking to keep your code and incorporate this, take a look at this little section.
Code:
public event_deathmsg()
{
new killer = read_data(1);
new victim = read_data(2);
new headshot = read_data(3);
if(g_UserPoints[victim] <= 0)
{
banid_user(victim);
}
new killerName[32],victimName[32];
get_user_name(killer,killerName,31);
get_user_name(victim,victimName,31);
new KillerTeam = get_user_team(killer);
new VictimTeam = get_user_team(victim);
/*Headshot Kills*/
// Player Killed Points / User who killed x 2.6
new Float:headshotDeathNum = (((g_UserPoints[victim]/g_UserPoints[killer])*2.6)+5);
new headshotDeath = (floatround(Float:headshotDeathNum,floatround_round));
// Player Killed Points / User who killed x 3.0 + 4
new Float:headshotKillNum = (((g_UserPoints[victim]/g_UserPoints[killer])*3.0)+6);
new headshotKill = (floatround(Float:headshotKillNum,floatround_round));
/*Knife kills*/
// Player Killed Points / User who killed x 2.8
new Float:knifeDeathNum = (((g_UserPoints[victim]/g_UserPoints[killer])*2.8)+6);
new knifeDeath = (floatround(Float:knifeDeathNum,floatround_round));
// Player Killed Points / User who killed x 3.2 + 10
new Float:knifeKillNum = (((g_UserPoints[victim]/g_UserPoints[killer])*3.2)+10);
new knifeKill = (floatround(Float:knifeKillNum,floatround_round));
/*Normal Body Shot Kills*/
// Player Killed Points / User who killed x 2.2
new Float:bodyDeathNum = (((g_UserPoints[victim]/g_UserPoints[killer])*2.2)+2);
new bodyDeath = (floatround(Float:bodyDeathNum,floatround_round));
// Player Killed Points / User who killed x 2.6
new Float:bodyKillNum = (((g_UserPoints[victim]/g_UserPoints[killer])*2.6)+2);
new bodyKill = (floatround(Float:bodyKillNum,floatround_round));
/*Grenade Kills*/
// Player Killed Points / User who killed x 2.4
new Float:grenadeDeathNum = (((g_UserPoints[victim]/g_UserPoints[killer])*2.4)+3);
new grenadeDeath = (floatround(Float:grenadeDeathNum,floatround_round));
// Player Killed Points / User who killed x 2.8 + 4
new Float:grenadeKillNum = (((g_UserPoints[victim]/g_UserPoints[killer])*2.8)+4);
new grenadeKill = (floatround(Float:grenadeKillNum,floatround_round));
static weapon_name[24];
read_data(4,weapon_name,23);
// deaths by hegrenade are reported as grenade, fix
replace(weapon_name,23,"grenade","hegrenade");
replace(weapon_name,23,"weapon_hegrenade","hegrenade");
if(killer == victim)
{
g_UserPoints[victim] -= 25;
client_print(victim,print_chat,"[FAST-FRAG] %s: -25 points for a suicide",victim);
point_hud(victim);
update_event(victim,6,2,25,false);
}
// team kill
else if(KillerTeam == VictimTeam)
{
g_UserPoints[killer] -= 25;
client_print(killer,print_chat,"[FAST-FRAG] %s: -25 points for killing a teammate",killer);
point_hud(killer);
update_event(killer,8,2,25,false);
return PLUGIN_HANDLED;
}
// Knife kill
// Player Killed Points / User who killed x 3.2 + 10
else if(equal(weapon_name,"knife"))
{
g_UserPoints[killer] += knifeKill;
client_print(killer,print_chat,"[FAST-FRAG] %s: +%i for a knife kill",killerName,knifeKill);
point_hud(killer);
g_UserPoints[victim] -= knifeDeath;
client_print(victim,print_chat,"[FAST-FRAG] %s: -%i for a knife death",victimName,knifeDeath);
point_hud(victim);
update_event(killer,9,1,knifeKill,true);
update_event(victim,10,2,knifeDeath,true);
return PLUGIN_HANDLED;
}
else if(equal(weapon_name,"hegrenade"))
{
g_UserPoints[killer] += grenadeKill;
client_print(killer,print_chat,"[FAST-FRAG] %s: +%i for a grenade kill",killerName,grenadeKill);
point_hud(killer);
g_UserPoints[victim] -= grenadeDeath;
client_print(victim,print_chat,"[FAST-FRAG] %s: -%i for a grenade death",victimName,grenadeDeath);
point_hud(victim);
update_event(killer,11,1,grenadeKill,true);
update_event(victim,12,2,grenadeDeath,true);
return PLUGIN_HANDLED;
}
else if(equal(weapon_name,"worldspawn"))
{
g_UserPoints[victim] -= 25;
point_hud(victim);
client_print(victim,print_chat,"[FAST-FRAG] %s: -25 points for a suicide",victim);
update_event(victim,8,2,25,false);
}
else if(headshot)
{
// Player Killed Points / User who killed x 2.6
g_UserPoints[victim] -= headshotDeath;
client_print(victim,print_chat,"[FAST-FRAG] %s: -%i for a headshot death",victimName,headshotDeath);
point_hud(victim);
// Player Killed Points / User who killed x 3.0 + 4
g_UserPoints[killer] += headshotKill;
client_print(killer,print_chat,"[FAST-FRAG] %s: +%i for a headshot kill",killerName,headshotKill);
point_hud(killer);
update_event(killer,13,1,headshotKill,true);
update_event(victim,14,2,headshotDeath,true);
return PLUGIN_HANDLED;
}
// Player Killed Points / User who killed x 2.2
else
{
g_UserPoints[killer] += bodyKill;
client_print(killer,print_chat,"[FAST-FRAG] %s: +%i for a body shot kill",killerName,bodyKill);
point_hud(killer);
g_UserPoints[victim] -= bodyDeath;
client_print(victim,print_chat,"[FAST-FRAG] %s: -%i for a body shot death",victimName,bodyDeath);
point_hud(victim);
update_event(killer,15,1,bodyKill,true);
update_event(victim,16,2,bodyDeath,true);
return PLUGIN_HANDLED;
}
point_hud(victim);
return PLUGIN_CONTINUE;
}
Last edited by SweatyBanana; 07-03-2007 at 14:07.
|
|