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

ASW


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Fun Stuff       
Neverminddw
Junior Member
Join Date: Jul 2016
Location: Kosovo
Old 11-25-2016 , 15:36   ASW
Reply With Quote #1

Admin Spawn Weapons


Hello, this is my first plugin that I posted here in AlliedMods.
I'm a beginner on codding plugins. And this is a simple plugin that I made to post here .
I hope you like it . Thank you.

You can use this plugin on any mod you want.


PHP Code:
/*==================================================
 Plugin ~Admin Spawn Weapons~ Made by: Neverminddw
====================================================

========================================================================================           
||         //=\\               ========         \\                          //      ||
||        //   \\             //      \\         \\          //\\          //       ||
||       //     \\           //                   \\        //  \\        //        ||
||      //=======\\         //=========//          \\      //    \\      //         ||
||     //         \\                  //            \\    //      \\    //          ||
||    //           \\                //              \\  //        \\  //           ||
||   //             \\      \\======//                \\//          \\//            ||
=======================================================================================*/

#include <amxmodx>
#include <cstrike>
#include <fun>
#include <hamsandwich>

#define PLUGIN "Admin_Spawn_Weapons"
#define VERSION "1.0"
#define AUTHOR "Neverminddw"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""GiveWeapons"1);
}

public 
GiveWeapons(id)
{
    if (
get_user_flags(id) & ADMIN_KICK) {
        new 
CsTeams:userTeam cs_get_user_team(id)
        if (
userTeam == CS_TEAM_T) {
            
give_itemid"weapon_ak47" // Gives ak47
            
give_itemid"weapon_glock18" // Gives glock18
            
cs_set_user_bpammo(idCSW_AK47100// Sets ammount of ammo ( bullets )
            
cs_set_user_bpammo(idCSW_GLOCK18120// Sets ammount of ammo ( bullets )
            
colorchat(id"!y[!gASW!y]: !tYou got !gAK47 !t& !gGLOCK18!y!"// If player is T this message will be shown to them on chat box.
        
}
        else if(
userTeam == CS_TEAM_CT) {
            
give_item(id,"weapon_m4a1"// Gives m4a1
            
give_item(id,"weapon_usp"// Gives usp
            
cs_set_user_bpammo(idCSW_M4A190// Sets ammount of ammo ( bullets )
            
cs_set_user_bpammo(idCSW_USP100// Sets ammount of ammo ( bullets )
            
colorchat(id"!y[!gASW!y]: !tYou got !gM4A1 !t& !gUSP!y!"// If player is CT this message will be shown to them on chat box.
        
}
    }
}

stock colorchat( const id, const input[], any: ... )
{
    new 
count 1players[32], iplayer;
    static 
msg[191];
    if ( 
numargs() == )
        
copymsg190input );
    else
        
vformatmsg190input);
    
replace_allmsg190"!g""^4" );
    
replace_allmsg190"!y""^1" );
    
replace_allmsg190"!t""^3" );
    if ( 
id )
    {
        if ( !
is_user_connectedid ) ) return;
        
players[0] = id;
    } else 
get_playersplayerscount"ch" );
    for ( 
0counti++ )
    {
        
player players[i];
        
message_beginMSG_ONE_UNRELIABLEget_user_msgid"SayText" ), _player );
        
write_byteplayer );
        
write_stringmsg );
        
message_end();
    }

Attached Files
File Type: sma Get Plugin or Get Source (ASW.sma - 755 views - 3.0 KB)

Last edited by Neverminddw; 11-27-2016 at 13:07. Reason: Edited the plugin code to PHP
Neverminddw is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 11-25-2016 , 16:31   Re: ASW
Reply With Quote #2

Redundant
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-26-2016 , 14:50   Re: ASW
Reply With Quote #3

Quote:
You can use this plugin on any mod you want.
Even Deathrun?
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Neverminddw
Junior Member
Join Date: Jul 2016
Location: Kosovo
Old 11-26-2016 , 15:03   Re: ASW
Reply With Quote #4

Quote:
Originally Posted by OciXCrom View Post
Even Deathrun?
Yes, why not? If you think admins on deathrun can have free weapons on spawn, then you can use it on deathrun too.
Neverminddw is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 11-26-2016 , 15:39   Re: ASW
Reply With Quote #5

Quote:
Do not post plugins "just for the sake of it". eg. A fulfilled request may have been useful for one or a few people, but that does not necessarily mean that it has a place in the Approved section. Please take the time to expand your knowledge and produce some quality work.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 11-27-2016 , 06:59   Re: ASW
Reply With Quote #6

What about my version

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

new const PlayerEntityClass [] = "player";

new const 
Author  [] = "NeverThink";
new const 
Version [] = "1.0";
new const 
Plugin  [] = "ASW";      

enum _:ConsoleVariables
{
    
ctAmmo,
    
tAmmo,
    
ctBpAmmo,
    
tBpAmmo    
}

