Raised This Month: $ Target: $400
 0% 

Triggered by.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 22:04   Triggered by.
Reply With Quote #1

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.
h4ns is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-16-2005 , 22:11  
Reply With Quote #2

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*
__________________
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
h4ns
Member
Join Date: Mar 2005
Old 04-16-2005 , 22:57  
Reply With Quote #3

tnx
h4ns is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 04-17-2005 , 01:24  
Reply With Quote #4

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) {         // ..     }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 01:42  
Reply With Quote #5

LOL, wow.. I think I got a case of the stupidness this week! I keep overlooking the most simplest things.
__________________
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
h4ns
Member
Join Date: Mar 2005
Old 04-17-2005 , 08:22  
Reply With Quote #6

lol, no u rule at modding man. I wish I could do it as good as u
h4ns is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 08:25  
Reply With Quote #7

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.

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. ;)
__________________
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
h4ns
Member
Join Date: Mar 2005
Old 04-17-2005 , 13:00  
Reply With Quote #8

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
h4ns is offline
ZiP*
Senior Member
Join Date: Jul 2004
Old 04-17-2005 , 13:15  
Reply With Quote #9

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
ZiP* is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 13:19  
Reply With Quote #10

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
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 }
__________________
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
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 10:02.


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