Raised This Month: $32 Target: $400
 8% 

amx_knife.! [Request]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 07-05-2012 , 18:45   amx_knife.! [Request]
Reply With Quote #1

Hello there

I want a simple plugin when I write

HTML Code:
amx_knife <Killer> <Killed Player>
It will slay the killed player and it will show in the Killing place (TOP RIGHT)

HTML Code:
<Killer> (Knife sprite) <Killed Player>
I hope my request is clear.

Thanx in advance!

Last edited by Moody92; 07-05-2012 at 18:45.
Moody92 is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-06-2012 , 10:12   Re: amx_knife.! [Request]
Reply With Quote #2

Untested:
EDIT: Tested and optimized:
Code:
#include <amxmodx> #include <amxmisc> #include <messages> #include <fun> #define PLUGIN "knife message slay?!" #define VERSION "1.0" #define AUTHOR "Khalid" #define FLAG ADMIN_SLAY new gMessageID public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     register_concmd("amx_knife", "knife_player", FLAG) } public knife_player(id, level, cid) {     if(!cmd_access(id, level, cid, 3))         return PLUGIN_HANDLED         new iKillerID, iVictimID, Arg1[10], Arg2[10]//, szKillerName[32], szVictimName[32]     new szknife[7] = " knife"   // I tested it later, it appeared to show the knife as 'nife'         read_argv(1, Arg1, 9)     read_argv(2, Arg2, 9)         iKillerID = cmd_target(id, Arg1, 1)     iVictimID = cmd_target(id, Arg2, 1)         if (!iKillerID || !iVictimID)     {         console_print(id, "Sorry, one of the players could not be found or targetted!")         return PLUGIN_HANDLED     }          //get_user_name(iKillerID, szKillerName, 31)     //get_user_name(iVictimID, szKillerName, 31)         user_silentkill(iVictimID)     gMessageID = get_user_msgid("DeathMsg")         message_begin(MSG_ALL, gMessageID, {0,0,0},0)     write_byte(iKillerID)     write_byte(iVictimID)     write_string(szknife)     write_byte(0)     message_end()         return PLUGIN_HANDLED }
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 07-06-2012 at 10:28.
pokemonmaster is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 07-06-2012 , 10:18   Re: amx_knife.! [Request]
Reply With Quote #3

You also could add,

PHP Code:
    if (!iKillerID || !iVictimID)
    {
        
console_print(id"Sorry, one of the players could not be found or targetted!")
        return 
PLUGIN_HANDLED
    

__________________
PM for help = ignore
guipatinador is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 07-06-2012 , 10:29   Re: amx_knife.! [Request]
Reply With Quote #4

Quote:
Originally Posted by guipatinador View Post
You also could add,

PHP Code:
    if (!iKillerID || !iVictimID)
    {
        
console_print(id"Sorry, one of the players could not be found or targetted!")
        return 
PLUGIN_HANDLED
    

I've thought of that too, ADDED!
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster 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:15.


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