AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Script help (https://forums.alliedmods.net/showthread.php?t=1398)

Nick 04-25-2004 20:10

Script help
 
Im making a better plugin but some of it is not working.

Code:
#include <amxmodx> #include <amxmisc> public plugin_init() { register_plugin("Say Event","1.0","NicK") register_clcmd("say","say_event") } public plugin_precache() { precache_sound("misc/doh4.wav") precache_sound("misc/fucku.wav") precache_sound("misc/ahh.wav") } new phrase[1][] = { "doh" } new phrasetwo[1][] = { "fu" } new phrasethree[1][] = { "ahh" } new phrasefour[8][] = { "bs", "bullshit", "hacker", "hack", "hax", "speedhack", "wallhack", "aimbot"} new phrasefive[8][] = { "noobed", "newbie", "suxor", "owned", "newb", "whore", "awp", "gay"} new phrasesix[8][] = { "gay", "fag", "homo", "ghey", "queer", "noob", "loser", "bitch"}     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 < 1; i += 1)           if(containi(said,phrase[i]) != -1) {        set_hudmessage(225, 25, 25, -1.0, 0.32, 0, 2.0, 9.0, 0.8, 0.8, 2)            show_hudmessage(0,"DOH!!!")        set_task(1.0,"client",0,sid,10)        break     }           else if(containi(said,phrasetwo[i]) != -1) {              set_hudmessage(225, 25, 25, -1.0, 0.32, 0, 2.0, 9.0, 0.8, 0.8, 2)            show_hudmessage(0,"You son of a bitch!!!")        set_task(1.0,"client2",0,sid,10)        break     }           else if(containi(said,phrasethree[i]) != -1) {              set_task(1.0,"client3",0,sid,10)        break     }           else if(containi(said,phrasefour[i]) != -1) {              set_task(1.0,"client4",0,sid,10)        break     }           else if(containi(said,phrasefive[i]) != -1) {              set_task(1.0,"client5",0,sid,10)        break     }           else if(containi(said,phrasesix[i]) != -1) {              set_task(1.0,"client6",0,sid,10)        break     }    }       public client(sid[])     client_cmd(0,"spk misc/doh4")             public client2(sid[])       client_cmd(0,"spk misc/fucku")     public client3(sid[])       client_cmd(0,"spk misc/ahh")       public client4(sid[])         engclient_cmd(sid[0],"say", "But Im just balming my noobness on you")         public client5(sid[])         engclient_cmd(sid[0],"say", "I really am just a noob though")         public client6(sid[])         engclient_cmd(sid[0],"say", "Admin I disrespect everyone on this server, including you!!!")


Any of the words that are replaced with But Im just balming my noobness on you, I really am just a noob though, Admin I disrespect everyone on this server, including you!!!, do not work, in console it says stop flooding the server. The play of the wav sounds work though. Anyone know what the problem is?

Nick 04-26-2004 19:27

anyone know?

Peli 04-26-2004 19:54

Hmm have you tried compiling it?

IceMouse[WrG] 04-26-2004 20:13

One tip is that you don't put breaks in if statements

Nick 04-26-2004 21:36

Quote:

Originally Posted by Peli
Hmm have you tried compiling it?

Yea I compiled with no errors or warnings

QwertyAccess 04-26-2004 21:47

Blah NM *Delete

devicenull 04-26-2004 21:50

I know!
I did the same thing :)
set_task the include file is wrong, *I think*
its set_task(time,sub,ARGS,ID) or, that works at least

Nick 04-26-2004 22:28

Thanks Ill test it out or at least untill I get gay steam to work...

Nick 04-26-2004 22:39

Tryed to compile but got tons of errors :(

Nick 04-26-2004 23:16

Can someone test it out? ^^

xeroblood 04-27-2004 09:30

This compiled fine..

I simply adjusted sid[0] = id...

Code:
#include <amxmodx> #include <amxmisc> new phrase[1][] = { "doh" } new phrasetwo[1][] = { "fu" } new phrasethree[1][] = { "ahh" } new phrasefour[8][] = { "bs", "bullshit", "hacker", "hack", "hax", "speedhack", "wallhack", "aimbot"} new phrasefive[8][] = { "noobed", "newbie", "suxor", "owned", "newb", "whore", "awp", "gay"} new phrasesix[8][] = { "gay", "fag", "homo", "ghey", "queer", "noob", "loser", "bitch"} public plugin_init() {     register_plugin("Say Event","1.0","NicK")     register_clcmd("say","say_event") } public plugin_precache() {     precache_sound("misc/doh4.wav")     precache_sound("misc/fucku.wav")     precache_sound("misc/ahh.wav") } public say_event(id) {     new sid[2]     sid[0] = id     new said[192]     read_args(said,191)     new i     for( i = 0; i < 1; i++ )     {         if(containi(said,phrase[i]) != -1)         {             set_hudmessage(225, 25, 25, -1.0, 0.32, 0, 2.0, 9.0, 0.8, 0.8, 2)             show_hudmessage( 0, "DOH!!!" )             set_task( 1.0, "client", 0, sid, 1 )             break         }         else if( containi(said,phrasetwo[i]) != -1)         {             set_hudmessage(225, 25, 25, -1.0, 0.32, 0, 2.0, 9.0, 0.8, 0.8, 2)             show_hudmessage(0,"You son of a bitch!!!")             set_task(1.0,"client2",0,sid,1)             break         }         else if(containi(said,phrasethree[i]) != -1)         {             set_task(1.0,"client3",0,sid,1)             break         }         else if(containi(said,phrasefour[i]) != -1)         {             set_task(1.0,"client4",0,sid,1)             break         }         else if(containi(said,phrasefive[i]) != -1)         {             set_task(1.0,"client5",0,sid,1)             break         }         else if(containi(said,phrasesix[i]) != -1)         {             set_task(1.0,"client6",0,sid,1)             break         }     }     return PLUGIN_HANDLED } public client(sid[]) {     client_cmd(0,"spk misc/doh4") } public client2(sid[]) {     client_cmd(0,"spk misc/fucku") } public client3(sid[]) {     client_cmd(0,"spk misc/ahh") } public client4(sid[]) {     engclient_cmd(sid[0],"say", "But Im just balming my noobness on you") } public client5(sid[]) {     engclient_cmd(sid[0],"say", "I really am just a noob though") } public client6(sid[]) {     engclient_cmd(sid[0],"say", "Admin I disrespect everyone on this server, including you!!!") }

Nick 04-27-2004 18:49

I compiled with no error's and still only the wavs worked but not replace text...:(

donzeze 04-28-2004 05:59

Try changing the "say" command by "amx_say" becouse with the first one you're chating as any other player.

DonZeZe

Nick 04-28-2004 16:41

Alright haven't thought of that :) ty

donzeze 04-29-2004 00:57

you canl also use :
Code:
// amx_tsay <color> <message> //for left low side messages amx_tsay red Hello //or // amx_csay <color> <message> // for center hud messages amx_csay blue Bye

Tell me if it works

Nick 04-29-2004 02:36

Alright ty

MerK 04-29-2004 05:00

Wow didnt realise how similar the code is to php? or pretty similar

w000t i gonna try make a plugin now :0

FlyingMongoose 04-29-2004 09:00

PHP, Small, and quite a few other languages are very close to C and C++ programming, though are not the same. Making them look alike


All times are GMT -4. The time now is 15:16.

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