Raised This Month: $ Target: $400
 0% 

removing gun on ground


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Locks
Senior Member
Join Date: Sep 2005
Old 03-21-2006 , 20:48   removing gun on ground
Reply With Quote #1

What's the code for removing a weapon on the ground like after a person drops it?
Locks is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-21-2006 , 21:08  
Reply With Quote #2

Code:
new g_Ents; public plugin_init() {     g_Ents = get_global_int(GL_maxEntities); } public pfn_touch(ptr, ptd) {     if(is_valid_ent(ptr) && is_valid_ent(ptd)) {         new classname[32]         if(is_valid_ent(ptr))             entity_get_string(ptr,EV_SZ_classname,classname,31)         if(equali(classname,"weaponbox")) {                 for(new inum=0;inum<=g_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 }
Edited from twisty's TDM plugin, I believe.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Locks
Senior Member
Join Date: Sep 2005
Old 03-21-2006 , 21:21  
Reply With Quote #3

Oh, forgot to mention, how do I make it so that it will only remove a certain weapon ONLY for a certain player
Locks is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-21-2006 , 21:27  
Reply With Quote #4

Use global variables and check the models.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Locks
Senior Member
Join Date: Sep 2005
Old 03-21-2006 , 21:31  
Reply With Quote #5

Examples??..

Like after a player being hit
Locks is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 03-21-2006 , 22:40  
Reply With Quote #6

Not sure what you mean.

You can check the model like so:

Code:
new model[64]; entity_get_string(ptr , EV_SZ_model , model , 63); if(equal(model , "models/w_m4a1.mdl")) {   // dropped/touched m4a1 }
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Locks
Senior Member
Join Date: Sep 2005
Old 03-21-2006 , 22:58  
Reply With Quote #7

i meant, how do you make it so then it will only remove a dropped gun on that one person

Like how do you make it only work for that one person except for everyone else
Locks is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-22-2006 , 08:28  
Reply With Quote #8

On which action you want to remove weapon?
Drop, touch, event, console command, time delay or what?
VEN is offline
Locks
Senior Member
Join Date: Sep 2005
Old 03-22-2006 , 18:13  
Reply With Quote #9

drop
Locks is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-23-2006 , 10:39  
Reply With Quote #10

So you want to remove weapon right after manual drop?
Or any drop: manual and automatic (on death)?
Or on auto drop only?
VEN 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 16:39.


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