Speedcameras is not loading (R40)
#7

Quote:
Originally Posted by PowerPC603
Посмотреть сообщение
PHP код:
cache_get_value_name_float(i"Cam_ID"DID); 
You still need this to load the ID from the database.
Without it, DID will always have the value 0 and you will still store all data at index 0 of the array, even if you have 1000 cameras.

Put in as first line inside the while loop, before loading the other values.
That way, you'll use DID as index for the array.

And if you wanna keep to use the function CreateSpeedCamera, load all values into temporary variables like x, y, z, a and pass these to the function.
No need to store them in the proper place first, then pass those same values towards the function, which will simply overwrite them with the same values again.




Inside the addcam command:
PHP код:
for(new i=1MAX_CAMERASi++) 
Start assigning ID's starting from 1 instead of 0.
And remove all the "i+1" stuff, replace it by "i".
Assigning an ID first and then adding 1 to it is confusing.



Inside the CreateSpeedCamera function, remove the "CamID++;" line.

You give the ID as parameter already, so why not use it directly?
When you would be a teacher and you say to your class to open their book at page 47, do you expect your class to open the book at page 48?
No, because you stated page 47 explicitly as parameter for opening the book.
ok but tho i have 1 error:

Код:
            cache_get_value_name_float(i, "Cam_ID", DID);
Код:
warning 213: tag mismatch
Reply


Messages In This Thread
Speedcameras is not loading (R40) - by Ryan50 - 25.02.2017, 17:36
Re: Speedcameras is not loading (R40) - by Ryan50 - 25.02.2017, 22:15
Re: Speedcameras is not loading (R40) - by PowerPC603 - 26.02.2017, 09:00
Re: Speedcameras is not loading (R40) - by Runn3R - 26.02.2017, 10:12
Re: Speedcameras is not loading (R40) - by Ryan50 - 26.02.2017, 15:30
Re: Speedcameras is not loading (R40) - by PowerPC603 - 26.02.2017, 19:58
Re: Speedcameras is not loading (R40) - by Ryan50 - 26.02.2017, 20:33
Re: Speedcameras is not loading (R40) - by Runn3R - 26.02.2017, 22:26
Re: Speedcameras is not loading (R40) - by Ryan50 - 26.02.2017, 22:28
Re: Speedcameras is not loading (R40) - by Ryan50 - 27.02.2017, 14:37

Forum Jump:


Users browsing this thread: 1 Guest(s)