Raised This Month: $ Target: $400
 0% 

Help with DeathMsg


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 12-29-2006 , 15:05   Re: Help with DeathMsg
Reply With Quote #1

Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "ZombieAttack" #define VERSION "0.0" #define AUTHOR "Bent/Soccdoodcss" public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)             register_event("ResetHUD", "choose_zom", "be")     register_event("DeathMsg", "death_mes", "a")                 //g_var = register_cvar("zombie_on", "1", ADMIN_BAN) } public choose_zom(id) {        new CsTeams:team = cs_get_user_team(id)                    if (team == CS_TEAM_T)          {         set_user_health(id, 200);          }                    return PLUGIN_HANDLED } public death_mes() {         new killer = read_data(1)           new victim = read_data(2)             if(cs_get_user_team(killer) == CS_TEAM_T || cs_get_user_team(victim) != CS_TEAM_T)           {         new name[32]         get_user_name(killer, name, 31)                 set_hudmessage(0, 255, 0, 0.0, 0.3, 0, 6.0, 12.0)                 show_hudmessage(victim, "%s the zombie, has KILLED YOU!", name)           }                     return PLUGIN_HANDLED }
EDIT: Wtf? when i paste the code into AMXX Studio, it goes on 1 line. Can someone fix this?
Deviance is offline
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 12-29-2006 , 15:09   Re: Help with DeathMsg
Reply With Quote #2

Quote:
Originally Posted by Doombringer View Post
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #define PLUGIN "ZombieAttack" #define VERSION "0.0" #define AUTHOR "Bent/Soccdoodcss" public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)             register_event("ResetHUD", "choose_zom", "be")     register_event("DeathMsg", "death_mes", "a")                 //g_var = register_cvar("zombie_on", "1", ADMIN_BAN) } public choose_zom(id) {        new CsTeams:team = cs_get_user_team(id)                    if (team == CS_TEAM_T)          {         set_user_health(id, 200);          }                    return PLUGIN_HANDLED } public death_mes() {         new killer = read_data(1)           new victim = read_data(2)             if(cs_get_user_team(killer) == CS_TEAM_T || cs_get_user_team(victim) != CS_TEAM_T)           {         new name[32]         get_user_name(killer, name, 31)                 set_hudmessage(0, 255, 0, 0.0, 0.3, 0, 6.0, 12.0)                 show_hudmessage(victim, "%s the zombie, has KILLED YOU!", name)           }                     return PLUGIN_HANDLED }
EDIT: Wtf? when i paste the code into AMXX Studio, it goes on 1 line. Can someone fix this?
Yes, to fix that, just copy the code from the "posting" window instead of when you are reading it. I've noticed the HTML/PHP must parse it so when copied it becomes one lined not separate lines. Just "Quote" the person who has the code you want to copy, then copy the code from there. Paste in AMXX Studio and you're set.

Slmclarengt
__________________
But we don’t beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 12-29-2006 , 15:15   Re: Help with DeathMsg
Reply With Quote #3

Quote:
Originally Posted by slmclarengt View Post
Yes, to fix that, just copy the code from the "posting" window instead of when you are reading it. I've noticed the HTML/PHP must parse it so when copied it becomes one lined not separate lines. Just "Quote" the person who has the code you want to copy, then copy the code from there. Paste in AMXX Studio and you're set.

Slmclarengt
Oh, ok. But still, it's quite annoying. I've posted this in the
Site/Forums Issues and Discussion section, hopefully this get's fixed.
Deviance is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 12-29-2006 , 15:22   Re: Help with DeathMsg
Reply With Quote #4

Hey, thanks a lot! Works great.
The only thing : It only shows the message everyother time your die...
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 12-29-2006 , 15:25   Re: Help with DeathMsg
Reply With Quote #5

Quote:
Originally Posted by soccdoodcss View Post
Hey, thanks a lot! Works great.
The only thing : It only shows the message everyother time your die...
Replace
Code:
register_event("DeathMsg", "death_mes", "a")
Whit
Code:
register_event("DeathMsg", "death_mes", "a", "1>0")
Deviance is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 12-29-2006 , 15:31   Re: Help with DeathMsg
Reply With Quote #6

Thanks again man.

Do you know how to make an event occur every second?
Just wondering, if you dont i will just search.
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
Deviance
Veteran Member
Join Date: Nov 2004
Location: Sweden
Old 12-29-2006 , 15:33   Re: Help with DeathMsg
Reply With Quote #7

Quote:
Originally Posted by soccdoodcss View Post
Do you know how to make an event occur every second?
Code:
set_task(1.0,"event_to_exec",_,_,_,"b")
Deviance is offline
slmclarengt
Veteran Member
Join Date: Jul 2004
Location: The Cookie Jar... or Pul
Old 12-29-2006 , 19:50   Re: Help with DeathMsg
Reply With Quote #8

Quote:
Originally Posted by soccdoodcss View Post
Thanks again man.

Do you know how to make an event occur every second?
Just wondering, if you dont i will just search.
I'm pretty sure client_preThink will do the trick there. Or, you could use set_task(1.0, etc...) to call a function to display a message every second. No guarantee on the client_prethink because it might be displayed and never removed.

Slmclarengt
__________________
But we don’t beat the Reaper by living longer. We beat the Reaper by living well. -Dr. Randy Pausch, R.I.P.

Come play WC3:FT on BnD Clan Server! You know you want to: Connect to WC3:FT BnD - go ahead click me!
slmclarengt is offline
soccdoodcss
Veteran Member
Join Date: Nov 2006
Location: Wisconsin
Old 12-29-2006 , 15:39   Re: Help with DeathMsg
Reply With Quote #9

thanks
__________________
"Now safe beneath their wisdom and their feet.
Here I will teach you truly how to sleep."
soccdoodcss is offline
Send a message via AIM to soccdoodcss
Imanoobie
BANNED
Join Date: Sep 2006
Old 12-31-2006 , 08:55   Re: Help with DeathMsg
Reply With Quote #10

client_prethink executes like....a lot, yes seriously, a LOT of time per second!!
Imanoobie 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 22:24.


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