Removing Weapons by Entity
Im trying to remove specific weapons that are dropped by players, but im having a hard time getting this to work. I get an error: "unknown entity 97", and I have no Idea whats wrong.... heres the code:
Code:
I used register_clcmd("drop","handle_drop") to catch a players drop. I don't know why this won't work. The server just crashes when I execute my plugin.... Thanks for the help. -Knekter |
Let's take a look at your code here:
Code:
Let's say it finds a weaponbox with an id of 37. tEnt is now 37. Now you're telling the plugin that as long as tEnt (37 in this case) is larger than 0 (which it is), then do what you tell it to. However, tEnt remains 37 forever and ever and ever so it keeps looping and causes an infinite loop, thus crashing it. The correct way for looping through all entities would be: Code:
This infinite loop error occurs twice in your code. |
lol
Well I feel stupid, sorry for this pointless error :(
|
Okay you are going about this all wrong.. im gonna show you a code that works all the time and is perfect in all means :D....
Code:
|
That's good if you only want to find one. And if weaponboxes had models.
|
No, he is doing it through a drop command, and u can list several models for the check, also any weapon will have a model in the weaponbox so i don't konw what you are talking about..
Code:
|
| All times are GMT -4. The time now is 19:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.