Raised This Month: $32 Target: $400
 8% 

vexd_pfntouch & Weapons on ground...


Post New Thread Reply   
 
Thread Tools Display Modes
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 05-27-2004 , 01:09  
Reply With Quote #11

nvm, I'm starting to get it now, its coming back to me...

although Yea, I'm looking directly @ csdm
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 05-27-2004 , 01:25  
Reply With Quote #12

ok, I'm back to needing help.

How can I find out if the player touches a weapon and what weapon it is?...and how to put it in his inventory.

Its getting confusing now. I miss SmallEd.
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
BAILOPAN
Join Date: Jan 2004
Old 05-27-2004 , 01:40  
Reply With Quote #13

Rewrite this function so it compares against weapon models instead of weapon names:

Code:
//Change this to getWpFromModel(wp[]) getCSDMWpId(wp[]) {     if (equali(wp, "csdmw_p228")) {         return CSW_P228     } else if (equali(wp, "csdmw_scout")) {         return CSW_SCOUT     } else if (equali(wp, "csdmw_hegrenade")) {         return CSW_HEGRENADE     } else if (equali(wp, "csdmw_xm1014")) {         return CSW_XM1014     } else if (equali(wp, "csdmw_c4")) {         return CSW_C4     } else if (equali(wp, "csdmw_mac10")) {         return CSW_MAC10     } else if (equali(wp, "csdmw_aug")) {         return CSW_AUG     } else if (equali(wp, "csdmw_smokegrenade")) {         return CSW_SMOKEGRENADE     } else if (equali(wp, "csdmw_elite")) {         return CSW_ELITE     } else if (equali(wp, "csdmw_fiveseven")) {         return CSW_FIVESEVEN     } else if (equali(wp, "csdmw_ump45")) {         return CSW_UMP45     } else if (equali(wp, "csdmw_sg550")) {         return CSW_SG550     } else if (equali(wp, "csdmw_galil")) {         return CSW_GALIL     } else if (equali(wp, "csdmw_famas")) {         return CSW_FAMAS     } else if (equali(wp, "csdmw_usp")) {         return CSW_USP     } else if (equali(wp, "csdmw_glock18")) {         return CSW_GLOCK18     } else if (equali(wp, "csdmw_awp")) {         return CSW_AWP     } else if (equali(wp, "csdmw_mp5navy")) {         return CSW_MP5NAVY     } else if (equali(wp, "csdmw_m249")) {         return CSW_M249     } else if (equali(wp, "csdmw_m3")) {         return CSW_M3     } else if (equali(wp, "csdmw_m4a1")) {         return CSW_M4A1     } else if (equali(wp, "csdmw_tmp")) {         return CSW_TMP     } else if (equali(wp, "csdmw_g3sg1")) {         return CSW_G3SG1     } else if (equali(wp, "csdmw_flashbang")) {         return CSW_FLASHBANG     } else if (equali(wp, "csdmw_deagle")) {         return CSW_DEAGLE     } else if (equali(wp, "csdmw_sg552")) {         return CSW_SG552     } else if (equali(wp, "csdmw_ak47")) {         return CSW_AK47     } else if (equali(wp, "csdmw_knife")) {         return CSW_KNIFE     } else if (equali(wp, "csdmw_p90")) {         return CSW_P90     }         return 0 }

Then do this:
Code:
public pfn_touch(ptr, ptd) {    if ((ptd>=1 && ptd<=32) && is_user_connected(ptd)) {       new Model[32], wp, wpname[32]       entity_get_string(ptr, EV_SZ_model, Model, 31)       wp = getWpFromModel(Model)       get_weaponname(wp, wpname, 31)       give_item(ptd, wpname)    }    return PLUGIN_CONTINUE }

sorry I mixed up ptd and ptr in my original post
__________________
egg
BAILOPAN is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 05-27-2004 , 02:15  
Reply With Quote #14

Thanks bail.

Damn, lol, I wasn't really wanting ALL of that, but thanks!

I'll be posting other help topics soon...
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
Peli
Veteran Member
Join Date: Mar 2004
Location: San Diego, CA
Old 05-27-2004 , 02:16  
Reply With Quote #15

Very nice Bail.
Peli is offline
Send a message via MSN to Peli
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 05-27-2004 , 02:32  
Reply With Quote #16

Wow, nice -- I could use this for putting a chicken model on the map and if you touch it you do something. Glow, llama, etc...lol

Thats sweet, thanks bailo
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 05-27-2004 , 02:50  
Reply With Quote #17

I got a problem

I have AK, and Colt

I drop AK -- I switch to colt and it gives me AK back?

I can drop ak's and colts crazy around the map and it just keeps giving them to me even if I'm not on one...any way to delay this so I can drop it from inventory without picking it up again while in the air?

Also, is there a function to get a certain number of chars on the left of a string?...I know in VB its left(num, string) (Its so I can remove the entity once picked up...I gotta check if its a weapon_)
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 05-27-2004 , 05:41  
Reply With Quote #18

not sure about the first problem, but the second one:

Code:
new string[64]; // some native that fills string with data string[5] = 0; // string now contains only the first 5 characters returned by the native.

It works because strings in Small are (like strings in C) zero-terminated arrays of characters. So when you write a 0 to the index x, the string will only appear to have x characters (not x-1 because 0 is a valid index).

Note that you can't do this on constant strings ( "balbla"[4] = 0 ) and when you do this on a string, you modify it (VB's Left makes a new string, so the original string stays unchanged).
__________________
hello, i am pm
PM is offline
ThantiK
Senior Member
Join Date: Mar 2004
Location: Orlando, FL
Old 05-27-2004 , 07:33  
Reply With Quote #19

Thanks PM...so I should end up with something like....

model[32] is "weapon_g3sg1"
model[6] = 0

model will then be "weapon_" after I do model[6] = 0?

Of course I'd be moving it to a new var to check it.
__________________
AMXX -- You want control? You got it.
tkwired.com cs 1.6 -- tkwired.com:27016
ThantiK is offline
Send a message via AIM to ThantiK Send a message via MSN to ThantiK
PM
hello, i am pm
Join Date: Jan 2004
Location: Canalization
Old 05-27-2004 , 09:46  
Reply With Quote #20

no, model will be "weapon" then. (6 chars)
__________________
hello, i am pm
PM 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 14:33.


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