Raised This Month: $51 Target: $400
 12% 

Check kills


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-27-2014 , 09:06   Check kills
Reply With Quote #1

Hello Guys ! . i've made a plugin that shows top 3 Killers in every round with hud ( " i didn't test it " ) but I figured that the function of checking kills is useless knowing that the function that i have use is get_user_frags() !

Code:
public Hook_Death(){     new kill,vic,TopKills;         kill = read_data(1)     vic = read_data(2)     TopKills = get_user_frags(kill);         if (kill == vic){         return 1;     }     switch(TopKills)     {         case 0..2: g_Kills[kill] += 1             case 3..5: g_Kills[kill] += 2             case 6..10: g_Kills[kill] += 3         }     return 0; }
Freezo Begin is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-27-2014 , 09:30   Re: Check kills
Reply With Quote #2

So what is your question/problem?
SpeeDeeR is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-27-2014 , 10:23   Re: Check kills
Reply With Quote #3

If you read the description you will understand !!
Again . i want a function to check kill . Read the description please !
Freezo Begin is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-27-2014 , 10:31   Re: Check kills
Reply With Quote #4

What I understand is that you want to loop trough all players and get the three first players with most kills. Like a top 3?
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-27-2014 , 10:35   Re: Check kills
Reply With Quote #5

Exactly !! i've made it the top 3 and its ranking by frags . so i need to get rank by kills every round !
Freezo Begin is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 06-27-2014 , 12:36   Re: Check kills
Reply With Quote #6

Gather the kills in a playerkilled type event/forward in an array and on round end sort the array, get your first/last three entries(depending on your sort algorithm) and then set the array to 0.

Last edited by SpeeDeeR; 06-27-2014 at 12:38.
SpeeDeeR is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-27-2014 , 13:40   Re: Check kills
Reply With Quote #7

Well . Thank's SpeeDer ! i have try this
Code:
public Hook_Death(){     new kill,vic,TopKills;         kill = read_data(1)     vic = read_data(2)         if (kill != vic){         TopKills += 1;     }         switch(TopKills)     {         case 0..2: g_Kills[kill] += 1             case 3..5: g_Kills[kill] += 2             case 6..10: g_Kills[kill] += 3         }     return 0; }
and my question is TopKills += 1 . is it like TopKills++ ?
Freezo Begin is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 06-27-2014 , 13:51   Re: Check kills
Reply With Quote #8

Quote:
Originally Posted by Freezo Begin View Post
Well . Thank's SpeeDer ! i have try this
Code:
public Hook_Death(){     new kill,vic,TopKills;         kill = read_data(1)     vic = read_data(2)         if (kill != vic){         TopKills += 1;     }         switch(TopKills)     {         case 0..2: g_Kills[kill] += 1             case 3..5: g_Kills[kill] += 2             case 6..10: g_Kills[kill] += 3         }     return 0; }
and my question is TopKills += 1 . is it like TopKills++ ?
var ++ is the same as var += 1. It will add 1 to the actual value of the variable.
HamletEagle is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 06-27-2014 , 13:54   Re: Check kills
Reply With Quote #9

Oké ! thanks for your fast reply !
Freezo Begin is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:08.


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