Raised This Month: $ Target: $400
 0% 

Radio commands (events)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-17-2005 , 22:55   Radio commands (events)
Reply With Quote #1

Pretty self-explanitory if you look at my comment.
Code:
#include <amxmodx> public plugin_init() {     register_event("TextMsg", "catch_radio", "be", "2&#Game_radio", "4&#Fire_in_the_hole")     register_event("TextMsg", "catch_radio", "be", "2&#Game_radio", "4&#Cover_me") } public catch_radio(id) {     // How the hell would I tell which is which radio command     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
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-17-2005 , 23:50  
Reply With Quote #2

um, pass in a parameter...
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-17-2005 , 23:58   Re: Radio commands (events)
Reply With Quote #3

Code:
#include <amxmodx> public plugin_init() {     register_event("TextMsg", "catch_fire_hole", "be", "2&#Game_radio", "4&#Fire_in_the_hole")     register_event("TextMsg", "catch_cover_me", "be", "2&#Game_radio", "4&#Cover_me") } public catch_fire_hole(id) {     // blah blah blah     return PLUGIN_CONTINUE  //    <--------------------  :D } public catch_cover_me(id) {     // blah blah blah     return PLUGIN_CONTINUE  //    <--------------------  :D }


xeroblood is offline
Send a message via MSN to xeroblood
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-18-2005 , 00:00  
Reply With Quote #4

that will work too lol
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
n0obie4life
Veteran Member
Join Date: Dec 2004
Old 04-18-2005 , 06:16  
Reply With Quote #5

is it possible to do 2 register_events ?
n0obie4life is offline
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-18-2005 , 07:05  
Reply With Quote #6

i've done up too 3.. i don't think there is a limit
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-19-2005 , 11:17  
Reply With Quote #7

Aww, I really didn't want to do a function for each event!

Oh well..

[EDIT]
I forgot to mention that twisted mentioned something about read_data(), can I somehow do it with that?
__________________
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
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-19-2005 , 11:41  
Reply With Quote #8

Well, you could try.. Just print out the values to the console to see what they are, maybe you will find something you could work with..

The TextMsg event has the following signature:
Code:
TextMsg  	
ID = 78
SIZE =  -1
BYTE : destination
STRING : message
STRING : param1 (opt)
STRING : param2 (opt)
STRING : param3 (opt)
STRING : param4 (opt)
xeroblood is offline
Send a message via MSN to xeroblood
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 04-19-2005 , 11:48  
Reply With Quote #9

Code:
message_begin(MSG_ONE,get_user_msgid("TextMsg"),{0,0,0},id) write_byte( x ) // BYTE : destination write_string( x ) // STRING : message message_end()

Like that, but what would x be?
__________________
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
xeroblood
BANNED
Join Date: Mar 2004
Location: Toronto, Canada
Old 04-19-2005 , 12:15   Re: Radio commands (events)
Reply With Quote #10

Well, I meant something like:

Code:
#include <amxmodx> public plugin_init() {     register_event("TextMsg", "catch_radio", "be", "2&#Game_radio", "4&#Fire_in_the_hole")     register_event("TextMsg", "catch_radio", "be", "2&#Game_radio", "4&#Cover_me") } public catch_radio(id) {     new iByte         iByte = read_data( 1 )         new szMessage[64]         read_data( 2, szMessage, 63 )         new szParam1[32]         read_data( 3, szParam1, 31 )         // etc...         console_print( 0, "TextMsg Event Data: Byte=%d, Msg=%s, P1=%s", iByte, szMessage, szParam1 )     return PLUGIN_HANDLED }

So that you can see what the values are, and then decide if you can use them to differentiate between the event..
xeroblood is offline
Send a message via MSN to xeroblood
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 09:57.


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