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

[CS:GO] GunMenu with save selected for next spawn


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 04-25-2018 , 04:46   [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #1

Hey

Can someone link me a gun menu plugin what includes save selected weapons for the next spawn?

Thanks in advance

Have a nice day!!
__________________
ateszhun95 is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 04-25-2018 , 05:11   Re: [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #2

Have a look at DeathMatch (FFA) plugins, I've seen some servers with exactly what you're looking for.
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
ateszhun95
Senior Member
Join Date: Apr 2014
Location: Hungary
Old 04-25-2018 , 05:34   Re: [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #3

Quote:
Originally Posted by OSWO View Post
Have a look at DeathMatch (FFA) plugins, I've seen some servers with exactly what you're looking for.
Exactly im looking for a stand alone plugin because im running surf rpg server with autrespawn and a deathmatch plugin makes many bugs :/
__________________
ateszhun95 is offline
rogeraabbccdd
Veteran Member
Join Date: Jun 2015
Location: de_dust2
Old 04-28-2018 , 05:09   Re: [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #4

Can player select their weapon when first spawn?
__________________

Please keep in mind, nobody have responsibility to help you, especially who don't try to Google first.
I only read messages in Chinese and English.

GitHub | Discord:Kento#2118
rogeraabbccdd is offline
PinHeaDi
Senior Member
Join Date: Jul 2013
Location: Bulgaria
Old 04-28-2018 , 06:04   Re: [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #5

PHP Code:
#include <sourcemod>
#include <cstrike>
#include <smlib>
#include <multicolors>

#pragma semicolon 1
#pragma newdecls required

char PrimaryWeapon[MAXPLAYERS 1][24];
char SecondaryWeapon[MAXPLAYERS 1][24];

bool PrimarySelected[MAXPLAYERS+1];
bool SecondarySelected[MAXPLAYERS+1];
bool Remember[MAXPLAYERS+1];

public 
void OnPluginStart()
{
    
HookEvent("player_spawn"PlayerSpawnEventHookMode_Post);
    
RegConsoleCmd("sm_gunsmenu"GunsMenu);
    
RegConsoleCmd("sm_guns"GunsMenu);
}

public 
void OnClientPutInServer(int client)
{
    
ResetClientSettings(client);
}

void ResetClientSettings(int client)
{
    
PrimarySelected[client] = false;
    
SecondarySelected[client] = false;
    
Remember[client] = false;

    
PrimaryWeapon[client] = "weapon_m4a1";
    
SecondaryWeapon[client] = "weapon_glock";
}

public 
Action GunsMenu(int clientint args)
{
    if(!
IsPlayerAlive(client))
    {
        return 
Plugin_Handled;
    }

    if(
Remember[client])
    {
        
Remember[client] = false;
        
CPrintToChat(client"[{lightred}Server{default}] You reactivated your weapon menu..");
        
PrimarySelected[client] = true;
        
SecondarySelected[client] = true;
        return 
Plugin_Handled;
    }

    if(!
PrimarySelected[client] && !SecondarySelected[client])
    {
        
Weapons(client);
    }
    else
    {
        
CPrintToChat(client"[{lightred}Server{default}] You've already choosen your weapons.");
        return 
Plugin_Handled;
    }

    return 
Plugin_Continue;
}

public 
Action PlayerSpawn(Handle event, const char[] namebool dontBroadcast)
{
    
int client GetClientOfUserId(GetEventInt(event"userid"));
    
Client_RemoveAllWeapons(client"weapon_knife"true); 
    
PrimarySelected[client] = false;
    
SecondarySelected[client] = false;

    if(
Remember[client])
    {
        
GiveLastWeapons(client);
    }
    else
    {
        
Weapons(client);
    }
        
    
CPrintToChat(client"[{lightred}Server{default}] You can use {green}!guns{default} to choose your weapons.");
    
SetEntProp(clientProp_Send"m_ArmorValue"100);
    
SetEntProp(clientProp_Send"m_bHasHelmet"1);
}


//======================== [Weapons Menu] ======================//
public void Weapons(int client)
{
    
Menu menu = new Menu(Weapon_Menu);

    
menu.SetTitle("[Server] Guns Menu");
    
menu.AddItem("new""New Weapons");
    
menu.AddItem("old""Old weapons.");
    
menu.AddItem("olddontask""Old weapons. [Don't ask me again]");

    
menu.ExitButton false;
    
menu.Display(client15);
}

public 
int Weapon_Menu(Menu menuMenuAction actionint clientint param2)
{
    switch(
action)
    {
        case 
MenuAction_Select:
        {
            
char info[32];
            
menu.GetItem(param2infosizeof(info));

            if (
StrEqual(info"new"))
            {
                
SelectPrimaryWeapon(client);
                
Remember[client] = false;  
            }
            else if (
StrEqual(info"old"))
            {
                
GiveLastWeapons(client);
                
Remember[client] = false;  
            }
            else if (
StrEqual(info"olddontask"))
            {
                
CPrintToChat(client"[{lightred}Server{default}] You can reactivate your weapons menu with {green}!guns{default}.");
                
GiveLastWeapons(client);
                
Remember[client] = true;
            }
        }

        case 
MenuAction_End:{delete menu;}
    }

    return 
0;
}

//======================== [Primary Weapons Menu] ======================//
public void SelectPrimaryWeapon(int client)
{
    
Menu menu = new Menu(PrimaryWeapon_Menu);

    
menu.SetTitle("Server JailBreak Guns - Primary");
    
menu.AddItem("ak""AK-47");
    
menu.AddItem("mka""M4A4");
    
menu.AddItem("zagmka""M4A1-S");
    
menu.AddItem("awp""AWP");
    
menu.AddItem("sig553""Sig 553");
    
menu.AddItem("aug""Aug");
    
menu.AddItem("famas""Famas");
    
menu.AddItem("galil""Galil AR");
    
menu.AddItem("scout""Scout");
    
menu.AddItem("negev""Negev");
    
menu.AddItem("mac10""Mac-10");
    
menu.AddItem("pro90""P90");
    
menu.AddItem("nova""Nova");
    
menu.AddItem("xm1014""XM1014");
    
menu.AddItem("mag7""MAG-7");

    
menu.ExitButton false;
    
menu.Display(client15);
}

public 
int PrimaryWeapon_Menu(Menu menuMenuAction actionint clientint param2)
{
    switch(
action)
    {
        case 
MenuAction_Select:
        {
            
char info[32];
            
menu.GetItem(param2infosizeof(info));

            if (
StrEqual(info"ak"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_ak47");
                
PrimaryWeapon[client] = "weapon_ak47";
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"mka"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_m4a1");
                
PrimaryWeapon[client] = "weapon_m4a1";
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"zagmka"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_m4a1_silencer");
                
PrimaryWeapon[client] = "weapon_m4a1_silencer"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"sig553"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_sg556"); 
                
PrimaryWeapon[client] = "weapon_sg556"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"aug"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_aug"); 
                
PrimaryWeapon[client] = "weapon_aug"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"famas"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_famas");
                
PrimaryWeapon[client] = "weapon_famas"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"galil"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_galilar");
                
PrimaryWeapon[client] = "weapon_galilar"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"negev"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_negev");
                
PrimaryWeapon[client] = "weapon_negev"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"mac10"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_mac10"); 
                
PrimaryWeapon[client] = "weapon_mac10"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"pro90"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_p90"); 
                
PrimaryWeapon[client] = "weapon_p90"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"nova"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_nova"); 
                
PrimaryWeapon[client] = "weapon_nova"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"xm1014"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_xm1014"); 
                
PrimaryWeapon[client] = "weapon_xm1014"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"mag7"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_mag7"); 
                
PrimaryWeapon[client] = "weapon_mag7"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"awp"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_awp"); 
                
PrimaryWeapon[client] = "weapon_awp"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
            else if (
StrEqual(info"scout"))
            {
                
PrimarySelected[client] = true;
                
GivePlayerItem(client"weapon_ssg08"); 
                
PrimaryWeapon[client] = "weapon_ssg08"
                if(!
SecondarySelected[client])
                {
                    
SelectSecondaryWeapon(client);
                }
            }
        }

        case 
MenuAction_End:{delete menu;}
    }

    return 
0;
}
//======================== [Secondary Weapons Menu] ======================//

public void SelectSecondaryWeapon(int client)
{
    
Menu menu = new Menu(SecondaryWeapon_Menu);

    
menu.SetTitle("Server JailBreak Guns - Secondary");
    
menu.AddItem("glock""Glock-18");
    
menu.AddItem("usps""USP-S");
    
menu.AddItem("usp""P2000");
    
menu.AddItem("p250""P250");
    
menu.AddItem("deagle""Desert Eagle");
    
menu.AddItem("revol""R8 Revolver");
    
menu.AddItem("f7""Five-SeveN");
    
menu.AddItem("dualbar""Dual Berettas");
    
menu.AddItem("tec9""Tec-9");
    
menu.AddItem("czauto""CZ75-Auto");

    
menu.ExitButton false;
    
menu.Display(client15);
}

public 
int SecondaryWeapon_Menu(Menu menuMenuAction actionint clientint param2)
{
    switch(
action)
    {
        case 
MenuAction_Select:
        {
            
char info[32];
            
menu.GetItem(param2infosizeof(info));

            if (
StrEqual(info"glock"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_glock"); 
                
SecondaryWeapon[client] = "weapon_glock";
            }
            else if (
StrEqual(info"usps"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_usp_silencer"); 
                
SecondaryWeapon[client] = "weapon_usp_silencer";
            }
            else if (
StrEqual(info"usp"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_hkp2000"); 
                
SecondaryWeapon[client] = "weapon_hkp2000";
            }
            else if (
StrEqual(info"p250"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_p250"); 
                
SecondaryWeapon[client] = "weapon_p250";
            }
            else if (
StrEqual(info"p250"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_p250"); 
                
SecondaryWeapon[client] = "weapon_p250";
            }
            else if (
StrEqual(info"deagle"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_deagle"); 
                
SecondaryWeapon[client] = "weapon_deagle";
            }
            else if (
StrEqual(info"revol"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_revolver"); 
                
SecondaryWeapon[client] = "weapon_revolver";
            }
            else if (
StrEqual(info"f7"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_fiveseven"); 
                
SecondaryWeapon[client] = "weapon_fiveseven";
            }
            else if (
StrEqual(info"dualbar"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_elite"); 
                
SecondaryWeapon[client] = "weapon_elite";
            }
            else if (
StrEqual(info"tec9"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_tec9"); 
                
SecondaryWeapon[client] = "weapon_tec9";
            }
            else if (
StrEqual(info"czauto"))
            {
                
SecondarySelected[client] = true;
                
GivePlayerItem(client"weapon_cz75a"); 
                
SecondaryWeapon[client] = "weapon_cz75a";
            }
        }

        case 
MenuAction_End:{delete menu;}
    }

    return 
0;
}
//=======================================/

void GiveLastWeapons(int client)
{
    
GivePlayerItem(clientPrimaryWeapon[client]);
    
GivePlayerItem(clientSecondaryWeapon[client]);
    
PrimarySelected[client] = true;
    
SecondarySelected[client] = true;

__________________
PinHeaDi is offline
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 04-28-2018 , 10:47   Re: [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #6

In case if you looking for zombie reloaded (ofc you can edit it to not be for zombie reloaded only)
https://forums.alliedmods.net/showthread.php?p=2358999
iGANGNAM is offline
OSWO
Senior Member
Join Date: Jul 2015
Location: United Kingdom, London
Old 04-29-2018 , 08:54   Re: [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #7

https://github.com/HardcorePark/CTGu...ting/CTGuns.sp
__________________
SourceTimer | WeaponSkins++ | BasePlugins++ https://github.com/OSCAR-WOS
OSWO is offline
Franc1sco
Veteran Member
Join Date: Oct 2010
Location: Spain (Madrid)
Old 04-29-2018 , 12:33   Re: [CS:GO] GunMenu with save selected for next spawn
Reply With Quote #8

Quote:
Originally Posted by iGANGNAM View Post
In case if you looking for zombie reloaded (ofc you can edit it to not be for zombie reloaded only)
https://forums.alliedmods.net/showthread.php?p=2358999
Yes
__________________
Veteran Coder -> Activity channel
Coding on CS2 and taking paid and free jobs.

Contact: Steam, Telegram or discord ( franug ).

You like my work? +Rep in my steam profile comments or donate.

Franc1sco is offline
Send a message via MSN to Franc1sco
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 11:38.


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