Raised This Month: $ Target: $400
 0% 

Event dosent work properly


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-05-2013 , 04:26   Re: Event dosent work properly
Reply With Quote #8

Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>   

#pragma semicolon 1  

new bonus;

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

    register_menu("Gifts Menu", 1023, "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)			
				GiftsMenu(i);
		}
	}
	else if(equal(string, "#CTs_Win"))
	{		
		for(new i = 1; i <= get_maxplayers(); i++)
		{
			if(get_user_team(i) == 2)			
				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, 1023, szMenu, -1, "Gifts Menu");    
	
    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
 



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