AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Weapons remove from the ground (https://forums.alliedmods.net/showthread.php?t=27434)

k!mo 04-22-2006 07:32

Weapons remove from the ground
 
Hi i need a plugin which makes only this :
When a guy drops a weapons the weapons must removed autmotamically so thats nobdoby can take it again ^^ i use the search button but i find only plugins which doesnt work :(

FrontLine 04-22-2006 07:33

look at the deathmatch plugin...

FL.

v3x 04-22-2006 07:51

This will remove weapons right after they are dropped:
Code:
public pfn_touch(ptr, ptd) {     if(is_valid_ent(ptr) && is_valid_ent(ptd)) {         new classname[32]         entity_get_string(ptr,EV_SZ_classname,classname,31)         if(equali(classname,"weaponbox")) {                     new ents = entity_count();             for(new inum=0;inum<=ents;inum++) {                 if(!is_valid_ent(inum)) continue                 new class[51]                 entity_get_string(inum,EV_SZ_classname,class,50)                 if(containi(class,"weapon_") == -1) continue                 new owner = entity_get_edict(inum,EV_ENT_owner)                 if(ptr == owner)                     remove_entity(inum)             }             remove_entity(ptr)         }         else if(containi(classname,"weapon_") != -1)             remove_entity(ptr)     }     return PLUGIN_CONTINUE }
Requires Engine.

BJ.

k!mo 04-22-2006 09:47

mhh
 
ok v3x but im sorry im not so good @ plugins i dont know what this is xD what i have to do with this ??

v3x 04-22-2006 19:30

Code:
#include <amxmodx> #include <engine>  public pfn_touch(ptr, ptd) {     if(is_valid_ent(ptr) && is_valid_ent(ptd)) {         new classname[32]         entity_get_string(ptr,EV_SZ_classname,classname,31)         if(equali(classname,"weaponbox")) {                     new ents = entity_count();             for(new inum=0;inum<=ents;inum++) {                 if(!is_valid_ent(inum)) continue                 new class[51]                 entity_get_string(inum,EV_SZ_classname,class,50)                 if(containi(class,"weapon_") == -1) continue                 new owner = entity_get_edict(inum,EV_ENT_owner)                 if(ptr == owner)                     remove_entity(inum)             }             remove_entity(ptr)         }         else if(containi(classname,"weapon_") != -1)             remove_entity(ptr)     }     return PLUGIN_CONTINUE }
Save it as pluginname.sma and compile it. It requires Engine in order to run.

GHW_Chronic 04-22-2006 19:44

@v3x: http://www.amxmodx.org/funcwiki.php?go=func&id=388 - For next time.

v3x 04-22-2006 20:05

That was like 2% of my code, the other 98% was by twisty.

GHW_Chronic 04-22-2006 20:23

well it's horrible v3x ok.


All times are GMT -4. The time now is 05:11.

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