Raised This Month: $ Target: $400
 0% 

help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin22
Junior Member
Join Date: Aug 2005
Old 09-09-2005 , 01:48   help
Reply With Quote #1

how do i make it if you touch someone then they automaticly die? sorry for stupid question im noob at coding
Austin22 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 09-09-2005 , 07:24  
Reply With Quote #2

Code:
public pfn_touch(ptr,ptd) {     if(ptr > 0 && ptd > 0)     {         new pToucher[32],pTouched[32];         entity_get_string(ptr,EV_SZ_classname,pToucher,31);         if(ptd > 0 && is_valid_ent(ptd))             entity_get_string(ptd,EV_SZ_classname,pTouched,31);         if(equal(pTouched,"player") && is_user_connected(ptd))             user_kill(ptd);     } }
__________________
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
Xanimos
Veteran Member
Join Date: Apr 2005
Location: Florida
Old 09-09-2005 , 13:58  
Reply With Quote #3

v3x What is your problem with double checking things.
Quote:
Originally Posted by v3x
Code:
if(ptr > 0 && ptd > 0)
Code:
if(ptd > 0 && is_valid_ent(ptd))
Xanimos is offline
Send a message via AIM to Xanimos Send a message via MSN to Xanimos
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-09-2005 , 15:46  
Reply With Quote #4

This would be the proper way:

Code:
public pfn_touch(ptr,ptd) {     if(is_user_connected(ptr) && is_user_connected(ptd))     {             user_kill(ptd);     } }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Austin22
Junior Member
Join Date: Aug 2005
Old 09-09-2005 , 16:32  
Reply With Quote #5

thanks.
Austin22 is offline
Reply



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 14:28.


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