Raised This Month: $319 Target: $400
 79%   Almost there!

[DOD] weapons, classes, teams Addon (request/solution)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheVaskov
Junior Member
Join Date: Sep 2021
Old 09-26-2021 , 04:37   [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #1

Hello.
I'm in the first stages of coding on PAWN for AMXmodX.
As you know dodplugins.net is not working stably today. And everything that I can find for DOD is here or on avamods. k .

I want to make a big addon for Day of Defeat (steam, goldsrc) that does not remove the standard package, but adds
- the troops of Japan, the USSR and Italy. -
- classes of players from Japan, the USSR, Italy
- weapons !
- sounds of gunshots and radio commands (USSR radio comlete 100%)
- HUD and sprites
- Vgui\Standart Player Selection menu


This addon should be of close quality to the original (without HDtextures, without low quality, good sounds, real weapons. it should look like from Valve)

___________
This is an invitation to cooperate, I can do:
- maps
- models and animations
- textures of wad, sky
-sounds
- amxx sma typing =) (noob)
___________
I would not like to create a lot of topics on the forum and make a mess, I have looked through a lot of sma files for CS1. 6 HL and DOD I (as a beginner) have a lot of questions.
So here we can publish a solution and discuss everything related to this big topic.
It is possible that many. those who are interested in DOD will find answers for themselves here after some time.

So here we are
TheVaskov is offline
TheVaskov
Junior Member
Join Date: Sep 2021
Old 09-26-2021 , 04:50   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #2

If this topic should be in another part of the forum, let the administrator do it.

I have found several solutions
- WeaponMod 1.0 Omega \ (1.2) Alpha from DevconeS - he uses other decals and sprites and may not work with certain plugins (when I do a rifle, it shoots well in Zele, but or you want the camera was shaking so much from the impact)
- Modifier weapon, EPIC WEAPON, etc . it needs more work. it is easier to write your entire everything.


So My plan:
1 Make weapons. 2. Make Teams 3. Give weapons to teams 4. make classes 5. give weapons to classes

Who knows how to use custom_weapon_add
native custom_weapon_add( const wpnname[], melee = 0, const logname[]="" ); ??
I heard DOD support 5 new custom weapons

What you say ???


