Raised This Month: $ Target: $400
 0% 

Drugplugin, need help, it works, but a little bug left


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Isobold
Veteran Member
Join Date: Mar 2004
Old 08-31-2004 , 09:25   Drugplugin, need help, it works, but a little bug left
Reply With Quote #1

On our kreedzserver some prokreedzers were really charmed about the new challenge kreedzing gave to them, when jumping with the drugpunishment of ATAC.


Thats why I tried 2 extract the drugfunction out of ATAC and make it chooseable by a saycommand. The plugin compiles and loads well, but nothing in it works. If somebody would plz review my code and tell me, what an idiot I am and how to do it better?



Edit: Now I fixed this, druging works well, but I get always drugged, not only after typing drugme, who knows why and how to fix this?

Problems 2 fix: You get drugged directly after connecting. You shall only get drugged, when you type one of the commands...
Centermessage shall anounce drugging...



Feature request:
- a possibility 2 stop the druging...
Attached Files
File Type: sma Get Plugin or Get Source (drug.sma - 806 views - 1.2 KB)
Isobold is offline
Isobold
Veteran Member
Join Date: Mar 2004
Old 08-31-2004 , 11:49  
Reply With Quote #2

Here is the code:


Code:
#include <amxmodx>
#include <amxmisc>
#include <fun>

new gmsgSetFOV

public plugin_init()
{
	register_plugin("Drug", "0.1", "Isobold, thx 2 ATAC")
	register_clcmd("say drugme", "Drugme", 0, "- puts someone on drugs")
	register_clcmd("say drug me", "Drugme", 0, "- puts someone on drugs")
	register_clcmd("say Drugme", "Drugme", 0, "- puts someone on drugs")
	register_clcmd("say Drug me", "Drugme", 0, "- puts someone on drugs")
	register_clcmd("say /drugme", "Drugme", 0, "- puts someone on drugs")
	register_clcmd("say /Drugme", "Drugme", 0, "- puts someone on drugs")
	register_clcmd("say /drug me", "Drugme", 0, "- puts someone on drugs")
	register_clcmd("say /Drug me", "Drugme", 0, "- puts someone on drugs")
	gmsgSetFOV = get_user_msgid("SetFOV")
	register_event("SetFOV", "event_SetFOV", "be", "1<91")
}


public Drugme(id)
{
	if(is_user_alive(id))
	{
		set_hudmessage(0, 225, 0, 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3)
		show_hudmessage(0, "TEST")
		client_print(id, print_console, "You are now drugged.")
		message_begin(MSG_ONE, gmsgSetFOV, {0,0,0}, id)
		write_byte(170)
		message_end()
	}
}

public event_SetFOV(id)
{
	message_begin(MSG_ONE, gmsgSetFOV, {0,0,0}, id)
	write_byte(170)
	message_end()
}
Isobold is offline
KRoT@L
Member
Join Date: Aug 2004
Location: http://www.amxmod.net
Old 08-31-2004 , 13:21  
Reply With Quote #3

Code:
#include <amxmodx> #include <amxmisc> #include <fun> new gmsgSetFOV new bool:DrugFlag[33] public plugin_init() { register_plugin("Drug", "0.1", "Isobold, thx 2 ATAC") register_clcmd("say drugme", "Drugme", 0, "- puts someone on drugs") register_clcmd("say drug me", "Drugme", 0, "- puts someone on drugs") register_clcmd("say Drugme", "Drugme", 0, "- puts someone on drugs") register_clcmd("say Drug me", "Drugme", 0, "- puts someone on drugs") register_clcmd("say /drugme", "Drugme", 0, "- puts someone on drugs") register_clcmd("say /Drugme", "Drugme", 0, "- puts someone on drugs") register_clcmd("say /drug me", "Drugme", 0, "- puts someone on drugs") register_clcmd("say /Drug me", "Drugme", 0, "- puts someone on drugs") register_clcmd("say stopdrug", "StopDrug", 0, "- stop drug effect") register_clcmd("say /stopdrug", "StopDrug", 0, "- stop drug effect") gmsgSetFOV = get_user_msgid("SetFOV") register_event("SetFOV", "event_SetFOV", "be", "1<91") } public Drugme(id) {     if(is_user_alive(id))     {         new player_name[32]         get_user_name(id, player_name, 31)         set_hudmessage(0, 225, 0, 0.05, 0.55, 0, 6.0, 6.0, 0.5, 0.15, 3)         show_hudmessage(0, "%s is now drugged.", player_name)         client_print(id, print_console, "You are now drugged.")         message_begin(MSG_ONE, gmsgSetFOV, {0,0,0}, id)         write_byte(170)         message_end()         DrugFlag[id]=true     }     return PLUGIN_HANDLED } public StopDrug(id) {     new player_name[32]     get_user_name(id, player_name, 31)     set_hudmessage(0, 225, 0, 0.05, 0.55, 0, 6.0, 3.0, 0.5, 0.15, 3)     show_hudmessage(0, "%s is not drugged any more.", player_name)     client_print(id, print_console, "You are not drugged any more.")     message_begin(MSG_ONE, gmsgSetFOV, {0,0,0}, id)     write_byte(90)     message_end()     DrugFlag[id]=false       return PLUGIN_HANDLED } public event_SetFOV(id) {     if(DrugFlag[id])     {         message_begin(MSG_ONE, gmsgSetFOV, {0,0,0}, id)         write_byte(170)         message_end()     } }
KRoT@L is offline
Isobold
Veteran Member
Join Date: Mar 2004
Old 08-31-2004 , 13:29  
Reply With Quote #4

thx very much, I will try it instantly...

Have tested it, everything works fine and exactly as I wanted it to have. Thank you very much, I will post it now in the pluginssection and mention you as coauthor ;)
If you want to have added something in the code (a tag, or your clanhp or something, yust send me a pm)
Isobold is offline
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-31-2004 , 13:47  
Reply With Quote #5

OH THAT effect. I thought I included a fov changer. Updating after class.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
sanaell
Senior Member
Join Date: May 2004
Location: SamutPrakarn Thailand
Old 08-31-2004 , 13:59  
Reply With Quote #6

why you don t make a check say ?

like if containi drug && me
__________________
[email protected]
The Source of Pain is the Pain of Source
sanaell is offline
Send a message via MSN to sanaell
Isobold
Veteran Member
Join Date: Mar 2004
Old 08-31-2004 , 14:25  
Reply With Quote #7

sorry, but plz post further suggestions on the pluginpage

I only searched for help here, because I'm not a good smallcoder (don't have the time 2 learn)...

Anyway, I only include now say drugme and say /drugme... thats not 2 hard to type I think ;)
Isobold is offline
sanaell
Senior Member
Join Date: May 2004
Location: SamutPrakarn Thailand
Old 08-31-2004 , 14:58  
Reply With Quote #8

Quote:
Originally Posted by Isobold
sorry, but plz post further suggestions on the pluginpage

I only searched for help here, because I'm not a good smallcoder (don't have the time 2 learn)...

Anyway, I only include now say drugme and say /drugme... thats not 2 hard to type I think ;)
sorry don t have time to post in other forum

(so try to see some script like warcraft 3 or something else) because it s very very bad coded but not MAD )
__________________
[email protected]
The Source of Pain is the Pain of Source
sanaell is offline
Send a message via MSN to sanaell
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 08-31-2004 , 19:56  
Reply With Quote #9

Updated my plugin.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
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 00:22.


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