AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Triggered by. (https://forums.alliedmods.net/showthread.php?t=12495)

h4ns 04-16-2005 22:04

Triggered by.
 
I want to know how to trigger something by just saying a specific word.

like when someone sais changemap => then amx_warn will activate and will warn the person. Or that it kicks the player.

v3x 04-16-2005 22:11

Code:
#include <amxmodx> public plugin_init() {     // ..     register_concmd("say","handle_say")     register_concmd("say_team","handle_say") } public handle_say(id) {     new message[264]     read_args(message,263)     remove_quotes(message)     if(containi(message,"changemap")!=-1) {         // ..     }     return PLUGIN_HANDLED }

Edited*

h4ns 04-16-2005 22:57

tnx

XxAvalanchexX 04-17-2005 01:24

Code:
    if(containi(message,"changemap")==-1) {         // ..     }

This would execute the code if they DID NOT say changemap. :-p Use the != symbol:

Code:
    if(containi(message,"changemap")!=-1) {         // ..     }

v3x 04-17-2005 01:42

LOL, wow.. I think I got a case of the stupidness this week! I keep overlooking the most simplest things. :lol:

h4ns 04-17-2005 08:22

lol, no u rule at modding man. I wish I could do it as good as u :(

v3x 04-17-2005 08:25

Just because I try and help out every single person as much as I can, doesn't mean I rool (yes, I said ROOL) at modding. :P

I've been coding for at least 2 months now, and I'm learning this a hell of a lot faster than when I was learning PHP. Once I get out of school this year, I'll have much more time to spend on coding. Maybe one day I'll be an AMXX guru like xeroblood. ;)

h4ns 04-17-2005 13:00

hmm u told me how to let the plugin notice that someone sais a specific word but how can I make the

changemap word trigger another plugin like kicking? Ask alot of questions but cant find it everywhere and this is the only way i'll learn :wink:

ZiP* 04-17-2005 13:15

Quote:

Originally Posted by v3x
I've been coding for at least 2 months now, and I'm learning this a hell of a lot faster than when I was learning PHP.

lol, i've tried to learn it for 1 year now... And i can't remember the plugin_init part :D

v3x 04-17-2005 13:19

Quote:

Originally Posted by ZiP*
Quote:

Originally Posted by v3x
I've been coding for at least 2 months now, and I'm learning this a hell of a lot faster than when I was learning PHP.

lol, i've tried to learn it for 1 year now... And i can't remember the plugin_init part :D

Lol, damn man.. Just stick with it, you'll eventually learn something. :)

@h4ns:
Code:
#include <amxmodx> public plugin_init() {     // ..     register_concmd("say","handle_say")     register_concmd("say_team","handle_say") } public handle_say(id) {     new message[264]     read_args(message,263)     remove_quotes(message)     if(containi(message,"changemap")!=-1) {         // ..         server_cmd("kick #%d ^"You said changemap!^"",get_user_userid(id))     }     return PLUGIN_HANDLED }


All times are GMT -4. The time now is 10:02.

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