SA-MP Forums Archive
createobject from array coords - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: createobject from array coords (/showthread.php?tid=650412)



createobject from array coords - PepsiCola23 - 27.02.2018

so i got this array
PHP код:
new Float:ObjectCOORDS[6][3] = {
{
1208.9227,-881.9604,42.9228}, // ls
{1011.0600,-1358.2766,13.3515},
{
787.0550,-1608.8682,13.3906},
{
2380.2878,-1890.4946,13.3891},
{
2153.1802,-1173.5449,23.8234},
{
1981.1147,-1277.8353,23.8203}
}; 
how can i create a function that autoamtically creates objects from this coordinates,at all coordinates,when the server starts?


Re: createobject from array coords - Eoussama - 27.02.2018

Loop through the array and create your objects.

PHP код:
// sizeof(ObjectCOORDS) = 6
for(new isizeof(ObjectCOORDS); i<ji++)
    
CreateObject(object_idObjectCOORDS[i][0], ObjectCOORDS[i][1], ObjectCOORDS[i][2], 0.00.00.0); 
• ObjectCOORDS's dissection
Indices
0
1
2
Values: 01208.9227-881.960442.9228
Values: 11011.0600-1358.276613.3515
Values: 2787.0550-1608.868213.3906
Values; 32380.2878-1890.494613.3891
Values: 42153.1802-1173.544923.8234
Values: 51981.1147-1277.835323.8203



Re: createobject from array coords - PepsiCola23 - 27.02.2018

Quote:
Originally Posted by Eoussama
Посмотреть сообщение
Loop through the array and create your objects.

PHP код:
// sizeof(ObjectCOORDS) = 6
for(new isizeof(ObjectCOORDS); i<ji++)
    
CreateObject(object_idObjectCOORDS[i][0], ObjectCOORDS[i][1], ObjectCOORDS[i][2], 0.00.00.0); 
thank you,solved !