SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Discussion

Reply
 
Thread Tools Display Modes
Old 20/02/2020, 06:02 AM   #1
Assister
Little Clucker
 
Join Date: Sep 2017
Location: Earth
Posts: 8
Reputation: 0
Default Store coordinates in variable or database?

So I have a lot of coordinates in my script, like pickup, checkpoint and another coordinates for something...

If I keep add more coordinates and store it to some variable like this:
Code:
enum dataCoordinat
{
	Float:X,
	Float:Y,
	Float:Z
}

new coordinateVar[][dataCoordinat] =
{
	{362.739501, -1378.906982, 14.386166},
	{...},
}
Later i'll use it for create some dynamic area:
Code:
for(new i = 0; i < sizeof(coordinateVar); i++)
{
	CreateDynamicCylinder(coordinateVar[i][X], coordinateVar[i][Y], coordinateVar[i][Z], 900, 90, 0, 0, playerid);
}
Is it fine for our server memory?
or
Should I store the coordinat to database?
Assister is offline   Reply With Quote
Old 20/02/2020, 05:43 PM   #2
StonedApe
Little Clucker
 
Join Date: Nov 2019
Posts: 9
Reputation: 9
Default Re: Store coordinates in variable or database?

It should be fine to keep it as variables in the script, afaik there'd be very little difference whether you stored them in a database or not.
__________________
Developer of Fallout Apocalypse Roleplay
Developer of Wild West Roleplay
StonedApe is offline   Reply With Quote
Old 21/02/2020, 01:50 AM   #3
BlackBank
Gangsta
 
Join Date: Dec 2010
Location: The Netherlands
Posts: 523
Reputation: 437
Default Re: Store coordinates in variable or database?

Use the way you like the most. But creating an array with all the coordinates is fine and don't use that much memory, it's also faster to load, so no need to wait for any database activity to finish.
BlackBank is offline   Reply With Quote
Old 21/02/2020, 08:13 AM   #4
Assister
Little Clucker
 
Join Date: Sep 2017
Location: Earth
Posts: 8
Reputation: 0
Default Re: Store coordinates in variable or database?

Quote:
Originally Posted by StonedApe View Post
It should be fine to keep it as variables in the script, afaik there'd be very little difference whether you stored them in a database or not.
Quote:
Originally Posted by BlackBank View Post
Use the way you like the most. But creating an array with all the coordinates is fine and don't use that much memory, it's also faster to load, so no need to wait for any database activity to finish.

Thank you for your reply guys.
Glad to read this information, I'm always use this way to create some feature with a lot of coordinates. I'm start worried because I'm always add more and more coordinate for another feature. XD
Assister is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to store colors in variable GospodinX Scripting Help 4 29/01/2019 01:44 PM
Store actor in a variable iDark Scripting Help 1 12/11/2017 09:25 PM
How to store int and float in 1 variable basicllsw Scripting Help 5 26/03/2015 04:25 AM
[HELP] Store from mysql to variable hariprasetyoaji Scripting Help 2 02/05/2014 06:14 AM


All times are GMT. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.