Raised This Month: $ Target: $400
 0% 

Most Kills


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-03-2004 , 21:19   Most Kills
Reply With Quote #1

I need help with some things I don't know hehe. I need to know how would I know which player got the most kills during the previous round. If you are curious about what I'm trying to do , well I'm trying to display the name of the player who got the highest kills the previous round and then say there is a reward for killing that player , then if he/she is killed the person who killed them will get extra money and it continues like this...
Peli is offline
Send a message via MSN to Peli
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-03-2004 , 22:33  
Reply With Quote #2

Code:
new kills[32] public plugin_init() { register_plugin("Kills","0.1","dev") register_cvar("mp_highkill","") //You need some kind of event that registers on a players kill, probably hook the death message new hkill[32] get_cvar_string("mp_highkill",hkill,32) if (strlen(hkill) > 0) { //Display message here set_cvar_string("mp_highkill","" } } public plugin_end() { new hplayer = 0 for (new i=0;i<=32;i++) { if (kills[i] > kills[hplayer]) hplayer=i } new name[32] get_user_name(hplayer,name,32) set_cvar_string("mp_highkill",name) } public client_connect(id) { kills[id] = 0 } public client_disconnect(id) { kills[id] = 0 } public killevent(id) { kills[id]++ }
Should work
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-03-2004 , 22:37  
Reply With Quote #3

Sweet , thanks a lot Devicenull.
Peli is offline
Send a message via MSN to Peli
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-03-2004 , 23:11  
Reply With Quote #4

I have a question , please help me with this. When I'm displaying my message how would I make it so that it says the persons name then my message? Like this :
Code:
%name% message
Peli is offline
Send a message via MSN to Peli
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-04-2004 , 20:40  
Reply With Quote #5

Can anyone help me out? I'd like to know so I could hopefully finish this plugin soon.
Peli is offline
Send a message via MSN to Peli
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-04-2004 , 21:36  
Reply With Quote #6

format(output,outlen,"%s MESSAGEHERE",name)
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-04-2004 , 21:42  
Reply With Quote #7

Sorry to throw noob questions at you , I appreciate you helping me.
Peli is offline
Send a message via MSN to Peli
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-04-2004 , 21:52  
Reply With Quote #8

Better then the noob questions in the support forum
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 06-04-2004 , 21:55  
Reply With Quote #9

Haha , okay I have another question. Can I use ResetHUD as my event or would that not work? Also , how would I use it in their after I do this :
Code:
public event { //What would I do here?
Thanks again.
Peli is offline
Send a message via MSN to Peli
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 06-04-2004 , 21:57  
Reply With Quote #10

Maybe, but I dont have a clue as to how to use register_event effectively
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull 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 14:43.


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