AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Request] Remove weapon entity/Block weapon pickup (https://forums.alliedmods.net/showthread.php?t=86089)

T.N.T 02-20-2009 15:07

[Request] Remove weapon entity/Block weapon pickup
 
Heya folks, yesterday Arkshine made a "Scoutzknivez Only" plugin for me. (Thanks! :D) But now I need some other plugin: Restrict weapon pickup or remove weapon entity spawn on every map. Ive searched for plugins like this but some dont work for me.

So, can anyone build a plugin for me:

+ cant pickup weapon entities from the map EXCEPT scout and c4!
+ OR if you can it would be more nice if it removes the weapons!
+ again: dont remove scout and c4!

Thanks :) I hope this is possible.

Btw: Very sorry for topic name which I forgot. I cant change it.

Sn!ff3r 02-20-2009 21:53

Re: [Request] Remove weapon entity/Block weapon pickup
 
It would have be good ;)

PHP Code:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_SetModel,"fw_setmodel",1)
    
// Add your code here...
}

public 
fw_setmodel(ent,model[])
{
    if(!
pev_valid(ent))
        return 
FMRES_IGNORED
        
    
if(contain(model,"_c4") != -|| contain(model,"_scout") != -|| contain(model,"_weaponbox") != -|| contain(model,"_back") != -1)
        return 
FMRES_IGNORED
    
    
static classname[33]; pev(ent,pev_classname,classname,32)
    
    if(
equal(classname,"weaponbox") || equal(classname,"armoury_entity") || contain(classname,"weapon_") != -1)
    {        
        
engfunc(EngFunc_RemoveEntity,ent)
        return 
FMRES_SUPERCEDE
        
    
}
    return 
FMRES_IGNORED    



T.N.T 02-20-2009 22:28

Re: [Request] Remove weapon entity/Block weapon pickup
 
Thank-you :) But what does this plugin do? Remove or block pickup :P And ermm what am I supposed to write at: //Add your code here?

bye

Sn!ff3r 02-21-2009 07:25

Re: [Request] Remove weapon entity/Block weapon pickup
 
Quote:

//Add your code here?
This is comments from amxx studio, skip it.

Quote:

But what does this plugin do?
Remove all weapons entity except c4 / scout.

T.N.T 02-21-2009 09:03

Re: [Request] Remove weapon entity/Block weapon pickup
 
Okay ive tried this plugin. But I dont spawn with knife :P Sorry for that, I also need to hold a knife :P

+c4
+scout
+knife
-nothing else

But erm ur plugin actually removes the weapon from the world when picked up :P So its block weapon pickup and remove weapon entity at the same time lol! (it's good, tho!) Only problem I still need to be able to hold a knife ;) Then its 100% cool.

+Karma when it's finished . :)

Trafalete 02-21-2009 10:12

Re: [Request] Remove weapon entity/Block weapon pickup
 
PHP Code:

if(contain(model,"_c4") != -|| contain(model,"_scout") != -|| contain(model,"_weaponbox") != -|| contain(model,"_back") != -1)
        return 
FMRES_IGNORED 

add after

PHP Code:

contain(model,"_back") != -

inside the if ( before the last ) ) this thingie for knife

PHP Code:

|| contain(model,"_knife") != -


hope it's like that :p

T.N.T 02-21-2009 10:26

Re: [Request] Remove weapon entity/Block weapon pickup
 
Erm I dont really get what you are talking about :P Can you edit the original plugin from Sn!ff3r including ur codes? Ty.\

Like this:

Quote:

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN "Nowy Plugin"
#define VERSION "1.0"
#define AUTHOR "Sn!ff3r"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_forward(FM_SetModel,"fw_setmodel",1)
// Add your code here...
}

public fw_setmodel(ent,model[])
{
if(!pev_valid(ent))
return FMRES_IGNORED

if(contain(model,"_c4") != -1 || contain(model,"_scout") != -1 || contain(model,"_weaponbox") != -1 || contain(model,"_knife") != -1 || contain(model,"_back") != -1)
return FMRES_IGNORED

static classname[33]; pev(ent,pev_classname,classname,32)

if(equal(classname,"weaponbox") || equal(classname,"armoury_entity") || contain(classname,"weapon_") != -1)
{
engfunc(EngFunc_RemoveEntity,ent)
return FMRES_SUPERCEDE

}
return FMRES_IGNORED
}
It's working! But when I drop scout and pickup other weapons I get ammo so I get ammo for scout too >_< How to fix?

Arkshine 02-21-2009 14:20

Re: [Request] Remove weapon entity/Block weapon pickup
 
If I understand, you want to remove weapon on the ground ( weapon from map ) except scout ? That's all ? YOu don't want to block buy or others, I don't know.

T.N.T 02-21-2009 15:49

Re: [Request] Remove weapon entity/Block weapon pickup
 
No this is an OTHER plugin. I'm using yours but I need this one too.

+I want to remove weapon on the ground ( weapon from map )
+or if that is impossible, block weapon pickup WITHOUT getting the ammo.
+Just block everything, even scout to be picked up from world

Arkshine 02-21-2009 16:01

Re: [Request] Remove weapon entity/Block weapon pickup
 
What ? You are not clear.

Quote:

+ cant pickup weapon entities from the map EXCEPT scout and c4!
Quote:

+Just block everything, even scout to be picked up from world
-_-'

I can remove all weapon on the ground ( only weapon already spawn from map ). But you don't want to remove scout ?

If I understand you want to use this plugin with the last one I've done for you, so it makes sens you want to remove all weapons from the map. Is it right ?


All times are GMT -4. The time now is 06:40.

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