Raised This Month: $ Target: $400
 0% 

help me whit this script pleas


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
biobio
New Member
Join Date: Jul 2006
Location: behind uu!
Old 07-13-2006 , 10:48   help me whit this script pleas
Reply With Quote #1

Code:
#include <amxmodx>

new phrase[5][] = {"kanker", "kk", "kenker", "hoer", "neger"}

public say_event(id)
{
new sid[10]
num_to_str(id,sid,10)
new said[192]
read_args(said,191)

for(new i = 0 ;i < 4; i += 1)
if(containi(said,phrase[i]) != -1)
set_task(1.0,"client",0,sid,10)
}

public client(sid[])
{
new id = str_to_num(sid)
engclient_cmd(id,"say", "ik ben een ZIELIGE! LOZER!!! ik kan alleen maar schelden!!!!")
set_user_info(id,"name","ikbenzielig!!")
user_slap(id,10)
client_print(id, print_chat, "[AMXX] Je bent geslapt voor schelden, niet weer doen dit is een waarschuwing")
}

public plugin_init()
{
register_plugin("DONTsay","1.0","biohazz")
register_clcmd("say","say_event")
return PLUGIN_CONTINUE
}
(some of it is dutch so maby some of u dont understand)
i want to make it that when some 1 says 1 of the words for the second time hes getting slayd and when he says 1 of those words for the thirdt time that he is getting kickt but i cant get it work can some 1 do that for me pleas? (im a noob in scripting )
biobio is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 07-13-2006 , 13:37   Re: help me whit this script pleas
Reply With Quote #2

Fixed (& indented) code:
Code:
#include <amxmodx>

new phrase[5][] = {"kanker", "kk", "kenker", "hoer", "neger"}

public say_event(id)
{
	new said[192]
	read_args(said,191)

	for(new i = 0 ;i < 5; i++)
		if(containi(said,phrase[i]) != -1)
			set_task(1.0,"client",id)
}

public client(id)
{
	engclient_cmd(id,"say", "ik ben een ZIELIGE! LOZER!!! ik kan alleen maar schelden!!!!")

	set_user_info(id,"name","ikbenzielig!!")

	user_slap(id,10)

	client_print(id, print_chat, "[AMXX] Je bent geslapt voor schelden, niet weer doen dit is een waarschuwing")
}

public plugin_init()
{
	register_plugin("DONTsay","1.0","biohazz")
	register_clcmd("say","say_event")
}
---

Code:
new sid[10]
num_to_str(id,sid,10)
Isn't needed because we can pass 'id' in set_task w/o using the extra parameter with the length

Code:
for(new i = 0 ;i < 4; i += 1)
if(containi(said,phrase[i]) != -1)
set_task(1.0,"client",0,sid,10)
}
You have 5 total phrases, that currently will iterate 4 times. So we change 4 to 5. Also, i += 1 is redundant, all you need is i++. You use id for the task id and get rid of the extra parameters (sid,10).

Code:
public client(sid[])
{
new id = str_to_num(sid)
engclient_cmd(id,"say", "ik ben een ZIELIGE! LOZER!!! ik kan alleen maar schelden!!!!")
set_user_info(id,"name","ikbenzielig!!")
user_slap(id,10)
client_print(id, print_chat, "[AMXX] Je bent geslapt voor schelden, niet weer doen dit is een waarschuwing")
}
Change sid[] to id, since we're now passing an integer, and get rid of new id = str_to_num(sid)

Hopefully that helped.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
nightscreem
Veteran Member
Join Date: Jul 2004
Location: Belgium
Old 07-13-2006 , 14:15   Re: help me whit this script pleas
Reply With Quote #3

I have taken V3X his code and added some stuff
Code:
#include <amxmodx> new phrase[5][] = {"kanker", "kk", "kenker", "hoer", "neger"} new count[33] public say_event(id) {     new said[192]     read_args( said, 191 )     for(new i = 0 ;i < 5; i++)         if( containi( said, phrase[i] ) != -1 )             set_task( 1.0, "counter", id ) } public counter( id ) {     count[id]++     if( count[id] == 1 ) {         slap_user( id );     }     if( count[id] == 2 ) {         slay_user( id );     }     if( count[id] == 3 ) {         kick_user( id );     } } public slap_user( id ) {     engclient_cmd( id, "say", "ik ben een ZIELIGE! LOZER!!! ik kan alleen maar schelden!!!!" );     set_user_info( id, "name", "ikbenzielig!!" );     user_slap( id, 10 );     client_print( id, print_chat, "[AMXX] Je bent geslapt voor schelden, niet weer doen dit is een waarschuwing, 1/3" ); } public slay_user( id ) {     engclient_cmd( id, "say", "ik ben een ZIELIGE! LOZER!!! ik kan alleen maar schelden!!!!" );     set_user_info( id, "name", "ikbenzielig!!" );         user_kill( id );     client_print( id, print_chat, "[AMXX] Je bent geslapt voor schelden, niet weer doen dit is een waarschuwing, 2/3" ); } public kick_user( id ) {     new reason[255]     format( reason, 254, "Je bent gekicked voor schelden" );     new userid = get_user_userid( id );     server_cmd("kick #%d ^"%s^"", userid, reason) } public plugin_init() {     register_plugin( "DONTsay", "1.0", "biohazz" )     register_clcmd( "say", "say_event" ) }
__________________
- Bye bye!
nightscreem is offline
biobio
New Member
Join Date: Jul 2006
Location: behind uu!
Old 07-13-2006 , 14:19   Re: help me whit this script pleas
Reply With Quote #4

thx v3x for cleaning up the code and thx nightscreem for the rest !! +karama for both of u ;)

Last edited by biobio; 07-13-2006 at 14:28.
biobio is offline
Pistone
Junior Member
Join Date: Mar 2006
Old 10-11-2006 , 17:08   Re: help me whit this script pleas
Reply With Quote #5

Good idea!

the script slap, slay, but no kick the user :O

whats wrong?

please helpme, is very important plugin for me ..


sory me language i am from argentina :O

greetings
Pistone is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-11-2006 , 21:08   Re: help me whit this script pleas
Reply With Quote #6

You just bumped a two month old post, perpare to be banned!
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Da_sk8rboy
Veteran Member
Join Date: Jul 2006
Old 10-11-2006 , 21:10   Re: help me whit this script pleas
Reply With Quote #7

Quote:
Originally Posted by Zenith77 View Post
You just bumped a two month old post, perpare to be banned!
I dont understand why he is getting banned?
__________________
i stop around here and there.
Da_sk8rboy is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 10-11-2006 , 21:48   Re: help me whit this script pleas
Reply With Quote #8

Quote:
Originally Posted by Da_sk8rboy View Post
I dont understand why he is getting banned?
Why is he getting banned?
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
LittleDude
Member
Join Date: Dec 2004
Location: Selah, WA
Old 10-11-2006 , 22:16   Re: help me whit this script pleas
Reply With Quote #9

actually zenith its a 3 month old post that he bumped, 7/13/06 - 10/11/06 2 days off of a month XD
__________________
It is stupid to be stupid, and stupid to not be stupid
LittleDude is offline
Send a message via AIM to LittleDude
n-o-l-o
Member
Join Date: Sep 2004
Location: Germany
Old 10-11-2006 , 22:20   Re: help me whit this script pleas
Reply With Quote #10

LittleDude just spammed a three month old post, perpare to be banned!
n-o-l-o 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 11:35.


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