Hi New here
Hi New here
Hi . I am wondering if it is possible to make gunmenu on server side?
very cool site.
D
very cool site.
D
- L'In20Cible
- Project Leader
- Posts: 1536
- Joined: Sat Jul 14, 2012 9:29 pm
- Location: Québec
Re: Hi New here
Welcome to the forums!
What kind of gunmenu?
What kind of gunmenu?
Re: Hi New here
Thankyou! I am looking for Gunmenu for Css. I want to be able to chose a primary list and a Secondary list.
Id also like to be able to spawn with equipment. I use a plug that does all this but the problem is when you pick up ak and your spawn is set for M4a1
the ak is stripped at next round.I want to be able to keep weapons you pick up.
D
Id also like to be able to spawn with equipment. I use a plug that does all this but the problem is when you pick up ak and your spawn is set for M4a1
the ak is stripped at next round.I want to be able to keep weapons you pick up.
D
Re: Hi New here
Yes, this is all certainly possible. Are you wanting someone to create this for you or are you looking for assistance in learning to create this yourself?
Re: Hi New here
I am looking for someone to make one for me..thanks
D
This is server side also
D
This is server side also
Re: Hi New here
Something like this?
Syntax: Select all
# ==============================================================================
# >> IMPORTS
# ==============================================================================
from players.entity import Player
from players.dictionary import PlayerDictionary
from menus import PagedMenu
from menus import PagedOption
from commands.say import SayCommand
from events import Event
# ==============================================================================
# >> CONSTANTS/CONFIG
# ==============================================================================
# <display name>: <classname>
PRIMARY_WEAPONS = [
('Maverick M4A1 Carbine', 'weapon_m4a1'),
('AK47', 'weapon_ak47'),
('Schmidt Scout', 'weapon_scout'),
('Krieg 552', 'weapon_sg552'),
('IDF Defender', 'weapon_galil'),
('FAMAS', 'weapon_famas'),
('Bullpup', 'weapon_aug'),
('M249-SAW', 'weapon_m249'),
('KM UMP45', 'weapon_ump45'),
('MP5 Navy', 'weapon_mp5navy'),
('Leone 12 Gauge Super', 'weapon_m3'),
('Leone YG1265 Auto Shotgun', 'weapon_xm1014'),
('Schmidt Machine Pistol', 'weapon_tmp'),
('Ingram Mac-10', 'weapon_mac10'),
('ES C90', 'weapon_p90')
]
SECONDARY_WEAPONS = [
('USP Tactical', 'weapon_usp'),
('Glock', 'weapon_glock'),
('Desert Eagle', 'weapon_deagle'),
('P228', 'weapon_p228'),
('Dual 96G Elite Berettas', 'weapon_elite'),
('ES Five Seven', 'weapon_fiveseven'),
]
# Commands that open the weapon menu
WEAPON_COMMANDS = [
'!weapons',
'!guns',
]
# Health amount to give (0 to use default from game/other plugin)
HEALTH = 0
# Armor amount to give
ARMOR = 100
# Whether to give a helmet. If you want to disable armor, you must
# set this to "False" as well as setting armor to 0.
HELMET = True
# Whether to give flashbangs
FLASHBANGS = True
# Whether to give a smoke grenade
SMOKEGRENADE = False
# Whether to give an HE grenade
HEGRENADE = True
# Whether to give defusekits to CTs
DEFUSE_KITS = True
# ==============================================================================
# >> GLOBAL VARIABLES
# ==============================================================================
primary_menu = PagedMenu(
list(PagedOption(x, y) for x, y in PRIMARY_WEAPONS),
title='Choose a primary weapon'
)
secondary_menu = PagedMenu(
list(PagedOption(x, y) for x, y in SECONDARY_WEAPONS),
title='Choose a secondary weapon'
)
# ==============================================================================
# >> CLASSES
# ==============================================================================
class PlayerWeapons(object):
def __init__(self, index):
self.player = Player(index)
self.primary = None
self.secondary = None
player_weapons = PlayerDictionary(PlayerWeapons)
# ==============================================================================
# >> CALLBACKS
# ==============================================================================
@primary_menu.register_select_callback
def on_primary_menu_select(menu, index, option):
weapons = player_weapons[index]
player = weapons.player
for weapon in player.weapons(is_filters='primary'):
weapon.remove()
weapons.primary = option.value
player.give_named_item(option.value)
@secondary_menu.register_select_callback
def on_secondary_menu_select(menu, index, option):
weapons = player_weapons[index]
player = weapons.player
for weapon in player.weapons(is_filters='secondary'):
weapon.remove()
weapons.secondary = option.value
player.give_named_item(option.value)
# ==============================================================================
# >> COMMANDS
# ==============================================================================
@SayCommand(WEAPON_COMMANDS)
def on_weapons(command, index, team_only):
primary_menu.send(index)
secondary_menu.send(index)
# ==============================================================================
# >> EVENTS
# ==============================================================================
@Event('player_spawn')
def on_player_spawn(event):
weapons = player_weapons.from_userid(event['userid'])
player = weapons.player
if HEALTH != 0:
player.health += HEALTH
player.armor = ARMOR
if HELMET:
player.has_helmet = HELMET
if FLASHBANGS:
if player.get_projectile_ammo('flashbang') == 0:
player.give_named_item('weapon_flashbang')
player.set_projectile_ammo('flashbang', 2)
if SMOKEGRENADE and player.get_projectile_ammo('smokegrenade') == 0:
player.give_named_item('weapon_smokegrenade')
if HEGRENADE and player.get_projectile_ammo('hegrenade') == 0:
player.give_named_item('weapon_hegrenade')
if DEFUSE_KITS:
player.has_defuser = True
if weapons.primary is not None and player.primary is None:
player.give_named_item(weapons.primary)
if weapons.secondary is not None and player.secondary is None:
player.give_named_item(weapons.secondary)
Re: Hi New here
what you have looks great. Id like to have menu of all weapons. Almost like a gun game menu.
Here is menu I am using at this time however it takes guns away from you on new spawn.I want to be able to keep weapon you pick up.
It also has spawn items.
Thanks.
"Gun Menu Config"
{
"Settings"
{
// Sound to play when player scores
"frag_sound" "buttons/bell1.wav"
// Allow players to have C4 bomb
"allow_c4" "yes"
// Allow buy zones on map
"buy_zones" "yes"
// Allow players to keep weapons
"keep_weapons" "yes"
}
"SpawnItems"
{
// Health amount to give (0 to use default from game/other plugin)
"health" "0"
// Armor amount to give
"armor" "100"
// Whether to give a helmet. If you want to disable armor, you must
// set this to "no" as well as setting armor to 0.
"helmet" "yes"
// Whether to give flashbangs
"flashbangs" "yes"
// Whether to give a smoke grenade
"smokegrenade" "no"
// Whether to give an HE grenade
"hegrenade" "yes"
// Whether to give defusekits to CTs
"defusekits" "yes"
}
"PrimaryMenu"
{
"weapon_m4a1" "Maverick M4A1 Carbine"
"weapon_ak47" "AK47"
"weapon_scout" "Schmidt Scout "
"weapon_sg552" "Krieg 552"
"weapon_galil" "IDF Defender"
"weapon_famas" "FAMAS"
"weapon_aug" "Bullpup"
"weapon_m249" "M249-SAW"
"weapon_ump45" "KM UMP45"
"weapon_mp5navy" "MP5 Navy"
"weapon_m3" "Leone 12 Gauge Super"
"weapon_xm1014" "Leone YG1265 Auto Shotgun"
"weapon_tmp" "Schmidt Machine Pistol"
"weapon_mac10" "Ingram Mac-10"
"weapon_p90" "ES C90"
}
"SecondaryMenu"
{
"weapon_usp" "USP Tactical"
"weapon_glock" "Glock"
"weapon_deagle" "Desert Eagle"
"weapon_p228" "P228"
"weapon_elite" "Dual 96G Elite Berettas"
"weapon_fiveseven" "ES Five Seven"
}
}
Here is menu I am using at this time however it takes guns away from you on new spawn.I want to be able to keep weapon you pick up.
It also has spawn items.
Thanks.
"Gun Menu Config"
{
"Settings"
{
// Sound to play when player scores
"frag_sound" "buttons/bell1.wav"
// Allow players to have C4 bomb
"allow_c4" "yes"
// Allow buy zones on map
"buy_zones" "yes"
// Allow players to keep weapons
"keep_weapons" "yes"
}
"SpawnItems"
{
// Health amount to give (0 to use default from game/other plugin)
"health" "0"
// Armor amount to give
"armor" "100"
// Whether to give a helmet. If you want to disable armor, you must
// set this to "no" as well as setting armor to 0.
"helmet" "yes"
// Whether to give flashbangs
"flashbangs" "yes"
// Whether to give a smoke grenade
"smokegrenade" "no"
// Whether to give an HE grenade
"hegrenade" "yes"
// Whether to give defusekits to CTs
"defusekits" "yes"
}
"PrimaryMenu"
{
"weapon_m4a1" "Maverick M4A1 Carbine"
"weapon_ak47" "AK47"
"weapon_scout" "Schmidt Scout "
"weapon_sg552" "Krieg 552"
"weapon_galil" "IDF Defender"
"weapon_famas" "FAMAS"
"weapon_aug" "Bullpup"
"weapon_m249" "M249-SAW"
"weapon_ump45" "KM UMP45"
"weapon_mp5navy" "MP5 Navy"
"weapon_m3" "Leone 12 Gauge Super"
"weapon_xm1014" "Leone YG1265 Auto Shotgun"
"weapon_tmp" "Schmidt Machine Pistol"
"weapon_mac10" "Ingram Mac-10"
"weapon_p90" "ES C90"
}
"SecondaryMenu"
{
"weapon_usp" "USP Tactical"
"weapon_glock" "Glock"
"weapon_deagle" "Desert Eagle"
"weapon_p228" "P228"
"weapon_elite" "Dual 96G Elite Berettas"
"weapon_fiveseven" "ES Five Seven"
}
}
Re: Hi New here
I have updated the code in my previous post.
Re: Hi New here
Hi do I make your code into a smx plug now ? how do I install server side?
Re: Hi New here
This is Source.Python, not SourceMod. So, this has nothing to do with SMX files (they are for SourceMod).
To install my snippet please do the following steps:
To install my snippet please do the following steps:
- Create a new folder (e.g. gun_menu) in ../addons/source-python/plugins.
- Create a new py-file inside of the created folder. The file must have the same name like the folder (e.g. gun_menu.py).
- Copy the snippet into the file and save it.
- Load it with: sp plugin load gun_menu
Re: Hi New here
First id like to say thankyou.
Second Am I creating a new folder called source-python inside addonsbwith plugin folderinside ?
I use source mod for several things in server . will this cause an issues?
Second Am I creating a new folder called source-python inside addonsbwith plugin folderinside ?
I use source mod for several things in server . will this cause an issues?
Re: Hi New here
Well, you need to install Source.Python at first:
http://wiki.sourcepython.com/general/installation.html
SourceMod and Source.Python can run on the same server. The only (known) issue that can occur is described here:
https://github.com/Source-Python-Dev-Te ... issues/108
A workaround is also provided.
http://wiki.sourcepython.com/general/installation.html
SourceMod and Source.Python can run on the same server. The only (known) issue that can occur is described here:
https://github.com/Source-Python-Dev-Te ... issues/108
A workaround is also provided.
Re: Hi New here
so I made gun_menu folder in ../addons/source-python/plugins. I added the save code you made on notepad and called it gun_menu.py I saved it but I'm not sure what format you wanted me to. I am a little confused on Load it with: sp plugin load gun_menu.I put load gun menu in console and got this message.
load gun_menu
Can't load in multiplayer games.
I'm sorry I am clueless with this stuff.
D
load gun_menu
Can't load in multiplayer games.
I'm sorry I am clueless with this stuff.
D
Re: Hi New here
Just enter sp plugin load gun_menu in the server console or put it into your autoexec.cfg.
Re: Hi New here
I'm trying to install source python right now . thanks
I will update u :)
I will update u :)
Re: Hi New here
sp plugin load gun_menu will not load menu. I installed
http://wiki.sourcepython.com/general/installation.html
in console I entered
] plugin_print
Loaded plugins:
---------------------
---------------------
-----------------
] sp_version
Unknown command: sp_version
] sp plugin load gun_menu
Unknown command: sp
I am using gameservers. I believe its a Linux server
http://wiki.sourcepython.com/general/installation.html
in console I entered
] plugin_print
Loaded plugins:
---------------------
---------------------
-----------------
] sp_version
Unknown command: sp_version
] sp plugin load gun_menu
Unknown command: sp
I am using gameservers. I believe its a Linux server
Re: Hi New here
this is a test server if u want to look at the ftp of server
Re: Hi New here
What's the output of the server console?
Re: Hi New here
I am not sure what that means?
Who is online
Users browsing this forum: No registered users and 54 guests