Raised This Month: $ Target: $400
 0% 

Making TK plugin, got stuck.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
allenwr
Veteran Member
Join Date: Jan 2006
Location: The place where the karm
Old 08-31-2008 , 18:57   Making TK plugin, got stuck.
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <dodx>

#define PLUGIN "TKC"
#define VERSION "0.1"
#define AUTHOR "Joker"

#define TKCKeys (1<<0)|(1<<1)

new g_params[32][2]

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_menucmd(register_menuid("TKC Menu"),TKCKeys,"TKCMenuSelect")
}

public 
client_death(killervictimwpnindexhitplaceTK) {
    if(!
TK || (killer == victim))
        return 
PLUGIN_HANDLED;
    
    
g_params[victim][0] = killer
    g_params
[victim][1] = victim
    
    TKCMenu
(victim,g_params)
    return 
PLUGIN_CONTINUE
}

public 
TKCMenu(victim,g_params[][]) {
    new 
KillerName[32],MenuMessage[64]
    
get_user_name(g_params[victim][0],KillerName,31)    
    
    
format(MenuMessage,63,"'%s' TK'd you:^n^n1. Forgive^n2. Slay",KillerName)
    
show_menu(g_params[victim][1],TKCKeys,MenuMessage,-1,"TKC Menu")
}

public 
TKCMenuSelect(victimg_params[][], key) {
    switch(
key) {
        case 
0: {
            
client_print(victim,print_chat,"forgiven")
            return 
PLUGIN_CONTINUE
        
}
        case 
1: {
            
user_kill(g_params[victim][1], 1)
            
client_print(victim,print_chat,"killed")
        }
    }
    return 
PLUGIN_HANDLED

As I am relearning I got stuck between TKCMenu and TKCMenuSelect, I do not know how to transfer the player ids over.
__________________
Don't ever place an order with Vee Servers. This is why.
allenwr is offline
Send a message via ICQ to allenwr Send a message via Yahoo to allenwr
 


Thread Tools
Display Modes

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 03:13.


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