createobject from array coords
#1

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?
Reply
#2

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
Reply
#3

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 !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)