Can someone tell me how to do.. ?
i want it like this.
when your earn xp, you earn them on 2 different ways.. Making Headshot or Just killing.. Is this right ?
PHP Code:
public eDeath( )
{
new iKiller = read_data(1);
new kill_name[128];
new iVictim = read_data(2);
new vic_name[128];
new iHeadshot = read_data(3);
//Make sure that the killer exists
if( 1 <= iKiller <= get_maxplayers() )
{
//If victim is not killer
if( iVictim != iKiller )
{
//If victim is not a teammate of killer
if( cs_get_user_team( iVictim ) != cs_get_user_team( iKiller ) )
{
get_user_name(iVictim, vic_name, 127);
PlayerXP[iKiller] += get_pcvar_num(XP_Kill)
client_print(iKiller, print_chat, "%s You got 20 XP for killing %s", PREFIX, vic_name);
}
else
{
if(iHeadshot)
PlayerXP[iKiller] += get_pcvar_num(XP_Hs);
client_print(iKiller, print_chat, "%s You got bonus XP for killing %s with Headshot", PREFIX, vic_name);
//Get the victims name
get_user_name(iVictim, vic_name, 127);
//get the killers name
get_user_name(iKiller, kill_name, 127);
while(PlayerXP[iKiller] >= LEVELS[PlayerLevel[iKiller]])
{
client_print(0, print_chat, "%s You are now on Level %i", PREFIX, PlayerLevel[iKiller]);
PlayerLevel[iKiller] += 1
}
}
}
}
}
__________________