new 
CVSConsoleVariables ];

public 
plugin_init( )
{
    
register_plugin
    
(
        
Plugin,
        
Version,
        
Author
    
);

    
RegisterHamHam_Spawn PlayerEntityClass "FwdEntitySpawn");

    
CVSctAmmo ] = register_cvar"asw_ct_ammo" "30" );
    
CVStAmmo ] = register_cvar"asw_tero_ammo""30" );
    
CVSctBpAmmo ] = register_cvar"asw_ct_bpammo""90" );
    
CVStBpAmmo ] = register_cvar"asw_tero_bpammo""90" );
}

public 
FwdEntitySpawnid )
{
    if( 
is_user_aliveid ) )
    {
        if( 
get_user_flagsid ) & ADMIN_KICK )
        {
            new 
CsTeams:userTeam cs_get_user_teamid );
            new 
szWeaponName[20];

            switch( 
userTeam )
            {
                case 
CS_TEAM_Tgive_user_weaponidCSW_AK47get_pcvar_numCVS[tAmmo] ), get_pcvar_numCVS[tBpAmmo] ) , szWeaponNamecharsmaxszWeaponName ) );
                case 
CS_TEAM_CTgive_user_weaponidCSW_M4A1get_pcvar_numCVS[ctAmmo] ), get_pcvar_numCVS[ctBpAmmo] ) , szWeaponNamecharsmaxszWeaponName ) );
            }
    
            
client_printid print_chat"[ASW] Because you are 'admin' , you got the weapon '%s'."szWeaponName );
        }
    }
}

give_user_weaponindex iWeaponTypeID iClip=iBPAmmo=szWeapon[]="" maxchars=)
{
    if ( !( 
CSW_P228 <= iWeaponTypeID <= CSW_P90 ) || ( iClip ) || ( iBPAmmo ) || !is_user_aliveindex ) )
        return -
1;
    
    new 
szWeaponName20 ] , iWeaponEntity bool:bIsGrenade;
    
    const 
GrenadeBits = ( ( << CSW_HEGRENADE ) | ( << CSW_FLASHBANG ) | ( << CSW_SMOKEGRENADE ) | ( << CSW_C4 ) );
    
    if ( ( 
bIsGrenade bool:!!( GrenadeBits & ( << iWeaponTypeID ) ) ) )
        
iClip clampiClip iClip iBPAmmo );
    
    
get_weaponnameiWeaponTypeID szWeaponName charsmaxszWeaponName ) );
    
    if ( ( 
iWeaponEntity user_has_weaponindex iWeaponTypeID ) ? find_ent_by_owner( -szWeaponName index ) : give_itemindex szWeaponName ) ) > )
    {
        if ( 
iClip && !bIsGrenade )
            
cs_set_weapon_ammoiWeaponEntity iClip );

        if ( 
iWeaponTypeID == CSW_C4 
            
cs_set_user_plantindex );
        else
            
cs_set_user_bpammoindex iWeaponTypeID bIsGrenade iClip iBPAmmo ); 
            
        if ( 
maxchars )
            
copyszWeapon maxchars szWeaponName[7] );
    }
    return 
iWeaponEntity;

CVars list:
Code:
asw_ct_ammo "30"
asw_tero_ammo "30
asw_ct_bpammo "90"
asw_tero_bpammo "90"
__________________
Project: Among Us

Last edited by Craxor; 11-28-2016 at 10:56.
Craxor is offline
Send a message via ICQ to Craxor
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 11-27-2016 , 09:22   Re: ASW
Reply With Quote #7

Quote:
Originally Posted by Neverminddw View Post
Yes, why not? If you think admins on deathrun can have free weapons on spawn, then you can use it on deathrun too.
So, if I'm an admin in a Deathrun server, I can shoot through the glass and kill the terrorist immediately? Cool story bro.
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Neverminddw
Junior Member
Join Date: Jul 2016
Location: Kosovo
Old 11-27-2016 , 12:59   Re: ASW
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
So, if I'm an admin in a Deathrun server, I can shoot through the glass and kill the terrorist immediately? Cool story bro.
You can edit the plugin and set the ammount of bullets to T team, as much you want. Example 10 bullets ;).
Neverminddw is offline
Neverminddw
Junior Member
Join Date: Jul 2016
Location: Kosovo
Old 11-27-2016 , 13:01   Re: ASW
Reply With Quote #9

Quote:
Originally Posted by Craxor View Post
What about my version
Cool Hahahahaha this made me laught so hard "Unnaproved" xD

Last edited by Neverminddw; 11-27-2016 at 13:06.
Neverminddw is offline
Craxor
Veteran Member
Join Date: Jan 2016
Location: Romania
Old 11-27-2016 , 15:27   Re: ASW
Reply With Quote #10

Update, i added Cvars!
__________________
Project: Among Us
Craxor is offline
Send a message via ICQ to Craxor
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 04:08.


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