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

I want two plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hadi1386
Junior Member
Join Date: Jun 2021
Old 06-27-2021 , 06:34   I want two plugins
Reply With Quote #1

Hello
I want two plugins, one of which is a free weapons menu that gives players AK, m4a1, awp, famas, galil weapons along with deagle, but awp is for admin, and the second plugin is special skins for AK, m4a1, have awp, knife, smoke, flash, hegrenade, deagle.
Thanks for your site
hadi1386 is offline
MacL
Member
Join Date: May 2021
Old 06-28-2021 , 04:23   Re: I want two plugins
Reply With Quote #2

Quote:
Originally Posted by hadi1386 View Post
Hello
I want two plugins, one of which is a free weapons menu that gives players AK, m4a1, awp, famas, galil weapons along with deagle, but awp is for admin, and the second plugin is special skins for AK, m4a1, have awp, knife, smoke, flash, hegrenade, deagle.
Thanks for your site
please explain more. How do you want the menu to open? To be displayed at the beginning of the round or with a special command? what do you mean by "Special skins" ? you mean you just want to change the weapons skins? if yes use this : https://forums.alliedmods.net/showthread.php?t=43979 if not, explain.
MacL is offline
hadi1386
Junior Member
Join Date: Jun 2021
Old 06-30-2021 , 09:27   Re: I want two plugins
Reply With Quote #3

Quote:
Originally Posted by MacL View Post
please explain more. How do you want the menu to open? To be displayed at the beginning of the round or with a special command? what do you mean by "Special skins" ? you mean you just want to change the weapons skins? if yes use this : https://forums.alliedmods.net/showthread.php?t=43979 if not, explain.
Hello
Thank you very much for the plugin you introduced.
But I prefer the weapons menu to open each step without a specific code first.
Thankful
hadi1386 is offline
MacL
Member
Join Date: May 2021
Old 06-30-2021 , 10:25   Re: I want two plugins
Reply With Quote #4

Quote:
Originally Posted by hadi1386 View Post
Hello
Thank you very much for the plugin you introduced.
But I prefer the weapons menu to open each step without a specific code first.
Thankful
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define MENU_FLAG ADMIN_KICK

#pragma semicolon 1

new countroundmenu_onround_numbuy_zoneHasC4[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
round_num register_cvar("menu_round_num""3");    
    
menu_on register_cvar("menu_on""1");    
    
buy_zone register_cvar("menu_buyzone""1");
    
    
register_logevent("logevent_round_start"2"1=Round_Start") ;
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w");
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
    
}

public 
Event_RoundRestart()
{
    
countround=0;
}

public 
logevent_round_start()
{
    
countround++;
    new 
players[32], numpid;
    
get_players(playersnum"ach");
    for(new 
i=0i<numi++)
    {
        
pid players[i];
        if(
countround == get_pcvar_num(round_num) && get_pcvar_num(menu_on) == 1)
        {
            
Mainmenu(pid);
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
Mainmenu(id)
{
    new 
szText[555 char];
    
formatex(szTextcharsmax(szText), "\yMenu");
    
    new 
menu menu_createszText"Menu_handler" );

    
formatexszTextcharsmaxszText ), "AK47 \y+ \wDeagle");
    
menu_additemmenuszText"1");
    
    
formatexszTextcharsmaxszText ), "M4A1 \y+ \wDeagle");
    
menu_additemmenuszText"2");

    
formatexszTextcharsmaxszText ), "%s"get_user_flags(id) & MENU_FLAG "AWP \y+ \wDeagle" "AWP \r[Admin]");
    
menu_additemmenuszText"3");     
    
    
formatexszTextcharsmaxszText ), "Famas \y+ \wDeagle");
    
menu_additemmenuszText"4");
    
    
formatexszTextcharsmaxszText ), "Galil \y+ \wDeagle");
    
menu_additemmenuszText"5");
      
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
menu_displayidmenu);

    return 
PLUGIN_CONTINUE;
}

public 
Menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64], accesscallback;
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), iNamecharsmax(iName), callback);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            if(
get_pcvar_num(buy_zone) == && !cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife"); 
            
cs_set_weapon_ammo(give_item(id"weapon_ak47"), 30);
            
cs_set_user_bpammo(idCSW_AK4790);
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }
        }
        case 
2:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {           
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_m4a1"), 30);
            
cs_set_user_bpammo(idCSW_M4A190);           
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }
        }
        case 
3:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else if(!(
get_user_flags(id) & MENU_FLAG))
            {
                
client_print(idprint_chat"Access Denied");
                return 
PLUGIN_HANDLED;
            }
            else
            {           
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_awp"), 10);
            
cs_set_user_bpammo(idCSW_AWP40);           
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }        
        }     
        case 
4:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {           
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM) ;           
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_famas"), 25);
            
cs_set_user_bpammo(idCSW_FAMAS90);          
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }        
        }
        case 
5:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {            
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_galil"), 30);
            
cs_set_user_bpammo(idCSW_GALIL90);           
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }        
        }   
    }
    return 
PLUGIN_HANDLED;

MacL is offline
hadi1386
Junior Member
Join Date: Jun 2021
Old 06-30-2021 , 11:04   Re: I want two plugins
Reply With Quote #5

Quote:
Originally Posted by MacL View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

#define MENU_FLAG ADMIN_KICK

#pragma semicolon 1

new countroundmenu_onround_numbuy_zoneHasC4[33];

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
round_num register_cvar("menu_round_num""3");    
    
