AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Most Kills (https://forums.alliedmods.net/showthread.php?t=2399)

Peli 06-03-2004 21:19

Most Kills
 
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... :)

devicenull 06-03-2004 22:33

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 :)

Peli 06-03-2004 22:37

Sweet , thanks a lot Devicenull. :)

Peli 06-03-2004 23:11

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 06-04-2004 20:40

Can anyone help me out? :( I'd like to know so I could hopefully finish this plugin soon. :)

devicenull 06-04-2004 21:36

format(output,outlen,"%s MESSAGEHERE",name)

Peli 06-04-2004 21:42

Sorry to throw noob questions at you , I appreciate you helping me.

devicenull 06-04-2004 21:52

Better then the noob questions in the support forum

Peli 06-04-2004 21:55

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. :)

devicenull 06-04-2004 21:57

Maybe, but I dont have a clue as to how to use register_event effectively


All times are GMT -4. The time now is 14:43.

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