As You see I use many includes , cause it for future..
What way is better ? to make a Team,Clasees,Weapons and ASSIGN it all and assign with hud and sprites and of course engine
(Good question contains 50% of answer .. so is it Engine modules , or Fakemeta,Hamsandwithc,Vault,DODfun?



this plugin gives you weapon, but you must drops your weapon before.
pistols and melee needs use "say strip"
Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <dodx>
#include <dodfun>
#include <dodconst>
#include <dodstats>
#include <hamsandwich>
#include <fun>



#define PLUGIN "WeaponD2OD"
#define VERSION "1.0"
#define AUTHOR "Diman"


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_clcmd("testcmd","you_cmd")
	register_clcmd("say in","give_w_info")
	register_clcmd("say strip", "give_strip")
	register_clcmd("say /testcmd", "you_cmd")

	// top
	register_clcmd("say mortar", "give_w_mortar0")
	register_clcmd("say amerknife", "give_w_amerknife1")
	register_clcmd("say colt", "give_w_colt3")
	register_clcmd("say luger", "give_w_luger4")
	register_clcmd("say garand", "give_w_garand5")
	register_clcmd("say sckar", "give_w_sckar6")
	register_clcmd("say thompson", "give_w_thompson7")
	register_clcmd("say stg44", "give_w_stg448")
	register_clcmd("say springfield", "give_w_springfield9")
	register_clcmd("say kar", "give_w_kar10")
	register_clcmd("say bar", "give_w_bar11")
	register_clcmd("say mp40", "give_w_mp4012")
	register_clcmd("say grenade", "give_w_grenade13")
	register_clcmd("say grenade2", "give_w_grenade214")
	register_clcmd("say mg42", "give_w_mg4217")
	register_clcmd("say 30cal", "give_w_30cal18")
	register_clcmd("say spade", "give_w_spade19")
	register_clcmd("say m1carbine", "give_w_m1carbine20")
	register_clcmd("say mg34", "give_w_mg3421")
	register_clcmd("say greasegun", "give_w_greasegun22")
	register_clcmd("say fg42", "give_w_fg4223")
	register_clcmd("say k43", "give_w_k4324")
	register_clcmd("say enfield", "give_w_enfield25")
	register_clcmd("say sten", "give_w_sten26")
	register_clcmd("say bren", "give_w_bren27")
	register_clcmd("say webley", "give_w_webley28")
	register_clcmd("say bazooka", "give_w_bazooka29")
	register_clcmd("say panzerschreck", "give_w_pschreck30")
	register_clcmd("say piat", "give_w_piat31")
	register_clcmd("say scfg42", "give_w_scfg4232")
	register_clcmd("say scenfield", "give_w_scenfield35")
	register_clcmd("say brit_knife", "give_w_brit_knife37")
}
public you_cmd(id){
    client_print(id,print_chat,"You first2 command") 
}
public give_strip(id){
	strip_user_weapons(id)
}
public give_w_info(id){
	new clip, ammo, myWeapon = dod_get_user_weapon(id,clip,ammo)
	new logName[32],gunNam[32]
	xmod_get_wpnlogname( myWeapon, logName, 32) 
	xmod_get_wpnname ( myWeapon, gunNam, 32 ) 
	client_print(id,print_chat,"Nomer Id(%d) Itemname (%s) dod_get_user_id(%s)", myWeapon, logName, gunNam)
}
// TOPGUNS
public give_w_mortar0(id){give_item(id,"weapon_mortar")
}
public give_w_amerknife1(id){give_item(id,"weapon_amerknife")
}
public give_w_colt3(id){give_item(id,"weapon_colt")
}
public give_w_luger4(id){give_item(id,"weapon_luger")
}
public give_w_garand5(id){give_item(id,"weapon_garand")
}
public give_w_sckar6(id){give_item(id,"weapon_scopedkar")
}
public give_w_thompson7(id){give_item(id,"weapon_thompson")
}
public give_w_stg448(id){give_item(id,"weapon_mp44")
}
public give_w_springfield9(id){give_item(id,"weapon_spring")
}
public give_w_kar10(id){give_item(id,"weapon_kar")
}
public give_w_bar11(id){give_item(id,"weapon_bar")
}
public give_w_mp4012(id){give_item(id,"weapon_mp40")
}
public give_w_grenade13(id){give_item(id,"weapon_grenade")
}
public give_w_grenade214(id){give_item(id,"weapon_grenade2")
}
public give_w_mg4217(id){give_item(id,"weapon_mg42")
}
public give_w_30cal18(id){give_item(id,"weapon_30cal")
}
public give_w_spade19(id){give_item(id,"weapon_spade")
}
public give_w_m1carbine20(id){give_item(id,"weapon_m1carbine")
}
public give_w_mg3421(id){give_item(id,"weapon_mg34")
}
public give_w_greasegun22(id){give_item(id,"weapon_greasegun")
}
public give_w_fg4223(id){give_item(id,"weapon_fg42")
}
public give_w_k4324(id){give_item(id,"weapon_k43")
}
public give_w_enfield25(id){give_item(id,"weapon_enfield")
}
public give_w_sten26(id){give_item(id,"weapon_sten")
}
public give_w_bren27(id){give_item(id,"weapon_bren")
}
public give_w_webley28(id){give_item(id,"weapon_webley")
}
public give_w_bazooka29(id){give_item(id,"weapon_bazooka")
}
public give_w_pschreck30(id){give_item(id,"weapon_pschreck")
}
public give_w_piat31(id){give_item(id,"weapon_piat")
}
public give_w_scfg4232(id){give_item(id,"weapon_scoped_fg42")
}
public give_w_scenfield35(id){give_item(id,"weapon_scoped_enfield")
}
public give_w_brit_knife37(id){give_item(id,"weapon_brit_knife")
}
Quote:
Originally Posted by DJEarthQuake View Post
I suggest optimizing that code a bit.
please wellcome

Last edited by TheVaskov; 09-26-2021 at 10:50.
TheVaskov is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-26-2021 , 08:26   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #3

I suggest optimizing that code a bit.
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
Old 09-26-2021, 10:49
TheVaskov
This message has been deleted by TheVaskov.
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-26-2021 , 14:21   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #4

A couple months ago when dodplugins.net was up, I grabbed most of the plugins' source code so if you knew of a particular plugin that you are looking for, I could try and find it for you. I didn't backup anything other than the source code (no models, sprites, etc.) so I won't be able to get you those.
__________________
fysiks is offline
TheVaskov
Junior Member
Join Date: Sep 2021
Old 09-26-2021 , 15:22   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #5

