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

Give weapon


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-26-2008 , 21:32   Give weapon
Reply With Quote #1

I was wondering if i have someones plugin like this plugin by emp how would i give someone who types /aspec a scout and a usp then when he gets out of it or anything it will be dropped?

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fun>

#define MAX_PLAYERS     32

new g_Spec[MAX_PLAYERS+1];

#define SPECIAL_PRECACHE "models/player/vip/vip.mdl"
#define SPECIAL_SHORT "vip"
#define ADMIN_FLAG ADMIN_KICK
#define ALPHA_RENDER 127

public plugin_init() 
{
    
register_plugin("Advanced Spectate""1.1""Emp`");
    
register_clcmd("say""say_event");
    
register_clcmd("say_team","say_event");
    
register_event("ResetHUD""ResetHUD""be");
    
register_forward(FM_StartFrame"fm_startframe");
}


reset_player_model(id)
    if(
is_user_alive(id))
        if(
g_Spec[id])
            
cs_set_user_model(idSPECIAL_SHORT);
        else
            
cs_reset_user_model(id);

public 
plugin_precache()
    
precache_model(SPECIAL_PRECACHE);

public 
say_event(id
{
    new 
said[10];
    
read_args(said,9);
    
remove_quotes(said);

    if( 
equali(said"/spec",5) || equali(said"/aspec",6) )
        if( !( 
get_user_flags(id) & ADMIN_FLAG ) )
            
client_print(idprint_chat"You do not have access to go Advanced Spectate.");
        else if( 
g_Spec[id] ){
            
client_print(idprint_chat"You have returned to a normal team.");
            if(
is_user_alive(id)){
                
reset_player_model(id);
                if(
g_Spec[id]==1)
                    
cs_set_user_team(idCS_TEAM_T);
                else
                    
cs_set_user_team(idCS_TEAM_CT);
                
unspec_stuff(id);
                
_SetPlayerSolid(id);
                
_set_rendering(id);
            }
            
g_Spec[id] = 0;
        }
        else{
            
g_Spec[id] = Team(id);
            
spec_stuff(id);
            
cs_set_user_team(idCS_TEAM_SPECTATOR);
            
reset_player_model(id);
            
client_print(idprint_chat"You have gone Advanced Spectate.");
        }
}
public 
spec_stuff(id)
{
    if(
g_Spec[id] > 0){
        if(
is_user_alive(id)){
{
            
give_item(player,"weapon_scout");
            new 
weapon_id find_ent_by_owner(-1"weapon_scout"player);
            
cs_set_weapon_ammo(weapon_id10)
}
            
set_user_godmode(id1);
            
set_user_hitzones(id01);
            
set_user_hitzones(0id1);
            
_SetPlayerNotSolid(id);
            
_set_rendering(idkRenderFxDistort000kRenderTransAddALPHA_RENDER);
        }
        
set_task(5.0"spec_stuff"id);
    }
    else
        
_set_rendering(id);
}

unspec_stuff(id)
{
    
set_user_godmode(id0);
    
set_user_hitzones(id0255);
    
set_user_hitzones(0id255);
}

public 
ResetHUD(id
    
set_task(0.75"delayedSpawn"id);

public 
delayedSpawn(id)
{
    if(
g_Spec[id]>0){
        
client_print(idprint_chat"You have been taken out of spec mode.");
        
g_Spec[id] = 0;
        
unspec_stuff(id);
    }
    
reset_player_model(id);
}

public 
client_putinserver(id)
    
g_Spec[id] = 0;


stock Team(id)
{
    if(!
is_user_connected(id))
        return 
0;

    return 
_:cs_get_user_team(id);
}
 
/* Sets indexes of players.
 * Flags:
 * "a" - don't collect dead players.
 * "b" - don't collect alive players.
 * "c" - skip bots.
 * "d" - skip real players.
 * "e" - match with team number.
 * "f" - match with part of name.   //not used - leaving blank to match AMXX's get_players
 * "g" - ignore case sensitivity.   //not used - leaving blank to match AMXX's get_players
 * "h" - skip HLTV.
 * "i" - not equal to team number.
 * Example: Get all alive on team 2: poke_get_players(players,num,"ae",2) */
stock poke_get_players(players[MAX_PLAYERS], &pnum, const flags[]=""team=-1)
{
    new 
total 0bitwise read_flags(flags);
    for(new 
i=1i<=MAX_PLAYERSi++)
    {
        if(
is_user_connected(i))
        {
            if( 
is_user_alive(i) ? (bitwise 2) : (bitwise 1))
                continue;
            if( 
is_user_bot(i) ? (bitwise 4) : (bitwise 8))
                continue;
            if( (
bitwise 16) && team!=-&& Team(i)!=team)
                continue;
            
// & 32
            // & 64
            
if( (bitwise 128) && is_user_hltv(i))
                continue;
            if( (
bitwise 256) && team!=-&& Team(i)==team)
                continue;
            
players[total] = i;
            
total++;
        }
    }
    
pnum total;

    return 
true;
}

_SetPlayerSolid(id)
    if(
is_user_alive(id))
        
set_pev(idpev_solidSOLID_BBOX);

_SetPlayerNotSolid(id)
    if(
is_user_alive(id))
        
set_pev(idpev_solidSOLID_NOT);

// Taken from csdm_protection.sma by BAILOPAN.
stock _set_rendering(indexfx=kRenderFxNoner=255g=255b=255render=kRenderNormalamount=16)
{
    
set_pev(indexpev_renderfxfx);
    new 
Float:RenderColor[3];
    
RenderColor[0] = float(r);
    
RenderColor[1] = float(g);
    
RenderColor[2] = float(b);
    
set_pev(indexpev_rendercolorRenderColor);
    
set_pev(indexpev_rendermoderender);
    
set_pev(indexpev_renderamtfloat(amount));

    return 
1;
}

public 
fm_startframe()
{
    static 
solid_plays[32];
    static 
players[32], numijplayerperson;
    static 
Float:player_origin[3], Float:person_origin[3], Float:player_heightFloat:person_height;
    
poke_get_players(playersnum"ah");

    for(
0numi++)
        
solid_playsplayers[i] ] = 1;
    for(
0numi++)
    {
        
player players[i];

        if(
g_Spec[player] < 1)
            continue;

        
pev(playerpev_originplayer_origin);

        
player_height player_origin[2];
        
player_origin[2] = 0.0;

        for(
0numj++)
        {
            
person players[j];

            if(
player == person)
                continue;

            
pev(personpev_originperson_origin);
            
person_height person_origin[2];
            
person_origin[2] = 0.0;

            if(    
vector_distance(player_originperson_origin) < 90
            
&&    floatabs(player_height person_height) < 110 )
            {
                
solid_plays[player] = 0;
                
solid_plays[person] = 0;
            }
        }
    }
    for(
0numi++)
    {
        
player players[i];
        if( 
solid_playsplayer ] )
            
_SetPlayerSolid(player);
        else
            
_SetPlayerNotSolid(player);
    }
    return 
FMRES_IGNORED;

jageassyrian is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 01-27-2008 , 00:42   Re: Give weapon
Reply With Quote #2

in plugin init add this line :
Code:
register_clcmd("say /aspec","cmd_say_aspec",-1);
After, where you want in plugin add this:
Code:
public  cmd_say_aspec(id)
{
   fm_strip_user_weapons(id);
   fm_give_item(id,"weapon_shield");
   fm_give_item(id,"weapon_usp");
}

And and include add
Code:
#include <fakemeta_util>
If you don't have fakemeta_util file, download from Tutorials Section
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-27-2008 , 02:02   Re: Give weapon
Reply With Quote #3

Oh btw that works and how would i make it it say it in color? and when you returned if you were a t you would be given a flash and a smoke?

Last edited by jageassyrian; 01-27-2008 at 02:32.
jageassyrian is offline
SAMURAI16
BANNED
Join Date: Sep 2006
Old 01-27-2008 , 07:55   Re: Give weapon
Reply With Quote #4

try to fix your english before. I'm know, I'm also bad on english but from you I can't understand so much
SAMURAI16 is offline
Send a message via MSN to SAMURAI16
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-27-2008 , 16:06   Re: Give weapon
Reply With Quote #5

How would i make it say it in team color?
jageassyrian is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-27-2008 , 22:38   Re: Give weapon
Reply With Quote #6

He wants to know how to make the text show up colored and when the player returns from the advanced spec mode, give him a smoke and a flashbang...
__________________
Hunter-Digital is offline
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-28-2008 , 23:29   Re: Give weapon
Reply With Quote #7

and also when a non admin types /aspec he still recieves weapons
jageassyrian is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 01-29-2008 , 08:00   Re: Give weapon
Reply With Quote #8

For that just set the ADMIN_FLAG define to ADMIN_USER
__________________
Hunter-Digital is offline
jageassyrian
Senior Member
Join Date: Jul 2007
Old 01-29-2008 , 20:49   Re: Give weapon
Reply With Quote #9

where do i add them
jageassyrian is offline
[kirk]./musick`
Senior Member
Join Date: Jun 2007
Location: Tampa, Florida
Old 01-29-2008 , 21:50   Re: Give weapon
Reply With Quote #10

PHP Code:
#define ADMIN_FLAG ADMIN_KICK 
to:

PHP Code:
#define ADMIN_FLAG ADMIN_USER 
__________________
[kirk]./musick` is offline
Send a message via AIM to [kirk]./musick`
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 00:21.


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