AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Making someone random VIP in any map. (https://forums.alliedmods.net/showthread.php?t=127017)

BloodMan 05-16-2010 04:33

Making someone random VIP in any map.
 
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])
    }
}


BloodMan 05-30-2010 08:03

Re: Making someone random VIP in any map.
 
bump


All times are GMT -4. The time now is 03:34.

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