Raised This Month: $ Target: $400
 0% 

help me whit this script pleas


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 08:03.


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