Raised This Month: $32 Target: $400
 8% 

Solved Work only in buyzone (or buy menu)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-11-2020 , 14:20   Work only in buyzone (or buy menu)
Reply With Quote #1

Hello. I want this plugin work only in buy zone. And Work every 3 Round.
PHP Code:
#pragma semicolon 1
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>


// Define the Plugin Version
new const VERSION[] = { "1.0" };

// PREFIX
new const PREFIX[] = { "!g[!tWG!g]!n" };

new 
VipUsed[33];

public 
plugin_init()
{
    
register_plugin("Random Weapon"VERSION"");
    
    
register_clcmd("say /free""cmdspw");
}

public 
cmdspw(id)
{
    new 
menu menu_create("\wFreeGuns""cmdspw_handler");
    
    
menu_additem(menu"\rRandom Weapon \y+ \rRendom Pistol \y+ \rRandom Grenade \r[\y800$\r]""1"cs_get_user_money(id) >= 800 1<<31);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}

public 
cmdspw_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
cs_set_user_money(idcs_get_user_money(id) - 800);
            
cmdspwr(id);
            
client_cmd(id"spk buttons/blip1.wav");
            
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
cmdspwr(id)
{
    new 
truenumber random_num(16);
    if (
truenumber == 1)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_deagle"), 2);
        
cs_set_user_bpammo(idCSW_DEAGLE0);
    }
    if (
truenumber == 2)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_aug"), 2);
        
cs_set_user_bpammo(idCSW_AUG0);
    }
    if (
truenumber == 3)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_elite"), 2);
        
cs_set_user_bpammo(idCSW_ELITE0);
    }
    if (
truenumber == 4)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_p90"), 2);
        
cs_set_user_bpammo(idCSW_P900);
    }
    if (
truenumber == 5)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_mp5navy"), 2);
        
cs_set_user_bpammo(idCSW_MP5NAVY0);
    }
    if (
truenumber == 6)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_mac10"), 2);
        
cs_set_user_bpammo(idCSW_MAC100);
    }
    if (
truenumber == 7)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_usp"), 2);
        
cs_set_user_bpammo(idCSW_USP0);
    }
    if (
truenumber == 8)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_glock18"), 2);
        
cs_set_user_bpammo(idCSW_GLOCK180);
    }

Thanks

Last edited by ho83; 12-04-2020 at 17:18.
ho83 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-11-2020 , 14:33   Re: Work only in buyzone (or buy menu)
Reply With Quote #2

PHP Code:
public cmdspw(id)
{
    if(!
cs_get_user_buyzone(id))
        return 
PLUGIN_HANDLED

        
new menu menu_create("\wFreeGuns""cmdspw_handler");
    
        
menu_additem(menu"\rRandom Weapon \y+ \rRendom Pistol \y+ \rRandom Grenade \r[\y800$\r]""1"cs_get_user_money(id) >= 800 1<<31);
    
        
menu_setprop(menuMPROP_EXITMEXIT_ALL);
        
menu_display(idmenu0);
        return 
PLUGIN_HANDLED

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-11-2020 , 15:28   Re: Work only in buyzone (or buy menu)
Reply With Quote #3

My Dear @iceeedr. First i have to say thanks for youre help. If you see my previous requests you understand Nobody helped me. Except you and one other person. Only in 2 Reguests People helped me here and ...
i solved lot of my problem by my self.
I have another request dear. Can You Make This plugin work every 3 round? Thanks.

Last edited by ho83; 11-11-2020 at 15:44.
ho83 is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 11-11-2020 , 16:27   Re: Work only in buyzone (or buy menu)
Reply With Quote #4

Thanks for the words, but you have to understand that this forum is free, usually already existing demands (that you can use the search and find previously made) or very large demands, are ignored by users, because in addition to "working" for free , we have social life outside the forum.

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>


// Define the Plugin Version
new const VERSION[] = { "1.0" };

// PREFIX
new const PREFIX[] = { "!g[!tWG!g]!n" };

new 
VipUsed[33], Rounds 

public plugin_init()
{
    
register_plugin("Random Weapon"VERSION"");
    
    
register_event("HLTV","EventNewRnd""a""1=0""2=0")
    
register_event("TextMsg""fwEvGameWillRestartIn""a""2=#Game_will_restart_in"

    
register_clcmd("say /free""cmdspw");
}

public 
fwEvGameWillRestartIn()
{
    
Rounds 0
}
public 
EventNewRnd()
{
    
Rounds++
}

public 
cmdspw(id)
{
    if(!
cs_get_user_buyzone(id))
            return 
PLUGIN_HANDLED 

    
if(Rounds == 0)
    {
            new 
menu menu_create("\wFreeGuns""cmdspw_handler");
        
            
menu_additem(menu"\rRandom Weapon \y+ \rRendom Pistol \y+ \rRandom Grenade \r[\y800$\r]""1"cs_get_user_money(id) >= 800 1<<31);
        
            
menu_setprop(menuMPROP_EXITMEXIT_ALL);
            
menu_display(idmenu0);
            return 
PLUGIN_HANDLED 
    
}
    return 
PLUGIN_HANDLED 
}

public 
cmdspw_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            
cs_set_user_money(idcs_get_user_money(id) - 800);
            
cmdspwr(id);
            
client_cmd(id"spk buttons/blip1.wav");
            
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;
}

public 
cmdspwr(id)
{
    new 
truenumber random_num(16);
    if (
truenumber == 1)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_deagle"), 2);
        
cs_set_user_bpammo(idCSW_DEAGLE0);
    }
    if (
truenumber == 2)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_aug"), 2);
        
cs_set_user_bpammo(idCSW_AUG0);
    }
    if (
truenumber == 3)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_elite"), 2);
        
cs_set_user_bpammo(idCSW_ELITE0);
    }
    if (
truenumber == 4)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_p90"), 2);
        
cs_set_user_bpammo(idCSW_P900);
    }
    if (
truenumber == 5)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_mp5navy"), 2);
        
cs_set_user_bpammo(idCSW_MP5NAVY0);
    }
    if (
truenumber == 6)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_mac10"), 2);
        
cs_set_user_bpammo(idCSW_MAC100);
    }
    if (
truenumber == 7)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_usp"), 2);
        
cs_set_user_bpammo(idCSW_USP0);
    }
    if (
truenumber == 8)
    {
        
cs_set_weapon_ammo(give_item(id"weapon_glock18"), 2);
        
cs_set_user_bpammo(idCSW_GLOCK180);
    }

__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
ho83
Senior Member
Join Date: Aug 2020
Location: iran
Old 11-11-2020 , 17:18   Re: Work only in buyzone (or buy menu)
Reply With Quote #5

Thanks My Dear. I totally agree with you. From now on, I will be careful.
ho83 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 19:17.


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