Trying to fix these 2 persistent errors
So I'm working on my rebuild/error-free (hopefully) version of noodleboy347's Premium Mod v1.14 and I keep running into these 2 errors:
Code:
25:44: [SM] Native "GetEntProp" reported: Entity -1 (-1) is invalid I've been talking to Toazron over Steam for the past...ohh....2 weeks or so, and he's really helped me out, not only with some things related to this plugin, but also with things like setting up a menu with his basic donator interface. Now, here's the thing. I appreciate you guys posting your little tidbits of help here and there, but when it comes to coding.....I doubt I could even be called a "beginner". So I would greatly appreciate it if someone could look over the plugin, and help me out big time by either: - Posting the fixed code so that I can copy/paste it into the plugin or - Copy/pasting the above pastebin contents into a new pastebin, but with the code that's causing those 2 errors fixed. Major MAJOR credit will be given once I make sure the plugin is 100% error free, and upload it to the New Plugins section. |
Re: Trying to fix these 2 persistent errors
It would help if you highlighted the stack trace function lines.
Regardless, I'd bet that the client has an invalid slot 0 weapon and the following line is executed: PHP Code:
|
Re: Trying to fix these 2 persistent errors
Quote:
EDIT: I just changed my original post. I changed the code tags to php tags. |
Re: Trying to fix these 2 persistent errors
Quote:
PHP Code:
PHP Code:
|
Re: Trying to fix these 2 persistent errors
Quote:
But what I don't get....is what item would count as -1... Slot 0 is primary, slot 1 is secondary and slot 2 is melee, correct? What could be making SM throw that error?.... |
Re: Trying to fix these 2 persistent errors
If the player doesn't carry a primary/secondary or knife, it returns -1 for that weaponindex.
PHP Code:
PHP Code:
|
Re: Trying to fix these 2 persistent errors
Quote:
GetPlayerWeaponSlot returns an index to an entity. That entity is the weapon held by said client in said slot. If the client, for some reason, does not have a weapon in that slot, GetPlayerWeaponSlot will return -1. Look at SetGrenadeAmmo(client, ammo, index, slot) in your first post. Notice the use of IsValidEntity. You need to implement something similar in other parts of your code (e.g. the code we've been discussing). |
Re: Trying to fix these 2 persistent errors
Quote:
Quote:
Not sure if that was the implication =\ But I'll pick up wherever this leaves off tomorrow. I'm in need of alot of sleep. |
Re: Trying to fix these 2 persistent errors
Quote:
Man, helping some people is like herding cats. |
Re: Trying to fix these 2 persistent errors
Quote:
Gimme a break. I'm tired, I should be asleep right now, but I'm not. Plus, keep in mind, I've never done this coding before. I'm basically just going through the code, reading everything and seeing what my brain can translate for me. Ok, after reading....and re-reading...and re-re-reading all your posts, my brain finally decided to stop being stupid and I know the line you're talking about: PHP Code:
|
All times are GMT -4. The time now is 20:40. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.