menu_on register_cvar("menu_on""1");    
    
buy_zone register_cvar("menu_buyzone""1");
    
    
register_logevent("logevent_round_start"2"1=Round_Start") ;
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_w");
    
register_event("TextMsg","Event_RoundRestart","a","2&#Game_C");
    
}

public 
Event_RoundRestart()
{
    
countround=0;
}

public 
logevent_round_start()
{
    
countround++;
    new 
players[32], numpid;
    
get_players(playersnum"ach");
    for(new 
i=0i<numi++)
    {
        
pid players[i];
        if(
countround == get_pcvar_num(round_num) && get_pcvar_num(menu_on) == 1)
        {
            
Mainmenu(pid);
        }
    }
    return 
PLUGIN_HANDLED;
}

public 
Mainmenu(id)
{
    new 
szText[555 char];
    
formatex(szTextcharsmax(szText), "\yMenu");
    
    new 
menu menu_createszText"Menu_handler" );

    
formatexszTextcharsmaxszText ), "AK47 \y+ \wDeagle");
    
menu_additemmenuszText"1");
    
    
formatexszTextcharsmaxszText ), "M4A1 \y+ \wDeagle");
    
menu_additemmenuszText"2");

    
formatexszTextcharsmaxszText ), "%s"get_user_flags(id) & MENU_FLAG "AWP \y+ \wDeagle" "AWP \r[Admin]");
    
menu_additemmenuszText"3");     
    
    
formatexszTextcharsmaxszText ), "Famas \y+ \wDeagle");
    
menu_additemmenuszText"4");
    
    
formatexszTextcharsmaxszText ), "Galil \y+ \wDeagle");
    
menu_additemmenuszText"5");
      
    
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );
    
menu_displayidmenu);

    return 
PLUGIN_CONTINUE;
}

public 
Menu_handler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(id);
        return 
PLUGIN_HANDLED;
    }
    
    new 
data[6], iName[64], accesscallback;
    
menu_item_getinfo(menuitemaccessdatacharsmax(data), iNamecharsmax(iName), callback);
    new 
key str_to_num(data);
    
    switch(
key)
    {
        case 
1:
        {
            if(
get_pcvar_num(buy_zone) == && !cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife"); 
            
cs_set_weapon_ammo(give_item(id"weapon_ak47"), 30);
            
cs_set_user_bpammo(idCSW_AK4790);
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }
        }
        case 
2:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {           
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_m4a1"), 30);
            
cs_set_user_bpammo(idCSW_M4A190);           
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }
        }
        case 
3:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else if(!(
get_user_flags(id) & MENU_FLAG))
            {
                
client_print(idprint_chat"Access Denied");
                return 
PLUGIN_HANDLED;
            }
            else
            {           
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_awp"), 10);
            
cs_set_user_bpammo(idCSW_AWP40);           
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }        
        }     
        case 
4:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {           
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM) ;           
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_famas"), 25);
            
cs_set_user_bpammo(idCSW_FAMAS90);          
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }        
        }
        case 
5:
        {
            if(!
cs_get_user_buyzone(id))
            {
                return 
PLUGIN_HANDLED;
            }
            else
            {            
            if(
user_has_weapon(idCSW_C4) && get_user_team(id) == 1)
            
                    
HasC4[id] = true;
            else
                    
HasC4[id] = false;
            
strip_user_weapons(id);
            
cs_set_user_armor(id100CS_ARMOR_VESTHELM);
            
give_item(id"item_assaultsuit");
            
give_item(id"weapon_knife");    
            
cs_set_weapon_ammo(give_item(id"weapon_galil"), 30);
            
cs_set_user_bpammo(idCSW_GALIL90);           
            if (
HasC4[id])
            {
                
give_item(id"weapon_c4");
                
cs_set_user_plant(id);
            }
            if(
get_user_team(id) == 2)
            {
                
cs_set_user_defuse(id);
            }
            }        
        }   
    }
    return 
PLUGIN_HANDLED;

Thank you
But I save the file, but when I compile it gives an error. Can you send the plugin as amxx ?
hadi1386 is offline
MacL
Member
Join Date: May 2021
Old 06-30-2021 , 11:20   Re: I want two plugins
Reply With Quote #6

What errors? post them please.
amxx online compiler:
Spoiler

Last edited by MacL; 06-30-2021 at 11:23.
MacL is offline
hadi1386
Junior Member
Join Date: Jun 2021
Old 06-30-2021 , 12:52   Re: I want two plugins
Reply With Quote #7

Quote:
Originally Posted by MacL View Post
What errors? post them please.
amxx online compiler:
Spoiler
I posted an error photo
hadi1386 is offline
MacL
Member
Join Date: May 2021
Old 06-30-2021 , 13:22   Re: I want two plugins
Reply With Quote #8

Quote:
Originally Posted by hadi1386 View Post
I posted an error photo
Compiles fine for me. here the file:
Attached Files
File Type: sma Get Plugin or Get Source (Untitled.sma - 101 views - 7.4 KB)
MacL is offline
+ARUKARI-
AlliedModders Donor
Join Date: Jul 2004
Location: Japan
Old 06-30-2021 , 20:07   Re: I want two plugins
Reply With Quote #9

Code:
fatal error 101: cannot write to file:
To access "Program Files", you need administrator privileges.
Try to run compile.exe as administrator.
__________________
GitHub
SteamWishlist

六四天安門事件
+ARUKARI- 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:45.


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