AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Variables "You got killed by %killer% (https://forums.alliedmods.net/showthread.php?t=13961)

Bento 06-04-2005 18:24

Variables "You got killed by %killer%
 
How do i do this..

I got:

Code:
public client_death(killer,victim,wpnindex,hitplace,TK) {     client_cmd(victim,"mp3 play sound/misc/kenny1.mp3")     client_print(victim, print_chat, "You got killed by:")     return PLUGIN_CONTINUE }

Now i want the server says to the killed person: You got killed by %killer%

Where %killer% is the player who killed the other 1.

Ninja_Munkey 06-04-2005 18:30

Code:

public client_death(killer,victim,wpnindex,hitplace,TK) {
    client_cmd(victim,"mp3 play sound/misc/kenny1.mp3")
    client_print(victim, print_chat, "You got killed by:" & killer)
    return PLUGIN_CONTINUE
}

Wouldn't it be something to this affect?

Bento 06-04-2005 18:33

I doubt if that will work...

faluco 06-04-2005 18:40

Code:
new killer_name[32] get_user_name(killer, killer_name, 31) client_print(victim, print_chat, "You got killed by %s",killer_name)

Bento 06-04-2005 18:44

Tank you very much :D It worx :D

Bento 06-04-2005 18:58

1 more little thing :oops: :P

How do u do this:

U got killed by %killer% in your %hitplace% with a %weapon%

faluco 06-04-2005 19:06

jejeje, try this:the get weapon is for cs, if its other mod tell me because its different

at the top add this include <csx>

also need to add this
Code:
new body_part[8][] = {"Whole Body","Head","Chest","Stomach","Left Arm","Right Arm","Left Leg","Right Leg"}

and then add this as before
Code:
new killer_name[32], weapon_name[32] get_user_name(killer, killer_name, 31); xmod_get_wpnname(wpnindex, weapon_name, 31); client_print(victim,print_chat,"u got killed by %s with the %s and he hitted you in %s",killer_name,weapon_name,body_part[hitplace])

also you need to active the csx module[/small]

Bento 06-04-2005 19:10

U are great!!!! TNX very much :D

faluco 06-04-2005 19:19

if you like the info you can get the distance also, and if it was a TK make a different message.
One thing, if he killed you with a grenade it will tell you "you were killed with its primary weapon" so you would need a bit more of code

jejeje but to be perfect you need the thing of the grenade fix, look:
Code:
if (wpnindex == CSW_HEGRENADE)                       client_print(victim,print_chat, "u where killed by %s with a grenade he hitted you in %s", killer_name,body_part[hitplace])         else             client_print(victim,print_chat, "u where killed by %s with the %s he hitted you in %s", killer_name,weapon_name,body_part[hitplace])
and if you want also you where killed by bla bla with the m4a1 from a distance of 5 meters and hitted you in head tell

Bento 06-04-2005 19:25

worked gr8 :P

If u have cz, try it out @ 80.61.6.39:27015


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

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