AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   green chat message (https://forums.alliedmods.net/showthread.php?t=45548)

ch3cker 10-05-2006 12:32

green chat message
 
hi guys
i have a script in it it show a message
Code:

client_print(id, print_chat, "Schreibe /myhits um deine Angreifer und Treffer zu sehen!")
Now i want to that this message will be shown in green. This message is shown to a player who is killed.
Now how is it possible to make this?
I found this
Code:

public plugin_init() {   
register_clcmd("say","hook_say") }

public hook_say(id) {   
message_begin(MSG_ONE, get_user_msgid("SayText"), {0,0,0}, id)    write_byte(id)
write_string("^x03Team colored text ^x01Normal color")
message_end()       
return PLUGIN_HANDLED
}

But I dont know how to change this to print this colored message (if its possible in green) to this one killed player.

Please help me

Silencer123 10-05-2006 12:52

Re: green chat message
 
Your posted Code already prints Message to only one Player. (Use ^x04 for green. (CS ONLY))
So you just have to get the ID of the dead Player. Use:
Code:
#include <amxmodx> public plugin_init() {     register_event("DeathMsg","hook_death","a","1>0")     // "a" means "Global Event", "1>0" means Killer must not be "worldspawn" (Drowning, Falling, etc.) } public hook_death() {     new killer_id=read_data(1)     new victim_id=read_data(2)     // Your Message Stuff }

ch3cker 10-07-2006 17:36

Re: green chat message
 
jeah thx
now it works

Silencer123 10-07-2006 18:19

Re: green chat message
 
No problem ;)


All times are GMT -4. The time now is 04:45.

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