possible to do these?
(1) Is there a way to make it so that people cannot buy items in the game? I'm currently making a plugin for CS1.6 and I want it so that nobody can buy anything. Like, perhaps restrict all weapons in an easy way, get rid of buyzones, etc. What would be the most effective way, and how do I do it?
(2) How can I make it so that players CANNOT pickup any guns from the ground. Thanks in advance. Oh and also I know this is an easy question, but how to make somebody become partially invisible, I guess about as much invisibility as in the wc3 mod when you have lvl3 invisibility and holding a knife? Pretty invisible :D PSS: Last thing ;) I need to know how to increase somebody's damage that they do with certain guns. Thanks :D ~Chex |
Re: possible to do these?
Right.
1) Remove buyzones is my suggestion. What you need to do is to loop through each entity that is a "func_buyzone" and kill it. Code:
(I think ... don't trust that last statement) 2) Register the "touch" event between the player and the gun, and return FMRES_SUPERCEDE to block it: Code:
To make someone invisible, you need to set their rendering, and specify the "alpha" as anything < 255. Code:
If you need any comments explaining any of the code just ask. If I don't pick it up, someone else should. |
Re: possible to do these?
Thanks a million. So I'm guessing 255 is purely visible? So would 30 be good for still visible, but easy to pass up?
PS: New Question: - I am using "set_user_maxspeed(id, get_user_maxspeed(id) * 3);" to make somebody's speed 3 times the normal speed. While searching the set_user_maxspeed and get_user_maxspeed functions, I noticed somebody post about how you had to "Hook the CurWeapon" function or something so that every time you change weapons, the speed wouldn't get reset back to normal. Do you know anything about this>? oh and, I still need to know how to increase somebody's damage that they do with certain guns - Thanks |
Re: possible to do these?
255 is 100% visible.
0 is 100% INVisible 30 is pretty damned invisible. Still visible, though. Ah yes, I forgot the extra damage. More on that later "CurWeapon" is a message, sent when you do just about anything with a Weapon. user_maxspeed is reset (by CS) whenever you change weapon. So to triple it, you need to do so only when they change weapon, and when they spawn. This would be how you hook CurWeapon: Code:
Damage with a weapon I'm not certain about ... you *should* be able to do it with HamSandwich module, but it doesn't work for me. (The "Inflictor" [weapon] argument is always the player and not the weapon) The advantage to doing it with HS is that you can catch the damage before it damages the player, and adjust the damage it deals. And then let CS do the damaging itself. What I suggest is looking at the WC3 source, or similar. Try looking at other plugins that do similar things. EDIT: I have no idea why I'm being so helpful. Could be because I'm in such a good mood. Aren't you lucky? |
Re: possible to do these?
thanks, ill read some wc3 source later.
ok my code is coming along great because of your help, you'll definately be in the credits ;) maybe you could keep up the good mood? I always have more questions! :D 1) How to strip weapons (All except knife ; or just strip all then give knife) on every new round? Kinda like on scoutzknivez you know how they strip everything then give you knife+scout ;) 2) with all these new things you're giving me, do i need to include any new modules besides fun and amxmodx? 3) the big question... Okay so basically here's PART of my code.. Code:
register_clcmd( "/class","classmenu")Thanks in advance! I will have more questions, aren't you excited? :D |
Re: possible to do these?
Quote:
|
Re: possible to do these?
Are you saying i need to change something when i put that into my code? or will it still work?
and PS: I know the code "strip_user_weapons(id)" but how can I do this every time round starts? I'm making a menu and one of the classes available to choose is where you get ONLY an awp. so i want to make sure it strips all weapons every round start (i know how to give the awp) thanks |
Re: possible to do these?
Quote:
Thanks. Code:
For stripping weapons, you want the spawn event. But not right on the spawn, set a task for it. Code:
|
Re: possible to do these?
Okay I understand the code but I'm confused about something.
Here's my plugin so far: Code:
#include <amxmodx>What I'm trying to do is strip everybody's weapons at the beginning of the round. Then, I want to give specific weapons to each specific class (a class is like sniper etc. that people choose when joining). So for example, if somebody was a Ninja, how could I strip all their weapons and THEN give them a knife every time a round starts? You may have already told me, but I'm really really new ;) If you could help that'd be great, like maybe edit it into my code? -thanks ps: as you can see i already have what guns i want every class to have being given to them, but i want this done every time a new round starts, and AFTER the strip weapons feature.. -thanks again |
Re: possible to do these?
What you should do, is to have an array of player classes.
Then when they do the class menu, change that player's entry in the array. Then on spawn, check their class from the array and do the give_item there. EDIT: And a couple other things ... You "on_touch" event is inside plugin_init, it seems. And it should be "public on_touch" since it is called by CS, and not your plugin. I know I posted "on_touch" but I forgot to make it public. EDIT: And I probably shouldn't just give you exact code, let alone edit yours. If you get too much help too early on you'll never be able to help yourself. |
| All times are GMT -4. The time now is 11:12. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.