Help in object creating
#8

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
That's plain out terrible advice... Please learn enums and such before suggesting this again.


There's 12 fields defined, so when it hits this code, it WILL error out saying there's not enough params, or such.

And it's not the streamer that would error, the compiler should fail and give the error at compile time.
You can define arrays with data and leave out as many entries as you wish (eg only 2 values for an array with the size of 5). The rest will be initialized with zeros.


The problem here is that all entries of lockerPos are Float values, but later they are used for all arguments of CreateDynamicObject (eg. playerid, virtualworld or interior) and are passed as int representation of the Float values.

That means -1.0 will not be passed as -1 and the object will have wrong properties, it will probably not show in any of the virtual worlds, interiors etc.

@OP The best solution would be to not use an embedded array here. It's not neccessary.

Define the lockers like this:

Код:
enum ___lockerDat
{
Float:lockerX,
Float:lockerY,
Float:lockerZ,
Float:lockerRX,
Float:lockerRY,
Float:lockerRZ
lockerVirtualWorld,
lockerPlayerID,
lockerInterior,
Float:lockerStreamDistance,
lockerID
};

new Lockers[MAX_LOCKER][___lockerDat] =
{
{-36.9, -91.6, 1003, 0, 0, 180, -1, -1, -1, 200.0, 0},
// etc..
};
Or just embed the actual coords in one array, but do not mix integer and Float values in one Array without enum.
Reply


Messages In This Thread
Help in object creating - by Ahmadd - 10.07.2018, 16:03
Re: Help in object creating - by Ahmadd - 11.07.2018, 06:34
Re: Help in object creating - by Florin48 - 11.07.2018, 06:36
Re: Help in object creating - by Ahmadd - 11.07.2018, 12:25
Re: Help in object creating - by Sew_Sumi - 11.07.2018, 19:43
Re: Help in object creating - by Florin48 - 11.07.2018, 20:13
Re: Help in object creating - by Sew_Sumi - 11.07.2018, 20:30
Re: Help in object creating - by NaS - 11.07.2018, 20:47
Re: Help in object creating - by Sew_Sumi - 11.07.2018, 21:37

Forum Jump:


Users browsing this thread: 1 Guest(s)