AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   can I do this? (https://forums.alliedmods.net/showthread.php?t=154490)

Triver 04-09-2011 10:15

can I do this?
 
Sry if the title doesnt say anything about the content of the thread but it was the best thing that crossed my mind :)

First of all let me say that it is not my plugin/mod that I am discussing here, Im just trying to improve it since the original developer stopped working on it and published the .sma's
I am also not asking for complete code solutions, only for ideas of how to solve the problems (but if you want you can post a whole solution :wink:)

The mod adds weapons to the game and as far as I have read out of the code it works like this:
A new weapon is generally a copied original one whose models/sounds/animations are linked to new ones. There are also some changes like shooting speed, amount of ammo, reloading speed etc.


1st problem:
The "new" weapons still have the original hud sprites (I mean the pictures of the weapons when you scroll through your inventory with your mouse).
So after thinking about it, I just need to tell the game that it should use alternative sprite .txt's (the sprites of a weapon are stored in sprites/weapon_xxx.txt) instead of the original ones (for example it should read the sprite information out of the file "sprites/mod/weapon_new.txt" and not "sprites/weapon_ak47.txt).
Is it possible to do this and if yes how?

2nd problem:
When you zoom in with a sniper weapon of the game, the v_model is usually invisible. But if you tell the game to zoom in with a different weapon (in this case a new added one) by using the function
Code:

cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
the v_model is still visible!
I also experienced this in other plugins like the improved paintball plugin (screenshot example) so I assume it has something to do with the function...
So is it possible to blank the model out when zooming in and if yes how?

3rd problem:
You can also see in the above screenshot example (its the paintball plugin but I have the same problem in the plugin I am modifying) that it only has the scope sprite and no crosshair sprite. So there is an empty space in the middle of the screen where you normally would have a crosshair.
I believe CS_SET_FIRST_ZOOM only tells the game to go in zoom and use the scope sprite but nothing more.
However I believe I can solve this when I am able use the custom weapon_xxx.txt's...


This is it for now, maybe I will have some more questions soon, I just hope you can answer some of them :mrgreen:

Oh and to the plugin I am modifying:
It is the weapons plugin from the Counter Strike Mod CSO:NST and before you say anything about not supporting it here because of nonsteam, illegal etc just let me say that I am aiming to port them to the official version of Counter Strike because it is a good plugin and I would like to have some new weapons in CS (I know there is already a Weapon's Mod that does this but I think the way it is done in NST is better).
Also as long as you just have a look in the code of the mod and as long as we just discuss it, there should be nothing illegal with it or?

If you need the code of how it is done, the necessary .sma's can be downloaded here (if you need some specific code sections I can try to locate them and post here)

Arkshine 04-19-2011 17:05

Re: can I do this?
 
- Not possible. Fully client-side. To add sprite, each client would need to modify the file manually.
- You can try to set 0 to pev_viewmodel2, it should to the job.
- There is already a plugin to add crosshair to non-sniper weapon.

Exolent[jNr] 04-19-2011 17:13

Re: can I do this?
 
Quote:

Originally Posted by Triver (Post 1453717)
bump.

Nobody has an idea?
Or can at least somebody say if it is possible to solve these problems with amx?

Don't bump until 2 weeks have passed since last post.

bibu 04-19-2011 17:58

Re: can I do this?
 
2. http://forums.alliedmods.net/showthread.php?p=1116623

Triver 04-20-2011 04:36

Re: can I do this?
 
Thx for the answers!

@Arkshine:
but I dont want to add additionally sprites in a client file (like hud.txt), I want the client to use other files than the standard ones.
It would work like with the models and sounds: you download the necessary files from the server you are connecting to, it saves them in the specified folder and uses them if the plugin says so.

As I said, the client seems to use the weapon_weaponname.txt files to specify the sprites for each weapons. Now if I have picked up in the mod for example a g36c weapon that is in reality a by the mod added m4a1 only with other models and sounds, it would still use now the weapon_m4a1.txt.

Thats where I would like to say the client "No dont use that, I would like you to use the .txt file that has the same name as the weapon" which would be weapon_g36c.txt in this case.
Or did you mean you can only say this to the client by modifying the client files?

And could you please tell me the name of that plugin with the sniper crosshair? :)


(sry for bump, I thought the limit was one week :P)

Arkshine 04-20-2011 06:47

Re: can I do this?
 
It's handled client-side, it means you can NOT do things on it through server-side plugin.

About the plugin, please search : http://www.amxmodx.org/compiler.php


All times are GMT -4. The time now is 19:50.

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