Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Event_DeathMsg() {
- new iKillerSkill = 0
- new iVictimSkill = 0;
- new steam[32], victim_steam[32]
- new id = get_msg_arg_int(1)
- new victim = get_msg_arg_int(2)
- new headshot = get_msg_arg_int(3)
- new KillerWeapon = get_user_weapon(id, _, _);
- new VictimWeapon = get_user_weapon(victim, _, _);
- get_user_authid(id, steam, charsmax(steam))
- get_user_authid(victim, victim_steam, charsmax(victim_steam))
- new bool:qVisible = fm_is_ent_visible(id, victim)
- if(!is_user_connected(id) || is_user_bot(victim))
- return PLUGIN_HANDLED;
- if(id != victim)
- {
- new szKillerData[64]
- new szVictimData[64]
- new iKillerLen = formatex(szKillerData, charsmax(szKillerData), "kills=kills+1")
- new iVictimLen = formatex(szVictimData, charsmax(szVictimData), "deaths=deaths+1")
- if(headshot)
- iKillerLen += formatex(szKillerData[iKillerLen], charsmax(szKillerData) - iKillerLen, ", headshots=headshots+1")
- iDead[id] = 0;
- iDead[victim] +=1;
- iKilled[victim] = 0;
- iKilled[id] +=1;
- switch(iKilled[id])
- {
- case 2: iKillerSkill = 1
- case 3: iKillerSkill = 2
- case 4: iKillerSkill = 4
- case 5: iKillerSkill = 8
- case 6..31: iKillerSkill = 10
- }
- switch(iDead[victim])
- {
- case 3: iVictimSkill = 1
- case 4: iVictimSkill = 2
- case 5: iVictimSkill = 4
- case 6..100: iVictimSkill = 5
- }
- if(KillerWeapon == CSW_KNIFE && VictimWeapon != CSW_KNIFE)
- {
- iKillerSkill += random_num(3, 7)
- }
- if(++iDoubleKill[id] >= 2)
- {
- iDoubleKill[id] = 0;
- iKillerSkill += random_num(5, 10)
- }
- if(!qVisible)
- {
- iKillerSkill += random_num(1, 2)
- }
- set_task(0.1, "funcResetCount", id + FUNKYTHING);
- if(Onehp[id])
- iKillerSkill += random_num(2, 7);
- new steamercent;
- if( ( get_user_flashed( id, steamercent ) ) )
- {
- if( steamercent == 100 )
- iKillerSkill += random_num(3, 8);
- }
- if(iKillerSkill)
- iKillerLen += formatex(szKillerData[iKillerLen], charsmax(szKillerData) - iKillerLen, ", skill=((kills + headshots ) / deaths + %d)", iKillerSkill)
- if(iVictimSkill)
- iVictimLen += formatex(szKillerData[iVictimLen], charsmax(szVictimData) - iVictimLen, ", skill=((kills + headshots ) / deaths - %d)", iVictimSkill)
- formatex(MySQL_Query, charsmax(MySQL_Query), "UPDATE `stats` SET %s WHERE steam='%s'", szKillerData, steam)
- SQL_SimpleQuery(MySQL_Connection, MySQL_Query)
- formatex(MySQL_Query, charsmax(MySQL_Query), "UPDATE `stats` SET %s WHERE steam='%s'", szVictimData, victim_steam)
- SQL_SimpleQuery(MySQL_Connection, MySQL_Query)
- }
- else
- {
- formatex(MySQL_Query, charsmax(MySQL_Query), "UPDATE `stats` SET skill=skill-%d WHERE steam='%s'", random_num(5, 15), steam)
- SQL_SimpleQuery(MySQL_Connection, MySQL_Query)
- }
- return PLUGIN_HANDLED;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement