Raised This Month: $ Target: $400
 0% 

[REQ] Hostage Killed


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
gui1porpis
Member
Join Date: Jan 2009
Location: Brodowski, SP, Brazil
Old 08-25-2012 , 18:27   [REQ] Hostage Killed
Reply With Quote #1

[en]
Hello Guys, I wonder if you or any scripter can make a plugin for me, the title suggests, most will specify a little better.

It is a plugin that when a CT or Terrorist kills a hostage, sends a print_chat, the color of the team that killed him.

Note: If the scripter has excited, add support for ML, cvars put up is for all to see or only administrators in FLAG "x", and cvars to disable / enable the plugin and the plugin pause on maps that do not have hostages.

[bp]
Olá Galera, gostaria de saber se tem ou se algum scripter possa fazer um plugin para eu, o titulo já diz, mais irei especificar um pouco melhor.

É um plugin que quando algum Terrorista ou CT mata um refem, envia um print_chat, na cor da equipe que matou.

Observação: Se o scripter tiver empolgado, adicionar suporte para ML, colocar cvars se é para todos verem ou só os administradores na FLAG "x", e com cvars para desativar/ativar o plugin e para o plugin pausar em mapas que não tem refens.
__________________

Last edited by gui1porpis; 08-25-2012 at 18:31. Reason: add language
gui1porpis is offline
Send a message via MSN to gui1porpis Send a message via Skype™ to gui1porpis
pacheco
Senior Member
Join Date: Jul 2011
Old 08-25-2012 , 20:28   Re: [REQ] Hostage Killed
Reply With Quote #2

Attached Files
File Type: txt hostage_killed.txt (121 Bytes, 131 views)
File Type: sma Get Plugin or Get Source (kill_hostage.sma - 590 views - 1.5 KB)
__________________




Last edited by pacheco; 08-25-2012 at 21:24.
pacheco is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-25-2012 , 20:58   Re: [REQ] Hostage Killed
Reply With Quote #3

colorchat stock doesn't support LANG_PLAYER, also your loop gonna throw errors on get_user_flags with not connected players, better to use get_players.

I would rather do it like this :

PHP Code:
#include <amxmodx>

#define ADMIN_FLAG    'x'

const FLAG_ADMIN_SEE_HOSTAGE_KILL 1<<(ADMIN_FLAG-'a')

new 
pcvargmsgSayText

public plugin_init()

    
register_plugin("Hostage Killed""1.0""GuiZ")
    
register_event("TextMsg","host_killed","b","2&#Killed_Hostage")
    
pcvar register_cvar("hostage_say""1"// 1- All, 2- Adm's

    
register_dictionary("hostage_killed.txt")
    
gmsgSayText get_user_msgid("SayText")


public 
host_killed(id)
{
    new 
cvar get_pcvar_num(pcvar)
    if( 
cvar )
    {
        new 
szName[32], szMessage[192]
        
get_user_name(idszNamecharsmax(szName))
        new 
players[32], numplr
        get_players
(playersnum"c")
        for(--
numnum>=0num--)
        {
            
plr players[num]
            if( 
plr != id )
            {
                if( 
cvar == || get_user_flags(plr) & FLAG_ADMIN_SEE_HOSTAGE_KILL )
                {
                    
formatex(szMessagecharsmax(szMessage), "^2%L"plr"HOSTAGE_KILL"szName)

                    
message_begin(MSG_ONE_UNRELIABLEgmsgSayText, .player=plr)
                    
write_byte(id// keep killer is as team color
                    
write_string(szMessage)
                    
message_end()
                }
            }
        }
    }

Code:
[en]
HOSTAGE_KILL = %s has killed one hostage!!

[bp]
HOSTAGE_KILL = %s matou um refem!!
__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 08-25-2012 at 21:24.
ConnorMcLeod is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 08-25-2012 , 21:23   Re: [REQ] Hostage Killed
Reply With Quote #4

Quote:
Originally Posted by ConnorMcLeod View Post
colorchat stock doesn't support LANG_PLAYER, also your loop gonna throw errors on get_user_flags with not connected players, better to use get_players.
But for me, works perfect. I tested before.
__________________




Last edited by pacheco; 08-25-2012 at 21:25.
pacheco is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 08-25-2012 , 21:26   Re: [REQ] Hostage Killed
Reply With Quote #5

Trust me, LANG_PLAYER can't work when you use vformat only once for all players.
Also, in a loop, don't use LANG_PLAYER, use player index instead.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
pacheco
Senior Member
Join Date: Jul 2011
Old 08-25-2012 , 21:27   Re: [REQ] Hostage Killed
Reply With Quote #6

Quote:
Originally Posted by ConnorMcLeod View Post
Trust me, LANG_PLAYER can't work when you use vformat only once for all players.
Also, in a loop, don't use LANG_PLAYER, use player index instead.
Ok Connor, thanks!
__________________



pacheco is offline
gui1porpis
Member
Join Date: Jan 2009
Location: Brodowski, SP, Brazil
Old 08-25-2012 , 23:35   Re: [REQ] Hostage Killed
Reply With Quote #7

Thank you all!
__________________
gui1porpis is offline
Send a message via MSN to gui1porpis Send a message via Skype™ to gui1porpis
gui1porpis
Member
Join Date: Jan 2009
Location: Brodowski, SP, Brazil
Old 08-29-2014 , 01:53   Re: [REQ] Hostage Killed
Reply With Quote #8

Hello, I am not getting this plugin works in new amxmodx already compiled files with the new amxmodx, but still will not, will any scripter know tell me if you have to rewrite the plugin or that I'm missing here?

Thank you!
__________________
gui1porpis is offline
Send a message via MSN to gui1porpis Send a message via Skype™ to gui1porpis
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 20:22.


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