Quote:
Originally Posted by fysiks View Post
A couple months ago when dodplugins.net was up, I grabbed most of the plugins' source code so if you knew of a particular plugin that you are looking for, I could try and find it for you. I didn't backup anything other than the source code (no models, sprites, etc.) so I won't be able to get you those.
Dear fysiks! Please upload all of this, it's very useful for education ! Yesterday I did try to downoload and search something from ~googlecache/dodplugins.net ... NO! I can work with .sma
Now I study amxx and trying to catch difference between Engine\Fun\Amxx\Dodx... etc. It needs time to learn all functions and make some exersise.
Can You give me advice what way for #DEFINE team/class and assign functions. (Way of use module fakemeta\dodfun or what #include-libriary\ )
Am I must study orpheu (Arkshine's) tool ? Thanks a lot !
TheVaskov is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-26-2021 , 16:00   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #6

  1. If you're new to AMX Mod X scripting, you need to learn to search. Use the tutorial section and practice. There is a whole ton of information about basic scripting.
  2. Orpheu was not written by Arkshine and you generally shouldn't start with it. If there is something specific that you need to do with it that you can't do other ways is when you'll need to get into it.
__________________
fysiks is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-27-2021 , 11:28   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #7

Quote:
Originally Posted by TheVaskov View Post
please wellcome
Anytime. Nice to see DoD activity.
Make an array.
e.g.

Script I posted today. You could do the same and make 1 function instead of bunches.
https://forums.alliedmods.net/showpo...02&postcount=2

Here's one for OP4 not command based just resource drops. Same basic techniques apply.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine_stocks>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#define MAX_NAME_LENGTH  32
#define charsmin -1

new const GIVES[][]=
{
    
"ammo_9mmbox",
    
"ammo_ARgrenades",
    
"ammo_buckshot",
    
"weapon_pipewrench",
    
"weapon_penguin",
    
"weapon_knife",
    
"weapon_shockrifle",
    
"weapon_sporelauncher",
    
"weapon_m249",
    
"weapon_grapple",
    
"weapon_eagle",
    
"weapon_sniperrifle",
    
"weapon_displacer",
    
"item_longjump",
    
"weapon_357",
    
"weapon_9mmAR",
    
"weapon_crossbow",
    
/*"weapon_crowbar",*/
    
"weapon_egon",
    
"weapon_gauss",
    
"weapon_handgrenade",
    
"weapon_hornetgun",
    
"weapon_rpg",
    
"weapon_satchel",
    
"weapon_shotgun",
    
"weapon_snark",
    
"weapon_tripmine",
    
"weapon_9mmhandgun"
}

new const 
REPLACE[][] = {"ammo_""weapon_""item_"}
new const 
tracer[]={"ammo_buckshot"}
new 
g_map_ent

public plugin_init()
{
    
register_plugin("Gives random weapon(s) on spawn.""A"".sρiηX҉.");
    
RegisterHam(Ham_Spawn"player""client_getfreestuff"1);

    new 
mname[MAX_NAME_LENGTH];
    
get_mapname(mname,charsmax(mname));
    
g_map_ent find_ent_by_class(charsmintracer)
    if (
containi(mname,"op4c") > charsmin || g_map_ent)
        
pause "a";
}

public 
client_getfreestuff(id)
{
    if( !
is_user_connected(id) || is_user_bot(id) )
    return 
PLUGIN_HANDLED_MAIN;

    
client_print idprint_chat"Free random items on spawn!"

    
if( is_user_alive(id) && is_user_admin(id) )
    {
        
#if AMXX_VERSION_NUM == 182;
        
set_task(5.0"reward"id__"a"4);
        
#else
        
set_task_ex(5.0"reward"id, .flags SetTask_RepeatTimes, .repeat 4);
        
#endif
        
give_item(id"weapon_knife");
    }
    else
    if( 
is_user_alive(id) )
        
#if AMXX_VERSION_NUM == 182;
        
set_task(10.0"reward"id__"a"2);
        
#else
        
set_task_ex(10.0"reward"id, .flags SetTask_RepeatTimes, .repeat 2);
        
#endif

    
return PLUGIN_CONTINUE;
}

public 
reward(needy)
{
    new 
charity[MAX_NAME_LENGTH];
    
formatex(charitycharsmax(charity), GIVES[random(sizeof(GIVES))]);
    if( 
is_user_alive(needy) )
    {
        
give_item(needycharity);
        for ( new 
MENTMENT sizeof REPLACE; ++MENT )
            
replace(charitycharsmax(charity), REPLACE[MENT], " ");

        if(!
is_user_bot(needy))
            
client_print(needyprint_center,"^n Free%s!"charity);
    }



Pretty sure every include isn't needed on WeaponD2OD
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell

Last edited by DJEarthQuake; 09-27-2021 at 11:56. Reason: fines
DJEarthQuake is offline
TheVaskov
Junior Member
Join Date: Sep 2021
Old 09-27-2021 , 11:53   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #8

Quote:
Originally Posted by fysiks View Post
Thank a lot for Tutorials link.
So..Can I count on the archive with sma files? "cause on Your's Github I found not many plugins.


Quote:
Originally Posted by DJEarthQuake View Post
Anytime. Nice to see DoD activity.
Make an array.
e.g.
In my server your code works not correkt.

Last edited by TheVaskov; 10-01-2021 at 16:57.
TheVaskov is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 09-28-2021 , 04:05   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #9

Say full name. All mods. If one does not hear the bell then they do not know how to spell too well.
Code:
#include amxmodx #include amxmisc #include fun #define charsmin                  -1 #define MAX_RESOURCE_PATH_LENGTH   64 public plugin_init() register_plugin("wep intrcp","1.0","SPiNX") public client_command(id) if(is_user_connected(id)) {     new said[MAX_RESOURCE_PATH_LENGTH]     read_args(said,charsmax(said))     if(containi(said,"weapon_") != charsmin)     {         client_print id, print_console, "%s", said         if(is_running("dod") == 1)         {             strip_user_weapons(id)             give_item(id,"weapon_colt")             give_item(id,"weapon_spade")             give_item(id,"weapon_handgrenade")             give_item(id,"weapon_stickgrenade")         }         give_item(id,said)         client_cmd(id,"spk buttons/bell1.wav");     } }
__________________
"It's not the actual programming that's interesting. But it's what you can accomplish with the end results that are important." -Dennis Ritchie
"Mathematics, rightly viewed, possesses not only truth, but supreme beauty a beauty cold and austere, like that of sculpture..." -Bertrand Russell
DJEarthQuake is offline
TheVaskov
Junior Member
Join Date: Sep 2021
Old 10-01-2021 , 06:34   Re: [DOD] weapons, classes, teams Addon (request/solution)
Reply With Quote #10

This will change playermodel ...

Troubles:
sometimes crushes HLDS
need to if-else for spectators
sometimes need retype command in chat , skin not changes from first comand
when you are Japanese and choose classes from standart menu , you change on only body-model of skin.


my next step is
and give special index teamarmy
use special index teamarmy for register client voice command and replace to new sounds.


Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>
#include <fakemeta>
#include <dodx>
#include <dodfun>
#include <dodconst>
#include <dodstats>
#include <hamsandwich>
#include <fun>
#include <vault>

#define PLUGIN "Clases4code"
#define VERSION "1.1"
#define AUTHOR "Diman"
 
 new armyteam[16]
 new armyallies[16] = {"Allies"}
 new armyaxis[16] = {"Axis"}
  new teamarmyindex

/* Главная функция */
public plugin_init(){
	
	register_clcmd("say Axis", "join_armyteam_axis")
	register_clcmd("say Axispara", "join_armyteam_axispara")
	register_clcmd("say Usa", "join_armyteam_usa")
	register_clcmd("say Usapara", "join_armyteam_usapara")
	register_clcmd("say Brit", "join_armyteam_brit")
	
	register_clcmd("say Japan", "join_armyteam_japan")
	register_clcmd("say USSR", "join_armyteam_ussr")
	register_clcmd("say Italy", "join_armyteam_italy")
	
	
	
	register_clcmd("say in", "join_armyteam_info")
}

public plugin_precache() {
	precache_model("models/player/axis-inf/axis-inf.mdl")  
	precache_model("models/player/axis-inf/axis-infT.mdl") 
  	
	precache_model("models/player/axis-para/axis-para.mdl")  
	precache_model("models/player/axis-para/axis-paraT.mdl")
	
	precache_model("models/player/brit-inf/brit-inf.mdl")  
	precache_model("models/player/brit-inf/brit-infT.mdl")
	
	precache_model("models/player/us-inf/us-inf.mdl")  
	precache_model("models/player/us-inf/us-infT.mdl")
	
	precache_model("models/player/us-para/us-para.mdl")  
	precache_model("models/player/us-para/us-paraT.mdl")
	
	precache_model("models/player/axisjap-inf/axisjap-inf.mdl")
	precache_model("models/player/axisjap-inf/axisjap-infT.mdl")
	
	precache_model("models/player/axisita-inf/axisita-inf.mdl")
	precache_model("models/player/axisita-inf/axisita-infT.mdl")
	
	precache_model("models/player/ussr-inf/ussr-inf.mdl")
	precache_model("models/player/ussr-inf/ussr-infT.mdl") 
	
	precache_sound("ussr/player/ussrnegative.wav")

}   

// teamarmychecker
public join_armyteam_info(id){
	get_user_team(id, armyteam, 15)
	client_print(id,print_chat,"ARCHITYPE TEAMSIDE (%s)",armyteam)
	client_print(id,print_chat,"TEAMARMYINDEX is (%d)",teamarmyindex)
}
// standart skins
public join_armyteam_axis(id) {
	get_user_team(id, armyteam, 15)
	if (equal(armyteam,armyaxis))
	{	
		dod_clear_model(id)
		dod_set_model(id,"axis-inf")
		client_print(id,print_chat,"Du bist ein soldat - Axis")
	}
}

public join_armyteam_axispara(id){
	

	get_user_team(id, armyteam, 15)
	if (equal(armyteam,armyaxis))
	{	
		dod_clear_model(id)
		dod_set_model(id,"axis-para")
		client_print(id,print_chat,"Вu bist Fallschirmjager - Axis Paratrooper")
	}
}

public join_armyteam_brit(id) {
	get_user_team(id, armyteam, 15)
	if (equal(armyteam,armyallies))
	{	
		dod_clear_model(id)
		dod_set_model(id,"brit-inf")
		client_print(id,print_chat,"You are British soldier - Brit soldat")
	}
}
public join_armyteam_usa(id) {
	get_user_team(id, armyteam, 15)
	if (equal(armyteam,armyallies))
	{	
		dod_clear_model(id)
		dod_set_model(id,"us-inf")
		client_print(id,print_chat,"You are US Soldier - US soldat")
	}
}
public join_armyteam_usapara(id) {
	get_user_team(id, armyteam, 15)
	if (equal(armyteam,armyallies))
	{	
		dod_clear_model(id)
		dod_set_model(id,"us-para")
		client_print(id,print_chat,"You are US Paratrooper - US Para")
	}
}
// Addon



public join_armyteam_japan(id) 
{
	get_user_team(id, armyteam, 15)
	// client_print(id,print_chat,"ARCHITYPE TEAMSIDE IS (%s)",teamarmy)
	
	if ( !equal(armyteam,armyaxis))
	{
		// user_kill(id,0)
		dod_clear_model(id)
		dod_set_model(id,"axisjap-inf")
		client_print(id,print_chat,"You are japanese")
		// teamarmyindex = 6
		// dod_set_pl_teamname(id, armyjapan[31])
	}
	
	
}

public join_armyteam_italy(id) 
{
	get_user_team(id, armyteam, 15)
	if ( equal(armyteam,armyaxis))
	{
		// user_kill(id,0)
		dod_clear_model(id)
		dod_set_model(id,"axisita-inf")
		client_print(id,print_chat,"Sei un soldato d'italia - Italian soldat")
		
	}
	
	
}

public join_armyteam_ussr(id) 
{
	get_user_team(id, armyteam, 15)
	// client_print(id,print_chat,"ARCHITYPE TEAMSIDE IS (%s)",teamarmy)
	if ( !equal(armyteam,armyaxis))
	{
		// user_kill(id,0)
		dod_clear_model(id)
		dod_set_model(id,"ussr-inf")
		client_print(id,print_chat,"3a poguHy - You are Soviet soldat")
		// client_cmd(id,"voice_negative")
		client_cmd(id,"spk ussr/player/ussrnegative.wav") // - this sound playd when you connect as USSR
		// teamarmyindex = 7
		
	}
	
	
}
Question about DOD_StrongRifles plugin :

Can we apply the Strong Rifles plugin according to the scheme:
say /weapon_garand = gives simple standart Garand Rifle
but.
say /weapon_garandspecial = {
give_garand (standart)
set p_,w_,v_ models to new SPECIAL MODELS
set hud , sprites , clip ammo SPECIAL
set new sounds
apply strong riffles to garand (and makes it SPECIAL)
......
} result:
so in game we have 2 rifles in one time.
Player 1 has SPECIAL
Player 2 has STANDART
All player see and feel difference in shots and models.

Can It be?
(I did read somewhere that sounds of shoots we can not replace or reassign to new adress like "sound/specialnewgarand/shoot1.wav" )

Last edited by TheVaskov; 10-03-2021 at 10:40.
TheVaskov is offline
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 17:35.


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