Raised This Month: $ Target: $400
 0% 

Event dosent work properly


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 06-04-2013 , 16:01   Event dosent work properly
Reply With Quote #1

i quit this plugin

Last edited by At3u; 06-07-2013 at 03:35.
At3u is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-04-2013 , 16:20   Re: Event dosent work properly
Reply With Quote #2

Try use TextMsg event
TheDS1337 is offline
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 06-04-2013 , 17:04   Re: Event dosent work properly
Reply With Quote #3

Yeah..but why team events dosent work in my plugin ?
At3u is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-04-2013 , 17:08   Re: Event dosent work properly
Reply With Quote #4

Quote:
Originally Posted by At3u View Post
Yeah..but why team events dosent work in my plugin ?
use register_logevent with Terrorist_Win ( i saw it in amxmodx.inc ) check it
TheDS1337 is offline
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 06-04-2013 , 17:52   Re: Event dosent work properly
Reply With Quote #5

Might be the problem that both events are using the same public ?

Edit: if i use 1 event plugin works just fine..if i use both events menu is showed no matters who win

Last edited by At3u; 06-04-2013 at 18:14.
At3u is offline
TheDS1337
Veteran Member
Join Date: Jun 2012
Old 06-05-2013 , 04:00   Re: Event dosent work properly
Reply With Quote #6

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
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 06-05-2013 , 04:18   Re: Event dosent work properly
Reply With Quote #7

Dosent work ! If a team wins Gifts menu dosent appear...

Last edited by At3u; 06-05-2013 at 04:18.
At3u is offline
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
At3u
Member
Join Date: Feb 2013
Location: On the Moon
Old 06-05-2013 , 04:35   Re: Event dosent work properly
Reply With Quote #9

Including amxmisc dosent change anything.....plugin still not works

Last edited by At3u; 06-05-2013 at 04:36.
At3u is offline
Reply


Thread Tools
Display Modes

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