Raised This Month: $51 Target: $400
 12% 

M3 and deagle


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
brutalsurf
Junior Member
Join Date: Mar 2015
Old 03-07-2015 , 14:49   M3 and deagle
Reply With Quote #1

Does anyone know a plugin that only lets the player use M3 and DEAGLE? If you have .sma even better
brutalsurf is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-07-2015 , 15:08   Re: M3 and deagle
Reply With Quote #2

You can restrict all weapons, then give them a M3 and Deagle when they spawn.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
brutalsurf
Junior Member
Join Date: Mar 2015
Old 03-07-2015 , 15:17   Re: M3 and deagle
Reply With Quote #3

this is not possible, it will be for surf_ski_2 map
brutalsurf is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-07-2015 , 15:19   Re: M3 and deagle
Reply With Quote #4

What's not possible? Because I don't play on surf servers.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 03-07-2015 , 15:22   Re: M3 and deagle
Reply With Quote #5

I don't have time right now, but maybe this ideea can help someone else to do it: hook any buy attemp(Connor created a tut for that) and allow only for m3 and deagle. Also, hook touch on armoury_entities(in case we have such ents in the map) and block it, or even better, remove all armoury_entities that are not from m3 and deagle(can check my FAQ about armoury_entities).
__________________
HamletEagle is online now
wickedd
Veteran Member
Join Date: Nov 2009
Old 03-07-2015 , 15:25   Re: M3 and deagle
Reply With Quote #6

@Hamlet

That's another way of doing it also, but I think the OP should give us more details. Because he may not need a plugin at all for this.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 03-07-2015 , 16:16   Re: M3 and deagle
Reply With Quote #7

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

#define is_user_valid_connected(%1)        (1 <= %1 <= get_maxplayers() && is_user_connected(%1))

new gBuyCommands[][] = 

{
     
"awp""sg550""g3sg1""p228""xm1014""mac10""aug""elites""ump45""sg550""galil""famas"
     
"usp""glock""mp5""m4a1""m249""tmp""sg552""ak47""p90""fn57""scout"
}

public 
plugin_init() 
{
    for (new 
0sizeof (gBuyCommands); i++)
    
register_clcmd(gBuyCommands[i],"HandleCmd")
    
RegisterHam(Ham_Touch"weaponbox""fw_TouchWeapon");
    
RegisterHam(Ham_Touch"armoury_entity""fw_TouchWeapon");
}

public 
HandleCmd(id
{
    
ChatColor(id"!g[AMXX] !teamYou only can buy M3 and Deagle")
    return 
PLUGIN_HANDLED 
}

stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!team""^3"// Team Color
    
replace_all(msg190"!team2""^0"// Team2 Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }
}

public 
fw_TouchWeapon(weaponid)
{
    if (!
is_user_valid_connected(id))
        return 
HAM_IGNORED;
    
    static 
szClassname[32]
    
entity_get_string(weaponEV_SZ_classnameszClassnamecharsmax(szClassname))
    
    if(
equal(szClassname"armoury_entity") && cs_get_armoury_type(weapon) != CSW_M3 && cs_get_armoury_type(weapon) != CSW_DEAGLE)
    return 
HAM_SUPERCEDE

    
    
return HAM_IGNORED


Last edited by sirerick; 03-07-2015 at 23:24. Reason: end
sirerick is offline
brutalsurf
Junior Member
Join Date: Mar 2015
Old 03-07-2015 , 20:13   Re: M3 and deagle
Reply With Quote #8

Quote:
Originally Posted by sirerick View Post
try this

PHP Code:
#include <amxmodx>

new gBuyCommands[][] = 

{
     
"awp""sg550""g3sg1""p228""xm1014""mac10""aug""elites""ump45""sg550""galil""famas"
     
"usp""glock""mp5""m4a1""m249""tmp""sg552""ak47""p90""fn57""scout"
}

public 
plugin_init() 
{
    for (new 
0sizeof (gBuyCommands); i++)
    
register_clcmd(gBuyCommands[i],"HandleCmd")
}

public 
HandleCmd(id
{
    
ChatColor(id"!g[AMXX] !teamYou only can buy M3 and Deagle")
    return 
PLUGIN_HANDLED 
}

stock ChatColor(const id, const input[], any:...)
{
    new 
count 1players[32]
    static 
msg[191]
    
vformat(msg190input3)
    
    
replace_all(msg190"!g""^4"// Green Color
    
replace_all(msg190"!y""^1"// Default Color
    
replace_all(msg190"!team""^3"// Team Color
    
replace_all(msg190"!team2""^0"// Team2 Color
    
    
if (idplayers[0] = id; else get_players(playerscount"ch")
    {
        for (new 
0counti++)
        {
            if (
is_user_connected(players[i]))
            {
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i])
                
write_byte(players[i]);
                
write_string(msg);
                
message_end();
            }
        }
    }

thanks for trying to help, but I need it can not take up arms in hand. In propio map has these weapons, then as soon as he gets on the map drop the weapons. Someone help?
brutalsurf is offline
sirerick
Senior Member
Join Date: Jul 2012
Location: Venezuela
Old 03-07-2015 , 22:56   Re: M3 and deagle
Reply With Quote #9

try now i edit the code.

Last edited by sirerick; 03-07-2015 at 23:24.
sirerick is offline
brutalsurf
Junior Member
Join Date: Mar 2015
Old 03-08-2015 , 11:53   Re: M3 and deagle
Reply With Quote #10

It does not work. What did happen was that I can not pick up any map of the weapon, but all weapons normally buy. I need just do not take the weapons in the game, plus HE take. On the map is HE, and also will not start (only have to pick up). Could redo the code?

Last edited by brutalsurf; 03-08-2015 at 11:53. Reason: .
brutalsurf 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 13:00.


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