AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   If player Died (https://forums.alliedmods.net/showthread.php?t=50933)

Phantom Warrior 02-07-2007 08:26

If player Died
 
I'm making a plugin that will have a HUD MESSAGE all the time saying: You killed: NUMBER Enemies. You have been killed by: # Enemies, and with everytime you die your Happy Points will go down. You'll have 10 happy points to start out with. With everytime you die you will be subtracted a happy point when below 0 happy points they turn into Sad Points and will display: Sad Points: -# here. If you get 10 sad points you loose 2 HP everytime you loose a sadpoint after that.

I need the code to:
Display a HUD message and countdown and up when a player kills, please?
I'll do the rest.

jim_yang 02-07-2007 09:35

Re: If player Died
 
Code:
#include <amxmodx> #include <amxmisc> #define DEFAULT_HAPPY_POINT 10 new g_happy_sad_lvl[33] public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)         register_event("DeathMsg", "hook_death", "a", "1>0") } public client_connect(id) {         g_happy_sad_lvl[id] = DEFAULT_HAPPY_POINT } public client_disconnect(id) {         g_happy_sad_lvl[id] = DEFAULT_HAPPY_POINT } public hook_death() {         new killer = read_data(1)         new victim = read_data(2)                 g_happy_sad_lvl[victim]--         if(killer == victim)                 return         if(get_user_team(killer) == get_user_team(victim))                 g_happy_sad_lvl[killer]--         else                 g_happy_sad_lvl[killer]++ }
something like this. good luck.

Phantom Warrior 02-07-2007 09:36

Re: If player Died
 
Thank you, i'll add you in credits.


All times are GMT -4. The time now is 00:36.

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