nvm, I'm starting to get it now, its coming back to me...
although Yea, I'm looking directly @ csdm |
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. |
Rewrite this function so it compares against weapon models instead of weapon names:
Code:
Then do this: Code:
sorry I mixed up ptd and ptr in my original post |
Thanks bail.
Damn, lol, I wasn't really wanting ALL of that, but thanks! I'll be posting other help topics soon... |
Very nice Bail. :)
|
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 |
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_) |
not sure about the first problem, but the second one:
Code:
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 :D ) and when you do this on a string, you modify it (VB's Left makes a new string, so the original string stays unchanged). |
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. |
no, model will be "weapon" then. (6 chars)
|
| All times are GMT -4. The time now is 10:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.