Can valid entity IDs go bellow 0?

Started by ., Feb 01, 2015, 02:26 AM

Previous topic - Next topic

.

Can a valid entity in the game use an id bellow 0? What I mean is, can a player, object, pickup etc. have an ID bellow 0 and still be valid?

EDIT:

What are the ranges of an ID for the various entities. Like starting from 0 and ending at ex. max int, 10000, 100 etc. Or, starting from -10 and ending at 1002, 23 etc.
.

Sebastian

I never heard about an entity ID bellow 0. But a developer should answer to this. :)

About the other thing,, if you are looking for the limits, check VC:MP Developers' Blog and wiki.
(wiki has updated limits)

.

Quote from: sseebbyy on Feb 01, 2015, 09:17 AMAbout the other thing,, if you are looking for the limits, check VC:MP Developers' Blog and wiki.
(wiki has updated limits)

Weird, the blog entry has vehicles limited at 500 while the script wiki has them at 1000 :-\

Quote from: sseebbyy on Feb 01, 2015, 09:17 AMI never heard about an entity ID bellow 0. But a developer should answer to this. :)

Actually I'm quite sure about that too. But I want to be sure about this. The first hint was the fact that the script stores them in arrays, which start from 0. So that was quite obvious. But I'm curious what kind of IDs are returned from the server and what might be their limits.
.

Thijn

Quote from: S.L.C on Feb 01, 2015, 09:36 AM
Quote from: sseebbyy on Feb 01, 2015, 09:17 AMAbout the other thing,, if you are looking for the limits, check VC:MP Developers' Blog and wiki.
(wiki has updated limits)

Weird, the blog entry has vehicles limited at 500 while the script wiki has them at 1000 :-\
That blog has the title current technical limits, and is 2 years old. So not that weird it changed :P

Stormeus

#4
Quote from: S.L.C on Feb 01, 2015, 02:26 AMCan a valid entity in the game use an id bellow 0?

Nope. Full stop.

EDIT: Technical explanation: the only way I can imagine any valid entity having an ID below 0 is if an integer underflow in a plugin or in the server ends up being equivalent to a valid ID. I'd also imagine this would cause very bad things to happen, and if such an error were to occur, the server would probably crash from a memory access violation.

.

Quote from: stormeus on Feb 02, 2015, 07:43 AMNope. Full stop.

One more question if it's not to much. Say that a call to (API_FUNCS)->CreateObject(); fails (maybe wrong arguments). What kind of ID should I expect back?
.

Stormeus

Quote from: S.L.C on Feb 02, 2015, 07:45 AM
Quote from: stormeus on Feb 02, 2015, 07:43 AMNope. Full stop.

One more question if it's not to much. Say that a call to (API_FUNCS)->CreateObject(); fails (maybe wrong arguments). What kind of ID should I expect back?

-1. This is a valid response for that function because the server won't accept it as a valid ID and thus signals the object couldn't be created.

.

#7
Quote from: stormeus on Feb 02, 2015, 07:43 AMEDIT: Technical explanation: the only way I can imagine any valid entity having an ID below 0 is if an integer underflow in a plugin or in the server ends up being equivalent to a valid ID. I'd also imagine this would cause very bad things to happen, and if such an error were to occur, the server would probably crash from a memory access violation.

Yeah stormeus and today's weather predicts raining with unicorns. Those are rare chances that we can't do nothing about it. And it's understandable :)
.

.

Quote from: stormeus on Feb 02, 2015, 07:48 AM-1. This is a valid response for that function because the server won't accept it as a valid ID and thus signals the object couldn't be created.

Fine by me. This clears my questions and thank you for the feedback :)
.