Raised This Month: $ Target: $400
 0% 

Event dosent work properly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-05-2013 , 04:00   Re: Event dosent work properly
Reply With Quote #1

Test this
Code:
#include <amxmodx>
#include <cstrike>
#include <fun>   

#pragma semicolon 1  

new bonus;
const WINNING_TEAM_MENU_KEYS = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5;

public plugin_init()
{
    register_plugin("WinnerTeam_Gifts", "1.0", "M3taph0riK");

    register_menucmd(register_menuid("Echipa ta a castigat alege un cadou :"), WINNING_TEAM_MENU_KEYS, "Gifts"); 

    register_message(get_user_msgid("TextMsg"), "message_textmsg");

    bonus = register_cvar("bonus","1000");
} 

public message_textmsg()
{
	static string[32];
	get_msg_arg_string(2, string, charsmax(string));
	
	if(equal(string, "#Terrorists_Win"))
	{		
		for(new i = 1; i <= get_maxplayers(); i++)
		{	
			if(get_user_team(i) != 1)
				continue;
				
			GiftsMenu(i);
		}
	}
	else if(equal(string, "#CTs_Win"))
	{		
		for(new i = 1; i <= get_maxplayers(); i++)
		{
			if(get_user_team(i) != 2)
				continue;
				
			GiftsMenu(i);
		}
	}
}

public MomeyGift(id)
{  
    if (!is_user_alive(id))
    return;
 
    new money = cs_get_user_money(id);
    new got = get_pcvar_num(bonus);
    cs_set_user_money(id, money + got);
} 

public HpGift(id)
{
    if (!is_user_alive(id))
    return;

    set_user_health(id, 125);
} 

public ArmorGift(id)
{
    if (!is_user_alive(id))
    return;

    set_user_armor(id, 150);
} 

public FootStepsGift(id)
{
    if (!is_user_alive(id))
    return;

    set_user_footsteps(id, 1);
}

public GiftsMenu(id)
{	
    static const szMenu[] = "\rEchipa ta a castigat alege un cadou :^n^n\w1. \yExtra cash 1000$^n\w2. \yExtra life + 25 HP^n\w3. \yArmura cu 150 HP^n\w4. \ySilent FootSteps^n\w5. \yPachetul intreg de grenazi";
    show_menu(id, WINNING_TEAM_MENU_KEYS, szMenu);

    return PLUGIN_HANDLED;
}

public Gifts(id, key)
{
    switch( key )
    {
        case 0:
        {
            MomeyGift(id);
        }
        case 1:
        {
            HpGift(id);
        }
        case 2:
        {
            ArmorGift(id);
        } 
        case 3: 
        { 
            FootStepsGift(id); 
        } 
        case 4: 
        { 
            give_item(id,"weapon_hegrenade"); 
            give_item(id,"weapon_flashbang"); 
            give_item(id,"weapon_flashbang"); 
            give_item(id,"weapon_smokegrenade");
        }        
    }

    return PLUGIN_HANDLED;
}
TheDS1337 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 16:17.


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