Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <amxmodx>
- #include <cstrike>
- #include <fakemeta>
- #include <fakemeta_util>
- #include <hamsandwich>
- #define PLUGIN "FURIEN EVENT - Last player"
- #define VERSION "1.0"
- #define AUTHOR "DaNNe."
- new FURIENS, ANTIFURIENS;
- public plugin_init() {
- register_plugin(PLUGIN, VERSION, AUTHOR)
- register_event("DeathMsg", "EVENT_Death", "a")
- register_event("HLTV", "NEW_ROUND", "a", "1=0", "2=0")
- RegisterHam(Ham_Spawn, "player", "SPAWN", 1)
- }
- public client_disconnect(id) {
- switch(get_user_team(id)) {
- case 1: FURIENS--
- case 2: ANTIFURIENS--
- }
- if(FURIENS == 1 && ANTIFURIENS == 1)
- set_task(0.2, "TASK_CHECK")
- }
- public SPAWN(id) {
- if(is_user_connected(id) && is_user_alive(id)) {
- switch(get_user_team(id)) {
- case 1: FURIENS++
- case 2: ANTIFURIENS++
- }
- }
- }
- public NEW_ROUND() {
- FURIENS = 0
- ANTIFURIENS = 0
- }
- public EVENT_Death() {
- new Attacker = read_data(1),
- Victim = read_data(2)
- if(is_user_connected(Attacker) && is_user_connected(Victim)) {
- switch(get_user_team(Victim)) {
- case 1: FURIENS--
- case 2: ANTIFURIENS--
- }
- if(FURIENS == 1 && ANTIFURIENS == 1)
- set_task(0.2, "TASK_CHECK")
- }
- }
- public TASK_CHECK() {
- new FURIEN = GETPLAYERS(1),
- ANTIFURIEN = GETPLAYERS(2),
- FurienName[32], FurienNameLen = charsmax(FurienName),
- AntiFurienName[32], AntiFurienNameLen = charsmax(AntiFurienName)
- if(is_user_alive(FURIEN) && is_user_alive(ANTIFURIEN)) {
- get_user_name(FURIEN, FurienName, FurienNameLen)
- get_user_name(ANTIFURIEN, AntiFurienName, AntiFurienNameLen)
- ColorChat(0, "!g[FURIEN EVENT]!n JUCATORUL!t %s!n este ultimul!t FURIEN!n ramas in viata (BONUS:!t +$3000!n).", FurienName)
- ColorChat(0, "!g[FURIEN EVENT]!n JUCATORUL!t %s!n este ultimul!t ANTI-FURIEN!n ramas in viata (BONUS:!t +$3000!n).", AntiFurienName)
- ColorChat(0, "!g[FURIEN EVENT]!t %s!n vs.!t %s!n. Oare cine va castiga?!", FurienName, AntiFurienName)
- cs_set_user_money(FURIEN, cs_get_user_money(FURIEN) + 3000)
- cs_set_user_money(ANTIFURIEN, cs_get_user_money(ANTIFURIEN) + 3000)
- }
- }
- stock GETPLAYERS(TEAM) {
- new Players[32], Num, id, PlayerID;
- get_players(Players, Num, "ach")
- for(new i = 0; i < Num; i++) {
- PlayerID = Players[i]
- if(is_user_alive(PlayerID)) {
- if(get_user_team(PlayerID) == TEAM)
- id = PlayerID;
- }
- }
- return id
- }
- stock ColorChat(const id, const input[], any:...) {
- new count = 1, players[32];
- static msg[191];
- vformat(msg, 190, input, 3);
- replace_all(msg, 190, "!g", "^4");
- replace_all(msg, 190, "!n", "^1");
- replace_all(msg, 190, "!t", "^3");
- if(id) players[0] = id;
- else get_players(players, count, "c");
- for(new i = 0; i < count; i++) {
- if(is_user_connected(players[i])) {
- message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
- write_byte(players[i]);
- write_string(msg);
- message_end();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement