Raised This Month: $ Target: $400
 0% 

Making someone random VIP in any map.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
BloodMan
Senior Member
Join Date: Apr 2008
Location: Lithuania
Old 05-16-2010 , 04:33   Making someone random VIP in any map.
Reply With Quote #1

Hi there, I need a plugin which when CT, CT only writes /vip, makes random CT VIP, but its model is not default VIP model, but custom...

So basically CT writes /vip, a random CT becomes VIP with custom model and when terrorist kill him or he dies "by suicide", terrorist wins the round.

This plugin should work in any map.

Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <cstrike>

#define PLUGIN "Vip  mode"
#define VERSION "1.0"
#define AUTHOR "aaarnas"

new g_vip_id

public plugin_init() {
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_clcmd("say /vip", "start_vip")
    register_event("DeathMsg", "EventDeath", "a")
}

public start_vip(id) {
    
    if(get_user_team(id) != 2) {
        client_print(id, print_chat, "Si funkcija tik CT komandai!")
        return PLUGIN_HANDLED
    }
    new players[32], num, id
    get_players(players, num, "ae", "CT")
    if(num < 2) {
        client_print(id, print_chat, "Per mazai zaideju!")
        return PLUGIN_HANDLED
    }
    
    g_vip_id = players[random(num)]
    
    cs_set_user_vip(g_vip_id, 1, 1, 1)
    
    new name[64]
    get_user_name(g_vip_id, name, 63)
    
    for(id = 1; id <= num ; id++)
        client_print(players[id], print_center, "Zaidejas %s tapo VIP. Apginkite ji!", name)
    
    return PLUGIN_HANDLED
}

public EventDeath() {
    
    new victim = read_data(2)
    if(victim == g_vip_id) {
        cs_set_user_vip(g_vip_id, 0, 0, 0)
        g_vip_id = 0
        new players[32], num, id
        get_players(players, num, "ae", "CT")
        for(id = 1; id <= num ; id++)
            user_silentkill(players[id])
    }
}
__________________

Last edited by BloodMan; 05-30-2010 at 08:07.
BloodMan is offline
Send a message via Skype™ to BloodMan
 



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:34.


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